这是一款侧边动态时间小工具,逛博客的时候看到好看就扒来了,这个是纯时间动态,带有一些特效,非常好看,喜欢的自行部署吧
将下面的代码放到:WP后台->>外观–>>小工具–>>自定义HTML即可
<style> .times { margin: 0; padding: 0; height: 100%; } .times2 { height: 100%; background: #fff; } .times2 svg { height: 100%; width: 100%; margin-bottom: -34px; } .words { font-size: 60px; font-weight: bold; text-transform: uppercase; fill: none; stroke-width: 5px; stroke-dasharray: 90, 310; animation: drawing 8s linear infinite; } .words-1 { stroke: deepskyblue; text-shadow: 0 0 50px deepskyblue; animation-delay: -2s; } .words-2 { stroke: lightseagreen; text-shadow: 0 0 50px lightseagreen; animation-delay: -4s; } .words-3 { stroke: orange; text-shadow: 0 0 50px orange; animation-delay: -6s; } .words-4 { stroke: purple; text-shadow: 0 0 50px purple; animation-delay: -8s; } @keyframes drawing { 100% { stroke-dashoffset: -400; } } </style> <div class="sidebox sidebox--desk"> <div class="times"> <div class="sidebox__content" style="padding: 0;"> <div style="border-radius:15px;" class="times2"> <svg> <text text-anchor="middle" x="50%" y="50%" class="words words-1"></text> <text text-anchor="middle" x="50%" y="50%" class="words words-2"></text> <text text-anchor="middle" x="50%" y="50%" class="words words-3"></text> <text text-anchor="middle" x="50%" y="50%" class="words words-4"></text> </svg> </div> </div> </div> </div> <script> function showtime() { const now = new Date(); let h = now.getHours(); let m = now.getMinutes(); let s = now.getSeconds(); h = checktime(h); m = checktime(m); s = checktime(s); return `${h}:${m}:${s}`; } function checktime(x) { return x < 10 ? `0${x}` : x; } const texts = document.querySelectorAll("text"); setInterval(() => { const time = showtime(); texts.forEach(text => { text.textContent = time; }); }, 1000); </script>
本站提供的一切软件、教程和内容信息仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络收集整理,如果您喜欢该程序和内容,请支持正版,购买注册,得到更好的正版服务。我们非常重视版权问题,如有侵权请邮件与我们联系处理。敬请谅解!
如若转载,请注明出处:https://www.zxperson.com/149.html
B 站「硬核会员」DeepSeek 自动答题神器,Bili-Hardcore
04-15
全新轻量级PHP简约活码管理系统
04-07
OhMyWeChat - 微信聊天记录备份导出工具 | 数据分析可视化报告
03-28
微信域名防红,打开自动跳转浏览器
03-25
微信单向好友检测WechatRealFriends V1.0.1
03-21
利用JS代码实现HTML网页飘落樱花特效(附代码)
03-19
PHP实现在线聊天系统源码
03-14
新版UI视频裂变加群推广分享引流源码
03-04
Adobe系列软件通用解锁补丁AdobeGenp
03-03
局域网IP扫描V1.25,跨网段扫描_端口扫描_系统端口查看_修改本地IP_WIFI密码查看
02-27
09日04日,星期三,在这里每天60秒读懂世界!
09-04
08日28日,星期三,在这里每天60秒读懂世界!
08-28
07日19日,星期五,在这里每天60秒读懂世界!
07-19
07日18日,星期四,在这里每天60秒读懂世界!
07-19
07日17日,星期三,在这里每天60秒读懂世界!
07-17
07日16日,星期二,在这里每天60秒读懂世界!
07-16
07日15日,星期一,在这里每天60秒读懂世界!
07-15
07日14日,星期日,在这里每天60秒读懂世界!
07-15
07日13日,星期六,在这里每天60秒读懂世界!
07-13
07日12日,星期五,在这里每天60秒读懂世界!
07-12