• 博客园样式简约



    进入博客后台→设置

    一、页面定制 CSS 代码

    禁用模板默认CSS,不用勾选

    /*simplememory*/
    #google_ad_c1, #google_ad_c2 {display:none;}
    .syntaxhighlighter a, .syntaxhighlighter div, .syntaxhighlighter code, .syntaxhighlighter table, .syntaxhighlighter table td, 
    .syntaxhighlighter table tr, .syntaxhighlighter table tbody, .syntaxhighlighter table thead, .syntaxhighlighter table caption, 
    .syntaxhighlighter textarea {
    font-size: 14px!important;
    }
    #home {
    opacity: 0.80;
    margin: 0 auto;
    width: 85%;
    min-width: 950px;
    background-color: #fff;
    padding: 30px;
    margin-top: 30px;
    margin-bottom: 50px;
    box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
    }
    #blogTitle h1 {
    font-size: 30px;
    font-weight: bold;
    font-family: "Comic Sans MS";
    line-height: 1.5em;
    margin-top: 20px;
    color: #515151;
    }
    #navList a:hover {
    color: #4C9ED9;
    text-decoration: none;
    }
    #navList a {
    display: block;
    width: 5em;
    height: 22px;
    float: left;
    text-align: center;
    padding-top: 18px;
    }
    #navigator {
    font-size: 15px;
    border-bottom: 1px solid #ededed;
    border-top: 1px solid #ededed;
    height: 50px;
    clear: both;
    margin-top: 25px;
    }
    .catListTitle {
    margin-top: 21px;
    margin-bottom: 10.5px;
    text-align: left;
    border-left: 10px solid rgba(82, 168, 236, 0.8);
    padding: 10px 0 14px 10px;
    background-color: #f5f5f5;
    }
    #ad_under_post_holder #google_ad_c1,#google_ad_c2{  
    display: none !important;
    }
    body {
    color: #000;
    background: url(https://images.cnblogs.com/cnblogs_com/Golanguage/1644030/o_200208170056205524-1566651324f88b.jpg
    ) fixed;
    background-size: 100%;
    background-repeat: no-repeat;
    font-family: "Helvetica Neue",Helvetica,Verdana,Arial,sans-serif;
    font-size: 12px;
    min-height: 101%;
    }
    #topics .postTitle {
    border: 0px;
    font-size: 200%;
    font-weight: bold;
    float: left;
    line-height: 1.5;
    width: 100%;
    padding-left: 5px;
    }
    
    div.commentform p{
    margin-bottom:10px;
    }
    .comment_btn {
    padding: 5px 10px;
    height: 35px;
    width: 90px;
    border: 0 none;
    border-radius: 5px;
    background: #ddd;
    color: #999;
    cursor:pointer;
    font-family: "Lato", Helvetica Neue, Helvetica, Microsoft Yahei, 宋体, Arial, sans-serif;
    text-shadow: 0 0 1px #fff;
    display: inline !important;
    }
    .comment_btn:hover{
    padding: 5px 10px;
    height: 35px;
    width: 90px;
    border: 0 none;
    border-radius: 5px;
    background: #258fb8;
    color: white;
    cursor:pointer;
    font-family: "Lato", Helvetica Neue, Helvetica, Microsoft Yahei, 宋体, Arial, sans-serif;
    text-shadow: 0 0 1px #fff;
    display: inline !important;
    }
    #commentform_title {
    background-image:none;
    background-repeat:no-repeat;
    margin-bottom:10px;
    padding:0;
    font-size:24px;
    }
    #commentbox_opt,#commentbox_opt + p {
    text-align:center;
    }
    .commentbox_title {
    width: 100%;
    }
    #tbCommentBody {
    font-family:'Microsoft Yahei', Microsoft Yahei, 宋体, sans-serif;
    margin-top:10px;
    max-width:100%;
    min-width:100%;
    background:white;
    color:#333;
    border:2px solid #fff;
    box-shadow:inset 0 0 8px #aaa;
    // padding:10px;
    height:250px;
    font-size:14px;
    min-height:120px;
    }
    .feedbackItem {
    font-size:14px;
    line-height:24px;
    margin:10px 0;
    padding:20px;
    background:#F2F2F2;
    box-shadow:0 0 5px #aaa;
    }
    .feedbackListSubtitle {
    font-weight:normal;
    }
    
    #blog-comments-placeholder, #comment_form {
    padding: 20px;
    background: #fff;
    -webkit-box-shadow: 1px 2px 3px #ddd;
    box-shadow: 1px 2px 3px #ddd;
    margin-bottom: 50px;
    }
    .feedback_area_title {
    margin-bottom: 15px;
    font-size: 1.8em;
    }
    .feedbackItem {
    border-bottom: 1px solid #CCC;
    margin-bottom: 10px;
    padding: 5px;
    background: rgb(248, 248, 248);
    }
    .color_shine {background: rgb(226, 242, 255);}
    .feedbackItem:hover {-webkit-animation-name: color_shine;-webkit-animation-duration: 2s;-webkit-animation-iteration-count: infinite;}
    #comment_form .title {
    font-weight: normal;
    margin-bottom: 15px;
    }
    
    
    /*快速赞*/
    #div_digg {
      position: fixed;
      bottom: 10px;
      right: 15px;
      border: 2px solid #ECD7B1;
      padding: 10px;
      width: 140px;
      background-color: #fff;
      border-radius: 5px 5px 5px 5px !important;
      box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5);
    }
    
    /* 定制公告栏时钟位置 */
    #clockdiv {
        /* left, center, right */
        text-align: center;
    }
    
    /* adblock屏蔽广告 */
    #ad_t2 {
        display: none;
    }
    .c_ad_block {
        display: none;
    }

    二、博客侧边栏公告(支持HTML代码)

    如果不支持JS代码,点击申请

    <!-- 爱心特效 -->
    <script type="text/javascript">
    (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{ 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: ''; 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);
    </script>
    
    <!-- 添加公告栏时钟 -->
    <div id="clockdiv">
        <canvas id="dom" width="120" height="120">时钟canvas</canvas>
    </div>
    <script type="text/javascript" src="https://files.cnblogs.com/files/shwee/clock.js"></script>

    三、页首 HTML 代码

    <!-- 右上角 控件,可跳转其他网页 -->
    <a href="https://www.cnblogs.com/" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#FD6C6C; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
    
    <!-- 背景特效,立体线条 -->
    <canvasid="c_n9"width="1920"height="990"style="position: fixed; top: 0px; left: 0px; z-index: -1; opacity: 0.5;"></canvas>
    <script src="https://files.cnblogs.com/files/siwuxie095/canvas-nest.min.js"></script>

    四、页脚 HTML 代码

    <!-- 雪花特效 -->
    <script type="text/javascript">
    (function($){
    $.fn.snow = function(options){
    var $flake = $('<div id="snowbox" />').css({'position': 'absolute','z-index':'9999', 'top': '-50px'}).html('&#10052;'),
    documentHeight = $(document).height(),
    documentWidth = $(document).width(),
    defaults = {
    minSize : 5,
    maxSize : 25,
    newOn : 500,
    flakeColor : getRandomColor() /* 此处可以定义雪花颜色,若要白色可以改为#FFFFFF */
    },
    options = $.extend({}, defaults, options);
    var interval= setInterval( function(){
    var startPositionLeft = Math.random() * documentWidth - 100,
    startOpacity = 0.5 + Math.random(),
    sizeFlake = options.minSize + Math.random() * options.maxSize,
    endPositionTop = documentHeight - 200,
    endPositionLeft = startPositionLeft - 500 + Math.random() * 500,
    durationFall = documentHeight * 10 + Math.random() * 5000;
    $flake.clone().appendTo('body').css({
    left: startPositionLeft,
    opacity: startOpacity,
    'font-size': sizeFlake,
    color: getRandomColor()
    }).animate({
    top: endPositionTop,
    left: endPositionLeft,
    opacity: 0.2
    },durationFall,'linear',function(){
    $(this).remove()
    });
    }, options.newOn);
    };
    })(jQuery);
    $(function(){
    $.fn.snow({
    minSize: 5, /* 定义雪花最小尺寸 */
    maxSize: 50,/* 定义雪花最大尺寸 */
    newOn: 200 /* 定义密集程度,数字越小越密集 */
    });
    });
    var getRandomColor = function(){
    return '#'+Math.floor(Math.random()*16777215).toString(16);
    }
    </script>


  • 相关阅读:
    单独的数字
    设计模式之原型模式
    设计模式之策略模式
    设计模式之单例模式
    泛型入门
    iOS中关于.pch的新建与配置问题
    iOS开发中遇到的头文件找不到的问题解决办法
    iOS中NSJSONSerialization的使用 小记
    6.线程、进程、协程基础篇
    5.装饰器进阶篇
  • 原文地址:https://www.cnblogs.com/shusonghe/p/12957098.html
Copyright © 2020-2023  润新知