wordpress美化-其他

article3个月前更新 done
260 1 0

代码取自博主 Bensz 原文章:WordPress网站美化(WP通用美化)

在(footer)自定义 js 代码区域添加如下

  • 打字特效
<!--打字特效开始-->
<script src="https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/input-with-fire.js"></script>
<!--打字特效结束-->
  • 鼠标指针黑标
<!--鼠标指针特效-黑标-开始-->
<style type="text/css">.main-content img,body{cursor:url(https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/mouse/halo-dream/cursor/breeze/Arrow.cur),auto}.actions>div,.expand-done,.main-content figure>figcaption div,.navbar-above .navbar-nav .item,.navbar-searchicon,.navbar-slideicon,.photos .picture-details,.widget .ad-tag .click-close,a,button{cursor:url(https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/mouse/halo-dream/cursor/breeze/Hand.cur),auto}blockquote,code,h1,h2,h3,h4,h5,h6,hr,input[type=text],li,p,td,textarea,th{cursor:url(https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/mouse/halo-dream/cursor/breeze/IBeam.cur),auto}</style>
<!--鼠标指针特效-黑标-结束-->
  • 点击四字成语
<!--点击成语字符开始-->
<script type="text/javascript">
var a_idx = 0;
jQuery(document).ready(function($) {
   $("body").click(function(e) {
       var a = new Array("身体健康","笑口常开","万事如意","合家欢乐","心想事成","金榜题名","前程似锦","一帆风顺","马到成功","年年有余");
       var $i = $("<span/>").text(a[a_idx]);
       a_idx = (a_idx + 1) % a.length;
       var x = e.pageX,
       y = e.pageY;
       $i.css({
           "z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
           "top": y - 20,
           "left": x,
           "position": "absolute",
           "font-weight": "bold",
           "color": "#ff6651"
       });
       $("body").append($i);
       $i.animate({
           "top": y - 180,
           "opacity": 0
       },
       1500,
       function() {
           $i.remove();
       });
   });
});
</script>
<!--点击成语字符开始-->
  • 天气代码
<!--天气--开始-->
<div id="he-plugin-simple"></div>
<script>WIDGET = {CONFIG: {"modules": "12034","background": 5,"tmpColor": "aaa","tmpSize": 16,"cityColor": "aaa","citySize": 16,"aqiSize": 16,"weatherIconSize": 24,"alertIconSize": 18,"padding": "30px 10px 30px 10px","shadow": "1","language": "auto","borderRadius": 5,"fixed": "false","vertical": "middle","horizontal": "left","key": "a922adf8928b4ac1ae7a31ae7375e191"}}</script>
<script src="https://widget.heweather.net/simple/static/js/he-simple-common.js?v=1.1"></script>
<!--天气--结束-->
  • 文字抖动特效
<!--导航文字抖动--开始-->
<div class=""><span class="my-face"> 
<!--qq链接修改123修改为自己QQ号即可--> 
<a href="https://http://wpa.qq.com/msgrd?v=3&amp;uin=123&amp;site=qq&amp;menu=yes" target="_blank" rel="noopener"> QQ |</a> 
<!--尊重作者版权--> 
<a href="https://github.com/solstice23/argon-theme" target="_blank" rel="noopener"><strong> By Argon |</strong></a> 
<!--后台管理入口--> 
<a href="https://cddone.com/wp-admin" target="_blank" rel="noopener"><strong>Manage </strong></a> </span></div>
<!--导航文字抖动--结束-->
  • 运行时间及占用内存查询
<!--运行时间及占用内存--开始-->
<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("2023-08-04");//修改为自己系统的启动日期
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 = "本站已安全运行:"+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒<br>";
setTimeout(momxc, 1000);
}momxc();
</script>
<style>
#momk{animation:change 10s infinite;font-weight:800; }<br />
@keyframes change{0%{color:#5cb85c;}25%{color:#556bd8;}50%{color:#e40707;}75%{color:#66e616;}100% {color:#67bd31;}}<br />
</style>
<!--?php printf(' | 耗时 %.3f 秒 | 查询 %d 次 | 内存 %.2f MB |',timer_stop( 0, 3 ),get_num_queries(),memory_get_peak_usage() / 1024 / 1024);?-->
<!--运行时间及占用内存--结束--> 
  • 全页特效
<!--鼠标点击特效开始-->
<script type="text/javascript">
    // 设备检测
    var md = new MobileDetect(window.navigator.userAgent);
    // PC生效,手机/平板不生效
    // md.mobile(); md.phone(); 
    if(!md.phone()){
        if(!md.tablet()){
            // 雪花
            // $.getScript("https://bensz.onmicrosoft.cn/bloghelper/js/xiaxue.js");
            // 樱花
            // $.getScript("https://bensz.onmicrosoft.cn/bloghelper/js/yinghua.js");
            // 小烟花特效
            // $.getScript("https://bensz.onmicrosoft.cn/bloghelper/js/mouse-click.js");
            // 大烟花特效 z-index:217483647; pointer-events: none;
            // $.getScript("https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/mouse/mouse-click-02/mouse-canvas.js");
            // 鼠标移动的仙女棒特效
            // $.getScript("https://bensz.onmicrosoft.cn/bloghelper/mouse/halo-dream/fairyDustCursor.min.js");
            document.write('</p>
<p>
</p>
<style>#mouse-canvas {z-index:217483647; pointer-events: none;  box-sizing: border-box !important; display: block !important; position: fixed !important; left: 0; right: 0; top: 0; bottom: 0; width: 100%; height: 100vh;}</style>
<p>
</p>
<p>')
}
</script> 
<!--鼠标点击特效结束-->
wordpress美化-其他
© 版权声明

1 条评论

  • 匿名
    匿名 游客

    1

    回复