【Joe】Ty、WP网站美化,JS/CSS全网搜集
侧边栏壁纸
  • 累计撰写 75 篇文章
  • 累计收到 21 条评论

【Joe】Ty、WP网站美化,JS/CSS全网搜集

逍遥博客
2021-11-11 / 0 评论 / 4 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2023年09月22日,已超过308天没有更新,若内容或图片失效,请留言反馈。
网站公告弹窗

演示

Test

<!-- 弹窗公告开始-->
<script src="https://cdn.bootcss.com/sweetalert/2.1.0/sweetalert.min.js"></script>
<script>
swal('标题','正文','success');
</script>
<!-- 弹窗公告结束-->

食用方法:编辑好内容后,找到目录文章index.php,拉到最底下新建一行,粘贴代码,即可使用!
index文件地址:

目录/user/themes/主题/index.php



来访者信息统计弹窗

代码实现

<!-- 客户端信息 -->    <div id="fps" style="z-index:5;position:fixed;bottom:3px;left:3px;color:#2196F3;font-size:10px;-webkit-pointer-events: none;    -moz-pointer-events: none;    -ms-pointer-events: none;    -o-pointer-events: none;"></div>    <script type="text/javascript" src="https://cdn.jsdelivr.net/gh/kaliisra/myblogstatic/kehuduan-js/fetch.min.js"></script>    <script src="https://cdn.gmit.vip/layer/3.1.1/layer.js" type="text/javascript" charset="utf-8"></script>    <script>    /*网站打开提醒代码开始*/    $(function(){        if(/*getCookie('msg') !=*/ 1){            var t = document.createElement("a");            t.href = document.referrer;            var msgTitle = t.hostname;            var name = t.hostname.split(".")[1];            if("" !== document.referrer){                switch (name) {                    case 'bing':                        msgTitle = '必应搜索';                        break;                    case 'baidu':                        msgTitle = '百度搜索';                        break;                    case 'so':                        msgTitle = '360搜索';                        break;                    case 'google':                        msgTitle = '谷歌搜索';                        break;                    case 'sm':                        msgTitle = '神马搜索';                        break;                    case 'sogou':                        msgTitle = '搜狗搜索';                        break;                    default:                        msgTitle =  t.hostname;                };            };            var time = (new Date).getHours();            var msg = '';            23 < time || time <= 5 ? msg = "你是夜猫子呀?这么晚还不睡觉,明天起的来嘛?":            5< time && time <= 7 ? msg = "早上好!一日之计在于晨,美好的一天就要开始了!":            7< time && time <= 11 ? msg = "上午好!工作顺利嘛,不要久坐,多起来走动走动哦!":            11< time && time <= 14 ? msg = "中午了,工作了一个上午,现在是午餐时间!":            14< time && time <= 17 ? msg = "午后很容易犯困呢,今天的运动目标完成了吗?":            17< time && time <= 19 ? msg = "傍晚了!窗外夕阳的景色很美丽呢,最美不过夕阳红~":            19< time && time <= 21 ? msg = "晚上好,今天过得怎么样?":            21< time && time <= 23 && (msg = "已经这么晚了呀,早点休息吧,晚安~");            $.ajax({                type:"get",                url:"https://api.gmit.vip/Api/UserInfo/",                async:true,                success:function(data){                    window.info = data;                    layer.msg("Hi~ 来自"+ data.data.location + '~<br/>通过 '+msgTitle+' 进来的朋友!<br/>使用 '+ data.data.os +"<br/>"+ data.data.browser +' 访问本站!' + '<br/>' + msg);                    var showFPS = (function(){                        var requestAnimationFrame =                            window.requestAnimationFrame ||                            window.webkitRequestAnimationFrame ||                            window.mozRequestAnimationFrame ||                            window.oRequestAnimationFrame ||                            window.msRequestAnimationFrame ||                            function(callback) {                                window.setTimeout(callback, 1000/60);                            };                        var e,pe,pid,fps,last,offset,step,appendFps;                         fps = 0;                        last = Date.now();                        step = function(){                            offset = Date.now() - last;                            fps += 1;                            if( offset >= 1000 ){                            last += offset;                            appendFps(fps);                            fps = 0;                            };                            requestAnimationFrame( step );                        };                        appendFps = function(fps){                            var settings = {                                timeout: 5000,                                logError: true                            };                            $('#fps').html('<span style="float:left;">'+fps+'FPS</span><br/><span style="float:left">'+window.info.data.os+'</span><br/><span style="float:left;margin-top:1px;">'+window.info.data.browser+'</span><br/><span style="float:left;margin-top:1px;">'+window.info.data.location+'</span><br/><span style="float:left;margin-top:1px;"></span>');                        };                        step();                    })();                }            });        };    });    </script> 

插件实现

这里给大家推荐一个很良心的插件,他不止有弹窗功能,其他黑圈圈啥的动画都是通过这个插件实现的!
插件链接:

https://txmmp.cn/index.php/archives/27/?scroll=comment-745

代码食用方法:index.php最底下即可食用!
插件食用方法:在目录/usr/plugins里上传插件压缩包,解压,到控制台-插件开启插件!
弹窗位置:通用主题美化-弹窗功能-访问弹窗



网页上层滚动文字
<marquee border='0' align='middle' scrolldelay='80'>滚动内容</marquee>
顶端彩条跑马灯

给网站顶端加上彩条跑马灯美化(此功能也可以下载插件)
<!-- 顶部跑马灯特效 -->
<style>
    #top-grrk{
    background:url(https://external-30160.picsz.qpic.cn/e94ff0137dfb6cc51925d4ccf61d2541);
    height:2px;
    position:fixed;
    width:100%;
    Z-index:10000;
}
</style>    
<div id="top-grrk"></div>
<!-- 顶部跑马灯特效 -->

食用方法:在主题header.php顶部新建一行并插入即可!



计算网站建站时间

Test

<!-- 顺数计日开始 -->
<span id="momk"></span><span id="momk" style="color: #ff0000;"></span>
<script type="text/javascript">
function NewDate(str) {
str = str.split('-');
var date = new Date();
date.setUTCFullYear(str[0], str[1] - 1, str[2]);
date.setUTCHours(0, 0, 0, 0);
return date;
}
function momxc() {
var birthDay =NewDate("2021-6-12");
var today=new Date();
var timeold=today.getTime()-birthDay.getTime();
var sectimeold=timeold/1000
var secondsold=Math.floor(sectimeold);
var msPerDay=24*60*60*1000; var e_daysold=timeold/msPerDay;
var daysold=Math.floor(e_daysold);
var e_hrsold=(daysold-e_daysold)*-24;
var hrsold=Math.floor(e_hrsold);
var e_minsold=(hrsold-e_hrsold)*-60;
var minsold=Math.floor((hrsold-e_hrsold)*-60); var seconds=Math.floor((minsold-e_minsold)*-60).toString();
document.getElementById("momk").innerHTML = "XXX已过去了"+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒";
setTimeout(momxc, 1000);
}momxc();
</script>  <style>
#momk{animation:change 10s infinite;font-weight:800; }
@keyframes change{0%{color:#5cb85c;}25%{color:#556bd8;}50%{color:#e40707;}75%{color:#66e616;}100% {color:#67bd31;}}
</style>
<!-- 顺数计日结束 -->

食用方法:在想要的地方插入即可,其中NewDate("2021-6-12")中的日期为开始时间,”XXX已过去了“可根据自身需要自行修改


ty伪静态

(就是无index.php)

if (!-e $request_filename) {
    rewrite ^(.*)$ /index.php$1 last;
}
网站卡片阴影

Test

body { --box-shadow: 0px 0px 20px -5px rgba(158, 158, 158, 5); }
body { --box-shadow: 10px 10px 15px #888888 !important }



备案图标

Test

<svg t="1620356167087" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7694" width="30" height="30"><path d="M778.24 163.84c-76.8-40.96-165.888-61.44-269.312-61.44s-192.512 20.48-269.312 61.44h-133.12l23.552 337.92c8.192 113.664 67.584 217.088 162.816 280.576l215.04 144.384 215.04-144.384c96.256-63.488 155.648-166.912 163.84-280.576l23.552-337.92H778.24z m47.104 333.824c-7.168 94.208-56.32 181.248-135.168 233.472l-181.248 120.832L327.68 731.136c-78.848-53.248-129.024-139.264-135.168-233.472L173.056 225.28h136.192v-26.624c58.368-23.552 124.928-34.816 199.68-34.816s141.312 12.288 199.68 34.816V225.28H844.8l-19.456 272.384z" fill="#0649D0" p-id="7695"></path><path d="M685.056 328.704v-46.08H455.68c2.048-4.096 6.144-9.216 11.264-15.36 5.12-7.168 9.216-12.288 11.264-15.36L419.84 240.64c-31.744 46.08-75.776 87.04-133.12 123.904 4.096 4.096 10.24 11.264 18.432 21.504l17.408 17.408c23.552-15.36 45.056-31.744 63.488-50.176 26.624 25.6 49.152 43.008 67.584 51.2-46.08 15.36-104.448 27.648-175.104 35.84 2.048 5.12 6.144 13.312 9.216 24.576 4.096 11.264 6.144 19.456 7.168 24.576l39.936-7.168v218.112H389.12V680.96h238.592v19.456h54.272V481.28H348.16c60.416-12.288 114.688-27.648 163.84-46.08 49.152 19.456 118.784 34.816 210.944 46.08 5.12-17.408 10.24-34.816 17.408-51.2-62.464-4.096-116.736-12.288-161.792-24.576 38.912-20.48 74.752-46.08 106.496-76.8z m-150.528 194.56h94.208v41.984h-94.208v-41.984z m0 78.848h94.208v41.984h-94.208v-41.984z m-144.384-78.848h94.208v41.984H390.144v-41.984z m0 78.848h94.208v41.984H390.144v-41.984zM424.96 326.656h182.272c-26.624 22.528-57.344 41.984-94.208 57.344-31.744-15.36-61.44-34.816-88.064-57.344z" fill="#0649D0" p-id="7696"></path></svg>

食用方法:在后面加上文字就可以了

本站受法律保护文字(不要乱用哦)
<section class="banquan-links">
    <p style="text-align: center;">
        <a target="_blank" href="http://www.gov.cn/" rel="nofollow">
            <img style="max-width:100%;overflow:hidden;" src="http://cdn.jsdelivr.net/gh/cy-j/chenyu/img/baohu.png" alt="本站受中华人民共和国法律保护">
        </a>
    </p>   
<ction>

Test
食用方法:在底部添加代码

底部蓝色波浪代码
<!--底部波浪开始-->
<div class="qin0_layout">
<svg class="editorial"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    viewBox="0 24 150 28"
    preserveAspectRatio="none">
<defs>
<path id="gentle-wave"
d="M-160 44c30 0 
   58-18 88-18s
   58 18 88 18 
   58-18 88-18 
   58 18 88 18
   v44h-352z" />
 </defs>
 <g class="parallax">
  <use xlink:href="#gentle-wave" x="50" y="0" fill="#4579e2"/>
  <use xlink:href="#gentle-wave" x="50" y="3" fill="#3461c1"/>
  <use xlink:href="#gentle-wave" x="50" y="6" fill="#2d55aa"/>  
 </g>
</svg>
</div>
<style type='text/css'>
.parallax > use{animation: move-forever 12s linear infinite;}.parallax > use:nth-child(1){animation-delay: -2s;}.parallax > use:nth-child(2){animation-delay: -2s; animation-duration: 5s;}.parallax > use:nth-child(3){animation-delay: -4s; animation-duration: 3s;}@keyframes move-forever{0%{transform: translate(-90px, 0%);} 100%{transform: translate(85px, 0%);}}.qin0_layout{{width: 100%;height: 40px;position: relative;overflow: hidden;z-index: 1;background: var(--footer-bg);}.editorial{display: block; width: 100%; height: 40px; margin: 0;}
</style>
<!--底部波浪结束-->



自定义右键菜单

Test

<!-- 右键美化 -->
<style type="text/css">
    a {text-decoration: none;}
    div.usercm{background-repeat:no-repeat;background-position:center center;background-size:cover;background-color:#fff;font-size:13px!important;width:130px;-moz-box-shadow:1px 1px 3px rgba
(0,0,0,.3);box-shadow:0px 0px 15px #333;position:absolute;display:none;z-index:10000;opacity:0.9; border-radius: 8px;}
    div.usercm ul{list-style-type:none;list-style-position:outside;margin:0px;padding:0px;display:block}
    div.usercm ul li{margin:0px;padding:0px;line-height:35px;}
    div.usercm ul li a{color:#666;padding:0 15px;display:block}
    div.usercm ul li a:hover{color:#fff;background:rgba(170,222,18,0.88)}
    div.usercm ul li a i{margin-right:10px}
    a.disabled{color:#c8c8c8!important;cursor:not-allowed}
    a.disabled:hover{background-color:rgba(255,11,11,0)!important}
    div.usercm{background:#fff !important;}
    </style>
<div class="usercm" style="left: 199px; top: 5px; display: none;">
    <ul>
        <li><a href="https://chenyu.me/"><i class="fa fa-home fa-fw"></i><span>首页</span></a></li>
        <li><a href="javascript:void(0);" onclick="getSelect();"><i class="fa fa-copy fa-fw"></i><span>复制</span></a></li>
        <li><a href="javascript:history.go(1);"><i class="fa fa-arrow-right fa-fw"></i><span>前进</span></a></li>
        <li><a href="javascript:history.go(-1);"><i class="fa fa-arrow-left fa-fw"></i><span>后退</span></a></li>
        <li style="border-bottom:1px solid gray"><a href="javascript:window.location.reload();"><i class="fa fa-refresh fa-fw"></i><span>刷新</span></a></li>        
        <li><a href="javascript:void(0);"  onclick="baiduSearch();"><i class="fa fa-paw fa-fw"></i><span>百度</span></a></li>
        <li><a href="javascript:void(0);" onclick="googleSearch();"><i class="fa fa-google fa-fw"></i><span>谷歌</span></a></li>
        <li style="border-bottom:1px solid gray"><a target="_blank" href="//tools.chenyu.me/"><i class="fa fa-refresh fa-fw"></i><span>百宝箱</span></a></li>
        </ul>
</div>
<script type="text/javascript">
    (function(a) {
        a.extend({
            mouseMoveShow: function(b) {
                var d = 0,
                    c = 0,
                    h = 0,
                    k = 0,
                    e = 0,
                    f = 0;
                a(window).mousemove(function(g) {
                    d = a(window).width();
                    c = a(window).height();
                    h = g.clientX;
                    k = g.clientY;
                    e = g.pageX;
                    f = g.pageY;
                    h + a(b).width() >= d && (e = e - a(b).width() - 5);
                    k + a(b).height() >= c && (f = f - a(b).height() - 5);
                    a("html").on({
                        contextmenu: function(c) {
                            3 == c.which && a(b).css({
                                left: e,
                                top: f
                            }).show()
                        },
                        click: function() {
                            a(b).hide()
                        }
                    })
                })
            },
            disabledContextMenu: function() {
                window.oncontextmenu = function() {
                    return !1
                }
            }
        })
    })(jQuery);
 
    function getSelect() {
        "" == (window.getSelection ? window.getSelection() : document.selection.createRange().text) ? layer.msg("请选择需要百度的内容!") : document.execCommand("Copy")
    }
    function baiduSearch() {
        var a = window.getSelection ? window.getSelection() : document.selection.createRange().text;
        "" == a ? layer.msg("请选择需要百度的内容!") : window.open("https://www.baidu.com/s?wd=" + a)
    }
    function googleSearch() {
        var a = window.getSelection ? window.getSelection() : document.selection.createRange().text;
        "" == a ? layer.msg("请选择需要谷歌的内容!") : window.open("https://www.google.com/search?q=" + a)
    }
    $(function() {
        for (var a = navigator.userAgent, b = "Android;iPhone;SymbianOS;Windows Phone;iPad;iPod".split(";"), d = !0, c = 0; c < b.length; c++) if (0 < a.indexOf(b[c])) {
            d = !1;
            break
        }
        d && ($.mouseMoveShow(".usercm"), $.disabledContextMenu())
    });
</script>
<!-- 右键美化结束 -->



代码高亮

Test

Typecho邮件提醒插件

作者链接:https://www.hoehub.com/PHP/typecho-Comment2Mail.html

公网安图标
<div style="width:300px;margin:0 auto; padding:20px 0;">
                 <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=35058302350830" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img src="https://cdn.jsdelivr.net/gh/cgbtz/tc/9e18b29e23688df42dc12a84f498aca3.png" style="float:left;height:25px"/><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">X公网安备XXXX号</p></a>
             </div>
卡片半透明代码
body { --theme: #ff6800; --background: rgba(255,255,255,0.85) }
0

评论 (0)

取消
Blog逍遥阁博客