Suxiaoyu

handsome主题美化/修改-博客魔改教程
主题美化教程-持续更新~
扫描右侧二维码阅读全文
28
2020/03

handsome主题美化/修改-博客魔改教程

主题美化教程-持续更新~

首页文章版式阴影化

/#阴影颜色修改rgba后面的值/
/*panel阴影*/
.panel{
   box-shadow: 1px 1px 3px 3px rgba(255,255,255, 0.35);
       -moz-box-shadow: 1px 1px 3px 3px rgba(255,255,255, 0.35);
}
       .panel:hover{
           box-shadow: 1px 1px 3px 3px rgba(135 206 250, 0.35);
               -moz-box-shadow: 1px 1px 3px 3px rgba(135 206 250, 0.35);
}
               .panel-small{
                   box-shadow: 1px 1px 3px 3px rgba(255,255,255, 0.35);
                       -moz-box-shadow: 1px 1px p3x 3px rgba(255,255,255, 0.35);
}
                       .panel-small:hover{
                           box-shadow: 1px 1px p3x 3px rgba(135 206 250, 0.35);
                               -moz-box-shadow: 1px 1px 3px 3px rgba(135 206 250, 0.35);
}

.app.container {
box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}
span.baidu-record::before {
    font: normal normal normal 12px/1 FontAwesome;
    content: "\f024";
    margin-right: 3px;
}

首页头像转动并放大

本项修改的是首页头像,将鼠标放至头像后使其转动并放大。将以下代码添加至后台主题设置 自定义CSS。

#转动快慢和头像大小自行修改数值
/*首页头像自动旋转*/
.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
}

鼠标点击爱心特效

样式二,将下面的代码放入后台开发者设置的自定义JS中

(function(window,document,undefined){
    var hearts = [];
    window.requestAnimationFrame = (function(){
            return window.requestAnimationFrame ||
                       window.webkitRequestAnimationFrame ||
                       window.mozRequestAnimationFrame ||
                       window.oRequestAnimationFrame ||
                       window.msRequestAnimationFrame ||
                       function (callback){
                               setTimeout(callback,1000/60);
                       }
    })();
    init();
    function init(){
            css(".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: absolute;}.heart:after{top: -5px;}.heart:before{left: -5px;}");
            attachEvent();
            gameloop();
    }
    function gameloop(){
            for(var i=0;i<hearts.length;i++){
                if(hearts[i].alpha <=0){
                        document.body.removeChild(hearts[i].el);
                        hearts.splice(i,1);
                        continue;
                }
                hearts[i].y--;
                hearts[i].scale += 0.004;
                hearts[i].alpha -= 0.013;
                hearts[i].el.style.cssText = "left:"+hearts[i].x+"px;top:"+hearts[i].y+"px;opacity:"+hearts[i].alpha+";transform:scale("+hearts[i].scale+","+hearts[i].scale+") rotate(45deg);background:"+hearts[i].color;
        }
        requestAnimationFrame(gameloop);
    }
    function attachEvent(){
            var old = typeof window.onclick==="function" && window.onclick;
            window.onclick = function(event){
                    old && old();
                    createHeart(event);
            }
    }
    function createHeart(event){
        var d = document.createElement("div");
        d.className = "heart";
        hearts.push({
                el : d,
                x : event.clientX - 5,
                y : event.clientY - 5,
                scale : 1,
                alpha : 1,
                color : randomColor()
        });
        document.body.appendChild(d);
}
function css(css){
        var style = document.createElement("style");
            style.type="text/css";
            try{
                style.appendChild(document.createTextNode(css));
            }catch(ex){
                style.styleSheet.cssText = css;
            }
            document.getElementsByTagName('head')[0].appendChild(style);
}
    function randomColor(){
            return "rgb("+(~~(Math.random()*255))+","+(~~(Math.random()*255))+","+(~~(Math.random()*255))+")";
    }})(window,document);

自定义滚动条滑块

本项修改针对浏览器最右边的滚动条滑块,使其改变样式。将以下代码添加至后台主题设置自定义CSS。

    /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
    ::-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;
}

自定义鼠标样式

在这里以handsome主题为例:外观——主题设置——开发设置——自定义css。
插入以下代码:

body {
    cursor:url('鼠标指针图片链接'), auto;
}
select, input, textarea, a, button {
    cursor:url('鼠标指针图片链接'), auto;
}
input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly] {
    cursor:url('鼠标指针图片链接'), auto;
}
Last modification:March 28th, 2020 at 11:26 pm

Leave a Comment

5 comments

  1. 浮沉

    滴!学生卡!打卡时间:下午3:08:31,请上车的乘客系好安全带~

  2. Suxiaoyu

    写得好好哟,我要给你生猴子!

  3. Suxiaoyu

    滴!学生卡!打卡时间:下午2:53:46,请上车的乘客系好安全带~

  4. Suxiaoyu

    骚年,我怀疑你写了一篇假的文章!

  5. 蒋蒋