handsome美化教程
简介之前购买了handsome主题,本人还是挺喜欢的,收集了一些美化代码,整理一下,留给那些有需要的小伙伴点击特效两个点击特效均放置于usr/themes/handsome/component/footer.php文件的<?php $this->options->bottomHtml();?>之上富强、爱国等(随机字符)<!-- 爱国、富强等点击特效 --> <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>随机颜色小爱心点击特效<!-- 随机颜色小爱心点击特效 --> <script type="text/javascript"> !function (e, t, a) { function r() { for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999"); requestAnimationFrame(r) } function n() { var t = "function" == typeof e.onclick && e.onclick; e.onclick = function (e) { t && t(), o(e) } } function o(e) { var a = t.createElement("div"); a.className = "heart", s.push({ el: a, x: e.clientX - 5, y: e.clientY - 5, scale: 1, alpha: 1, color: c() }), t.body.appendChild(a) } function i(e) { var a = t.createElement("style"); a.type = "text/css"; try { a.appendChild(t.createTextNode(e)) } catch (t) { a.styleSheet.cssText = e } t.getElementsByTagName("head")[0].appendChild(a) } function c() { return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")" } var s = []; e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) { setTimeout(e, 1e3 / 60) }, i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"), n(), r() }(window, document); </script>文章声明代码放置于usr/themes/handsome/post.php文件的<?php if ($this->options->adContentPost != ""): ?>上面,觉得距离比较远可以自行删除<br><div class="entry-content l-h-2x"> <div class="tip inlineBlock info"> <?php _e(' 文章名:'); ?>《<?php $this->title()?>》 <br> <br> 文章链接:<a href="<?php $this->permalink() ?>"><?php $this->permalink() ?></a> <br> <br> 联系方式:rateldev@qq.com <br> <br> 除特别注明外,文章均为 <a rel="external nofollow" target="_blank" href="https://blog.ratelsx.com/">Ratel</a> 原创,转载时请注明本文出处及文章链接 </div> </div>文章版式圆角化以下代码都放置于后台→外观→开发者模式→自定义 css/* 圆角大小可修改 15px 数值 首页文章版式圆角化 */ .panel { border: none; border-radius: 15px; } .panel-small { border: none; border-radius: 15px; } .item-thumb { border-radius: 15px; }头像获取焦点放大/* 转动快慢和头像大小自行修改数值 首页头像自动旋转 */ .thumb-lg { width: 130px; } .avatar { -webkit-transition: 0.4s; -webkit-transition: -webkit-transform 0.4s ease-out; transition: transform 0.4s ease-out; -moz-transition: -moz-transform 0.4s ease-out; } .avatar:hover { transform: rotateZ(360deg); -webkit-transform: rotateZ(360deg); -moz-transform: rotateZ(360deg); } #aside-user span.avatar { animation-timing-function: cubic-bezier(0, 0, .07, 1) !important; border: 0 solid } #aside-user span.avatar:hover { transform: rotate(360deg) scale(1.2); border-width: 5px; animation: avatar .5s }头像自动旋转/* 旋转速度请修改 3s 数值 首页自动旋转 */ .thumb-lg { width: 130px; } @-webkit-keyframes rotation { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); } } .img-full { -webkit-transform: rotate(360deg); animation: rotation 3s linear infinite; -moz-animation: rotation 3s linear infinite; -webkit-animation: rotation 3s linear infinite; -o-animation: rotation 3s linear infinite; }文章版式阴影化/* 阴影颜色修改 rgba 后面的值 panel 阴影 */ .panel { box-shadow: 1px 1px 5px 5px rgba(255, 112, 173, 0.35); -moz-box-shadow: 1px 1px 5px 5px rgba(255, 112, 173, 0.35); } .panel:hover { box-shadow: 1px 1px 5px 5px rgba(255, 112, 173, 0.35); -moz-box-shadow: 1px 1px 5px 5px rgba(255, 112, 173, 0.35); } .panel-small { box-shadow: 1px 1px 5px 5px rgba(255, 112, 173, 0.35); -moz-box-shadow: 1px 1px 5px 5px rgba(255, 112, 173, 0.35); } .panel-small:hover { box-shadow: 1px 1px 5px 5px rgba(255, 112, 173, 0.35); -moz-box-shadow: 1px 1px 5px 5px rgba(255, 112, 173, 0.35); } /* 如果也想使盒子四周也有阴影,加上以下代码 */ .app.container { box-shadow: 0 0 30px rgba(255, 112, 173, 0.35); }文章标题居中.panel h2 { text-align: center; } .post-item-foot-icon { text-align: center; }自定义右侧滚动条/* 定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸 */ ::-webkit-scrollbar { width: 3px; height: 16px; background-color: rgba(255, 255, 255, 0); } /* 定义滚动条轨道 内阴影 + 圆角 */ ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); border-radius: 10px; background-color: rgba(255, 255, 255, 0); } /* 定义滑块 内阴影 + 圆角 */ ::-webkit-scrollbar-thumb { border-radius: 10px; -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3); background-color: #555; }图片抖动效果/* 图片抖动效果 */ img:hover { -webkit-animation: sucaijiayuan 1s .1s ease both; -moz-animation: tada 1s .1s ease both; } @-webkit-keyframes sucaijiayuan { 0% { -webkit-transform: scale(1) } 10%, 20% { -webkit-transform: scale(0.8) rotate(-2deg) } 30%, 50%, 70%, 90% { -webkit-transform: scale(1.1) rotate(2deg) } 40%, 60%, 80% { -webkit-transform: scale(1.1) rotate(-2deg) } 100% { -webkit-transform: scale(1) rotate(0) } }输入框气泡特效首先下载 commentTyping.js 文件,放到主题,位置任意,然后找到 footer.php 文件,</body> 之前添加 <script type=”text/javascript” src=" 这里放你的路径 "></script>下载地址