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 != ""): ?>上面,觉得距离比较远可以自行删除

<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="http://www.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>

下载地址

[button color=”info” icon=”” url=”https://lanzoui.com/i20g6sh” type=”round”]点击下载[/button]

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

给TA打赏
共{{data.count}}人
人已打赏
闲聊杂谈

折腾之旅开始

2019-6-23 15:17:00

主题美化

handsome个性化修改

2019-6-21 15:25:00

2 条回复 A文章作者 M管理员
  1. 核心价值观,我还专门发了一篇文章!哈哈!

    • 哈哈

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索