Loading... ## 前言 刚换了handsome主题觉得不错,但是自己修改了一下。因为刚买所以不知道更新会不会覆盖掉 所以来记录一下 ## 正文 ## 主题后台可修改 ### 自定义CSS <div class="panel panel-default collapse-panel box-shadow-wrap-lg"><div class="panel-heading panel-collapse" data-toggle="collapse" data-target="#collapse-d71160ca3df0938aa4989dd8e071a45386" aria-expanded="true"><div class="accordion-toggle"><span style="">自定义CSS</span> <i class="pull-right fontello icon-fw fontello-angle-right"></i> </div> </div> <div class="panel-body collapse-panel-body"> <div id="collapse-d71160ca3df0938aa4989dd8e071a45386" class="collapse collapse-content"><p></p> ```css /*首页文章图片获取焦点放大*/ .item-thumb{ cursor: pointer; transition: all 0.6s; } .item-thumb:hover{ transform: scale(1.05); } .item-thumb-small{ cursor: pointer; transition: all 0.6s; } .item-thumb-small:hover{ transform: scale(1.05); } /*首页文章版式圆角化*/ .panel{ border: none; border-radius: 5px; } .panel-small{ border: none; border-radius: 5px; } .item-thumb{ border-radius: 5px; } /*头像呼吸光环和鼠标悬停旋转放大*/ .img-full { width: 100px; border-radius: 50%; animation: light 4s ease-in-out infinite; transition: 0.5s; } .img-full:hover { transform: scale(1.15) rotate(1080deg); } @keyframes light { 0% { box-shadow: 0 0 30px #FFEB92; } 25% { box-shadow: 0 0 10px #FFEB92; } 50% { box-shadow: 0 0 30px #FFEB92; } 75% { box-shadow: 0 0 10px #FFEB92; } 100% { box-shadow: 0 0 30px #FFEB92; } } /*评论头像旋转*/ .img-circle { transition: all 0.3s; } .img-circle:hover { transform: rotate(360deg); } /*panel阴影*/ .panel{ box-shadow: 1px 1px 5px 5px rgba(173, 173, 173, 0.35); -moz-box-shadow: 1px 1px 5px 5px rgba(173, 173, 173, 0.35); } .panel:hover{ box-shadow: 1px 1px 5px 5px rgba(173, 173, 173, 0.35); -moz-box-shadow: 1px 1px 5px 5px rgba(173, 173, 173, 0.35); } .panel-small{ box-shadow: 1px 1px 5px 5px rgba(173, 173, 173, 0.35); -moz-box-shadow: 1px 1px 5px 5px rgba(173, 173, 173, 0.35); } .panel-small:hover{ box-shadow: 1px 1px 5px 5px rgba(173, 173, 173, 0.35); -moz-box-shadow: 1px 1px 5px 5px rgba(173, 173, 173, 0.35); } .app.container { box-shadow: 0 0 30px rgba(173, 173, 173, 0.35); } /*打卡*/ .secret_comment { top: 5px; } .OwO.OwO-open .OwO-body { display:table } /*表情*/ .comment-content-true img { max-width:30%!important } /*3D标签云*/ /*彩色部分*/ #tag_cloud-2>div>a { color: #fff; text-align: center; text-overflow: ellipsis; white-space: nowrap; padding: 3px 5px; border: 0; border-radius: 3px; display: inline-block; line-height: 18px; } #tag_cloud-2>div>a:hover { background: #d02f53; } /*3D部分*/ #tag_cloud-2>div { position: relative; width: 240px; height: 240px; border: 2px black; margin: 0 10px 15px 0 } #tag_cloud-2>div>a { position: absolute; } #tag_cloud-2>div>a:hover { display: block } ``` <p></p></div></div></div> ### 自定义JavaScript <div class="panel panel-default collapse-panel box-shadow-wrap-lg"><div class="panel-heading panel-collapse" data-toggle="collapse" data-target="#collapse-7c8d38240610b036272fe41c0b7d839519" aria-expanded="true"><div class="accordion-toggle"><span style="">自定义JavaScript</span> <i class="pull-right fontello icon-fw fontello-angle-right"></i> </div> </div> <div class="panel-body collapse-panel-body"> <div id="collapse-7c8d38240610b036272fe41c0b7d839519" class="collapse collapse-content"><p></p> ```js //网页标签获得/失去焦点时更改标题内容 var OriginTitile = document.title; var titleTime; document.addEventListener("visibilitychange", function() { if (document.hidden) { OriginTitile = document.title; document.title = "怎么走了(;д`)ゞ"; clearTimeout(titleTime) } else { document.title = "回来了ヾ(◍°∇°◍)ノ゙)"; titleTime = setTimeout(function() { document.title = OriginTitile }, 2000) } }); //打卡 function a(a, b, c) { if (document.selection) a.focus(), sel = document.selection.createRange(), c ? sel.text = b + sel.text + c: sel.text = b, a.focus(); else if (a.selectionStart || "0" == a.selectionStart) { var l = a.selectionStart, m = a.selectionEnd, n = m; c ? a.value = a.value.substring(0, l) + b + a.value.substring(l, m) + c + a.value.substring(m, a.value.length) : a.value = a.value.substring(0, l) + b + a.value.substring(m, a.value.length); c ? n += b.length + c.length: n += b.length - m + l; l == m && c && (n -= c.length); a.focus(); a.selectionStart = n; a.selectionEnd = n } else a.value += b + c, a.focus() } var b = (new Date).toLocaleTimeString(), c = document.getElementById("comment") || 0; window.SIMPALED = {}; window.SIMPALED.Editor = { daka: function() { a(c, "滴!访客卡!打卡时间:" + b, ",请上车的乘客系好安全带~") }, zan: function() { a(c, " 写得好好哟,支持支持! ::tieba:Y.tb89:: ") }, cai: function() { a(c, "骚年,我怀疑你写了一篇假的文章! ::tieba:Y.tb94:: ") } }; //复制代码 document.body.oncopy = function(){Swal.fire({allowOutsideClick:false,type:'success',title: "复制成功",text: '如转载请注明出处!',showConfirmButton: false,timer: 2000});}; //3D标签云 //彩色效果 function colorfultags(){ let tags = document.querySelectorAll("#tag_cloud-2 a"); let colorArr = ["#f60", "#45B6F7", "#15a287", "#5cb85c", "#d9534f", "#567e95", "#00a67c", "#b37333"]; let count = 1; tags.forEach(tag => { tagsColor = colorArr[count%8]; tag.style.backgroundColor = tagsColor; count++; }); } window.onload=colorfultags(); //3D效果 function around3D() { var oDiv = document.getElementById('tag_cloud-2').getElementsByTagName('div')[0]; if (null == oDiv) { return } else { var radius = 80; var d = 200; var dtr = Math.PI / 180; var mcList = []; var lasta = 1; var lastb = 1; var distr = true; var tspeed = 11; var size = 200; var mouseX = 0; var mouseY = 10; var howElliptical = 1; var aA = null; var i = 0; var oTag = null; aA = oDiv.getElementsByTagName('a'); for (i = 0; i < aA.length; i++) { oTag = {}; aA[i].onmouseover = (function(obj) { return function() { obj.on = true; this.style.zIndex = 9999; this.style.color = '#fff'; this.style.background = '#0099ff'; this.style.padding = '5px 5px'; this.style.filter = "alpha(opacity=100)"; this.style.opacity = 1; } })(oTag) aA[i].onmouseout = (function(obj) { return function() { obj.on = false; this.style.zIndex = obj.zIndex; this.style.color = '#fff'; this.style.background = '#30899B'; this.style.padding = '5px'; this.style.filter = "alpha(opacity=" + 100 * obj.alpha + ")"; this.style.opacity = obj.alpha; this.style.zIndex = obj.zIndex; } })(oTag) oTag.offsetWidth = aA[i].offsetWidth; oTag.offsetHeight = aA[i].offsetHeight; mcList.push(oTag); } sineCosine(0, 0, 0); positionAll(); (function() { update(); setTimeout(arguments.callee, 40); })(); function update() { var a, b, c = 0; a = (Math.min(Math.max(-mouseY, -size), size) / radius) * tspeed; b = (-Math.min(Math.max(-mouseX, -size), size) / radius) * tspeed; lasta = a; lastb = b; if (Math.abs(a) <= 0.01 && Math.abs(b) <= 0.01) { return; } sineCosine(a, b, c); for (var i = 0; i < mcList.length; i++) { if (mcList[i].on) { continue; } var rx1 = mcList[i].cx; var ry1 = mcList[i].cy * ca + mcList[i].cz * (-sa); var rz1 = mcList[i].cy * sa + mcList[i].cz * ca; var rx2 = rx1 * cb + rz1 * sb; var ry2 = ry1; var rz2 = rx1 * (-sb) + rz1 * cb; var rx3 = rx2 * cc + ry2 * (-sc); var ry3 = rx2 * sc + ry2 * cc; var rz3 = rz2; mcList[i].cx = rx3; mcList[i].cy = ry3; mcList[i].cz = rz3; per = d / (d + rz3); mcList[i].x = (howElliptical * rx3 * per) - (howElliptical * 2); mcList[i].y = ry3 * per; mcList[i].scale = per; var alpha = per; alpha = (alpha - 0.6) * (10 / 6); mcList[i].alpha = alpha * alpha * alpha - 0.2; mcList[i].zIndex = Math.ceil(100 - Math.floor(mcList[i].cz)); } doPosition(); } function depthSort() { var i = 0; var aTmp = []; for (i = 0; i < aA.length; i++) { aTmp.push(aA[i]); } aTmp.sort( function(vItem1, vItem2) { if (vItem1.cz > vItem2.cz) { return -1; } else if (vItem1.cz < vItem2.cz) { return 1; } else { return 0; } } ); for (i = 0; i < aTmp.length; i++) { aTmp[i].style.zIndex = i; } } function positionAll() { var phi = 0; var theta = 0; var max = mcList.length; for (var i = 0; i < max; i++) { if (distr) { phi = Math.acos(-1 + (2 * (i + 1) - 1) / max); theta = Math.sqrt(max * Math.PI) * phi; } else { phi = Math.random() * (Math.PI); theta = Math.random() * (2 * Math.PI); } mcList[i].cx = radius * Math.cos(theta) * Math.sin(phi); mcList[i].cy = radius * Math.sin(theta) * Math.sin(phi); mcList[i].cz = radius * Math.cos(phi); aA[i].style.left = mcList[i].cx + oDiv.offsetWidth / 2 - mcList[i].offsetWidth / 2 + 'px'; aA[i].style.top = mcList[i].cy + oDiv.offsetHeight / 2 - mcList[i].offsetHeight / 2 + 'px'; } } function doPosition() { var l = oDiv.offsetWidth / 2; var t = oDiv.offsetHeight / 2; for (var i = 0; i < mcList.length; i++) { if (mcList[i].on) { continue; } var aAs = aA[i].style; if (mcList[i].alpha > 0.1) { if (aAs.display != '') aAs.display = ''; } else { if (aAs.display != 'none') aAs.display = 'none'; continue; } aAs.left = mcList[i].cx + l - mcList[i].offsetWidth / 2 + 'px'; aAs.top = mcList[i].cy + t - mcList[i].offsetHeight / 2 + 'px'; aAs.filter = "alpha(opacity=" + 100 * mcList[i].alpha + ")"; aAs.zIndex = mcList[i].zIndex; aAs.opacity = mcList[i].alpha; } } function sineCosine(a, b, c) { sa = Math.sin(a * dtr); ca = Math.cos(a * dtr); sb = Math.sin(b * dtr); cb = Math.cos(b * dtr); sc = Math.sin(c * dtr); cc = Math.cos(c * dtr); } } } window.onload = around3D(); ``` <p></p></div></div></div> ### pjax回调函数 <div class="panel panel-default collapse-panel box-shadow-wrap-lg"><div class="panel-heading panel-collapse" data-toggle="collapse" data-target="#collapse-4cec1e5e087f1323f80d35fa5d42ed2b65" aria-expanded="true"><div class="accordion-toggle"><span style="">pjax回调函数</span> <i class="pull-right fontello icon-fw fontello-angle-right"></i> </div> </div> <div class="panel-body collapse-panel-body"> <div id="collapse-4cec1e5e087f1323f80d35fa5d42ed2b65" class="collapse collapse-content"><p></p> ```js //Access控制台 window.Access.track() //看板娘 pio.init(true) //打卡 function a(a, b, c) { if (document.selection) a.focus(), sel = document.selection.createRange(), c ? sel.text = b + sel.text + c : sel.text = b, a.focus(); else if (a.selectionStart || "0" == a.selectionStart) { var l = a.selectionStart, m = a.selectionEnd, n = m; c ? a.value = a.value.substring(0, l) + b + a.value.substring(l, m) + c + a.value.substring(m, a.value.length) : a.value = a.value.substring(0, l) + b + a.value.substring(m, a.value.length); c ? n += b.length + c.length : n += b.length - m + l; l == m && c && (n -= c.length); a.focus(); a.selectionStart = n; a.selectionEnd = n } else a.value += b + c, a.focus() } var b = (new Date).toLocaleTimeString(), c = document.getElementById("comment") || 0; window.SIMPALED = {}; window.SIMPALED.Editor = { daka: function() { a(c, "滴!访客卡!打卡时间:" + b, ",请上车的乘客系好安全带~") }, zan: function() { a(c, " 写得好好哟,支持支持! ::tieba:Y.tb89:: ") }, cai: function() { a(c, "骚年,我怀疑你写了一篇假的文章! ::tieba:Y.tb94:: ") } }; if (typeof Prism !== 'undefined') { var pres = document.getElementsByTagName('pre'); for (var i = 0; i < pres.length; i++){ if (pres[i].getElementsByTagName('code').length > 0) pres[i].className = 'line-numbers';} Prism.highlightAll(true,null);} //3D标签云 colorfultags(); around3D(); ``` <p></p></div></div></div> ### 自定义head 暂无 ### 自定义body <div class="panel panel-default collapse-panel box-shadow-wrap-lg"><div class="panel-heading panel-collapse" data-toggle="collapse" data-target="#collapse-63be06e8d9b6724705af9552e2ed0f9675" aria-expanded="true"><div class="accordion-toggle"><span style="">自定义body</span> <i class="pull-right fontello icon-fw fontello-angle-right"></i> </div> </div> <div class="panel-body collapse-panel-body"> <div id="collapse-63be06e8d9b6724705af9552e2ed0f9675" class="collapse collapse-content"><p></p> ```html <!--漂亮的弹窗资源引入--> <script src="https://cdn.bootcss.com/limonte-sweetalert2/8.11.8/sweetalert2.all.js"></script> <script src="https://cdn.bootcss.com/limonte-sweetalert2/8.11.8/sweetalert2.all.min.js"></script> <link href="https://cdn.bootcss.com/limonte-sweetalert2/8.11.8/sweetalert2.css" rel="stylesheet"> ``` ![效果][1] <p></p></div></div></div> ## 改代码 ### 博客信息 <div class="panel panel-default collapse-panel box-shadow-wrap-lg"><div class="panel-heading panel-collapse" data-toggle="collapse" data-target="#collapse-81340ab8f049d9ec358e7316c63af97a55" aria-expanded="true"><div class="accordion-toggle"><span style="">博客信息</span> <i class="pull-right fontello icon-fw fontello-angle-right"></i> </div> </div> <div class="panel-body collapse-panel-body"> <div id="collapse-81340ab8f049d9ec358e7316c63af97a55" class="collapse collapse-content"><p></p> 在`handsome/libs/Content.php`添加 ```php //显示加载时间 function timer_start() { global $timestart; $mtime = explode( ' ', microtime() ); $timestart = $mtime[1] + $mtime[0]; return true; } timer_start(); function timer_stop( $display = 0, $precision = 3 ) { global $timestart, $timeend; $mtime = explode( ' ', microtime() ); $timeend = $mtime[1] + $mtime[0]; $timetotal = number_format( $timeend - $timestart, $precision ); $r = $timetotal < 1 ? $timetotal * 1000 . "ms" : $timetotal . " s"; if ( $display ) { echo $r; } return $r; } ``` 然后修改`handsome/component/sidebar.php` ```php <li class="list-group-item text-second"><span class="blog-info-icons"> <i data-feather="clock"></i></span> <span class="badge pull-right"><?php echo timer_stop();?></span><?php _me("加载时间") ?></li> ``` ![效果][2] <p></p></div></div></div> ### 心知天气 <div class="panel panel-default collapse-panel box-shadow-wrap-lg"><div class="panel-heading panel-collapse" data-toggle="collapse" data-target="#collapse-4ca436a321dc509bf4819e3cfa6c9c5a2" aria-expanded="true"><div class="accordion-toggle"><span style="">心知天气</span> <i class="pull-right fontello icon-fw fontello-angle-right"></i> </div> </div> <div class="panel-body collapse-panel-body"> <div id="collapse-4ca436a321dc509bf4819e3cfa6c9c5a2" class="collapse collapse-content"><p></p> 插入到/component/headnav.php中第55行<!-- / search form -->之后 ```php <!-- 知心天气--> <div id="tp-weather-widget" class="navbar-form navbar-form-sm navbar-left shift"></div> <script>(function(T,h,i,n,k,P,a,g,e){g=function(){P=h.createElement(i);a=h.getElementsByTagName(i)[0];P.src=k;P.charset="utf-8";P.async=1;a.parentNode.insertBefore(P,a)};T["ThinkPageWeatherWidgetObject"]=n;T[n]||(T[n]=function(){(T[n].q=T[n].q||[]).push(arguments)});T[n].l=+new Date();if(T.attachEvent){T.attachEvent("onload",g)}else{T.addEventListener("load",g,false)}}(window,document,"script","tpwidget","//widget.seniverse.com/widget/chameleon.js"))</script> <script>tpwidget("init", { "flavor": "slim", "location": "WX4FBXXFKE4F", "geolocation": "enabled", "language": "auto", "unit": "c", "theme": "chameleon", "container": "tp-weather-widget", "bubble": "enabled", "alarmType": "badge", "color": "#C6C6C6", "uid": "公钥", "hash": "密钥" }); tpwidget("show");</script> <!-- 知心结束--> ``` ![效果][3] <p></p></div></div></div> ### 删除掉左侧栏的组成二字和分割线 <div class="panel panel-default collapse-panel box-shadow-wrap-lg"><div class="panel-heading panel-collapse" data-toggle="collapse" data-target="#collapse-f5c556e6fdb074123a7aec911674bcb75" aria-expanded="true"><div class="accordion-toggle"><span style="">删除掉左侧栏的组成二字和分割线</span> <i class="pull-right fontello icon-fw fontello-angle-right"></i> </div> </div> <div class="panel-body collapse-panel-body"> <div id="collapse-f5c556e6fdb074123a7aec911674bcb75" class="collapse collapse-content"><p></p> 修改/component/aside.php ![F12看代码][4] 看到class是line dk我们删除掉它 ````php <li class="line dk"></li> <!--Components--> <li class="hidden-folded padder m-t m-b-sm text-muted text-xs"> <span><?php _me("组成") ?></span> </li> ``` 删掉这么多 ![效果][5] <p></p></div></div></div> ### 鼠标特效 加入</body>之前 ```html <script src="//cdn.jsdelivr.net/gh/kaygb/JS-effects/fireworks.js"></script> ``` ## 注意 这么多全加上会很卡可以删除文章头图放大的css会好一点 [1]: https://assets.zigao.info/www.zigao.info/article/2020/02/3026200922.webp [2]: https://assets.zigao.info/www.zigao.info/article/2020/02/98885327.webp [3]: https://assets.zigao.info/www.zigao.info/article/2020/02/2489759288.webp [4]: https://assets.zigao.info/www.zigao.info/article/2020/02/545234292.webp [5]: https://assets.zigao.info/www.zigao.info/article/2020/02/1030645080.webp Last modification:July 8, 2022 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 大哥给点钱吧~ヽ(・ω・´メ)(微信 支付宝 QQ都是一个码哦~
10 comments
::quyin:amazing::
想问一下点击效果是用的是插件吗?是什么插件啊?
不是的哦,我马上增加到文字中(鼠标样式是插件在https://zigao.tk/on.html可以看到)
你这个鼠标点击爆炸就很卡 兄弟 ::emoji:Y.emoji10::
卡吗,我不是很觉得诶~
博主,那个博客信息那个我弄了底部乱码
请教邮件提醒使用什么插件
CommentToMail也挺好:https://cloud.baoshuo.ren/show/Blog/typecho/%E6%8F%92%E4%BB%B6/CommentToMail.tar.gz
使用的是LoveKKComment哦传送门https://github.com/ylqjgm/LoveKKComment
非常感谢