1. 程式人生 > >部落格主題分享

部落格主題分享

(四處codecpy過來的程式碼,除了一言是我自己寫的。。。)
部落格園的主題還是比較自由的。。。
頁面定製CSS程式碼:

#myposts .PostList {
    background: #000;
    padding: 20px;
    /* border: 1px solid #dedede; */
    margin: 0 0 -1px 0!important;
}

.day .postTitle2 {
    color: #66ccff;
}

#yiyan{
    color:#fff;
    background:#000;
    opacity:0.6;
    width:40%;
    padding:10px;
}

body{
background: url('https://i.loli.net/2018/11/10/5be6be04338b8.jpg');
    background-repeat:no-repeat;
   background-position:50% 20%;
background-attachment:fixed
}

#blogTitle{
background:transparent;
}

#navigator {

    opacity: 0.6;
    background-color: #000;
border: 0px solid #138cca;

}

.day {

    background: #000;
    padding: 20px;
    border: 0px solid #dedede;
    margin-bottom: -1px;

}
#mainContent {

    opacity: 0.6;

}
#blogCalendar {

    opacity: 0.6;
    background: #000;

}
.newsItem {
    display:none;
}

#sidebar_search {

    background: #000;

}

.catListTitle {

    display: none;

}

#widget_my_zzk {
padding: 15px 0px 15px 15px;
    border-left: 0px solid #dedede;
    border-right: 0px solid #dedede;
}

#widget_my_google {
display:none;
}

#sidebar_search {

    background: #000;
    opacity: 0.6;

}

input::-moz-focus-inner {

    border: 0;
    padding: 0;

}
#btnZzk {

}
#btnZzk {

    background: #9999ff;

}

#under_post_news {

    display: none;

}

#under_post_kb {

    display: none;

}

#comment_form_container {

    background: #000;
    border: 0px solid #dedede;

}


#topics {

    background: #000;
    border: 0px solid #dedede;

}

/*
 程式碼高亮開始,使用了一個叫Monokai Sublime的黑色主題面板,直接拿過來還不行,有一些樣式衝突,還要自己稍微改一些地方
Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/
*/
pre {
/*控制程式碼不換行*/
    white-space: pre;
    word-wrap: normal;
}
.cnblogs-markdown .hljs {
    display: block;
    overflow-x: auto;
    padding: 0.5em;
    background: #23241f !important;
    color: #FFF;
    white-space: pre;
    word-break: normal;
}

.hljs,
.hljs-tag,
.hljs-subst {
  color: #f8f8f2;
}

.hljs-strong,
.hljs-emphasis {
  color: #a8a8a2;
}

.hljs-bullet,
.hljs-quote,
.hljs-number,
.hljs-regexp,
.hljs-literal,
.hljs-link {
  color: #ae81ff;
}

.hljs-code,
.hljs-title,
.hljs-section,
.hljs-selector-class {
  color: #a6e22e;
}

.hljs-strong {
  font-weight: bold;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-name,
.hljs-attr {
  color: #f92672;
}

.hljs-symbol,
.hljs-attribute {
  color: #66d9ef;
}

.hljs-params,
.hljs-class .hljs-title {
  color: #f8f8f2;
}

.hljs-string,
.hljs-type,
.hljs-built_in,
.hljs-builtin-name,
.hljs-selector-id,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-addition,
.hljs-variable,
.hljs-template-variable {
  color: #e6db74;
}

.hljs-comment,
.hljs-deletion,
.hljs-meta {
  color: #75715e;
}

#blog_nav_sitehome {

    display: none;

}


#sidebar_postarchive {

    background: #000;
    opacity: 0.6;
 border: 0px solid #dedede;
}
.sidebar-block ul {

    border: 0px solid #dedede;
}

.entrylistItem {

    background: #000;
    border: 0px solid #dedede;

}

#div_digg {

    display: none;

}

#cnblogs_post_body {

    color: #fff;

}

#topics .postTitle a {

    color: #fff;

}

a:link {

    color: #9999ff;
    text-decoration: none;

}

.dayTitle {

    background: #555;

}

#RecentCommentsBlock {
    display: none;
}

#TopFeedbackPostsBlock {

    display: none;

}




#topview_posts_wrap {
    display: none;
}

#sidebar_toptags {
    background: #000;
    opacity: 0.6;
}

#ad_text_under_commentbox {
    display: none;
}

#ad_t2 {
    display: none;
}

.c_ad_block {
    display: none;
}
div#blog-comments-placeholder {
    background: #000;
    border: 0px solid;
}

頁首Html程式碼:

<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>

<!--滑鼠特效 -->
<script>
var a_idx = 0;
jQuery(document).ready(function($) {
    $("body").click(function(e) {
        var a = new Array('苟','利','國','家','生','死','以','豈','因','禍','福','避','趨','之');
        var $i = $("<span></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 + 20,
            "position": "absolute",
            "font-weight": "bold",
            "color": "rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"
        });
        $("body").append($i);
        $i.animate({
            "top": y - 180,
            "opacity": 0
        },
        1500,
        function() {
            $i.remove();
        });
    });
});
</script>

<!-- 下雪 -->
<div class="Snow">
    <style>
        canvas {
            position:fixed;
            z-index:-999;
        }
    </style>
    <canvas id="Snow" width="1282" height="759"></canvas>
</div>
<script src="https://leanote.com/public/upload/488/5965df49ab644154610012c8/themes/5b421912ab64410aaf0014e4/snow.js 

"></script>

頁尾Html程式碼:

<script>
//去掉頂欄部分按鈕
var a=document.getElementById("navList")
a.children[0].style="display:none;"
a.children[2].style="display:none;"
a.children[5].style="display:none;"
</script>
<script>
//一言
var bt=document.getElementById('blogTitle')
var url='https://hitoapi.cc/sp/'
var ajax = new XMLHttpRequest();
ajax.onreadystatechange=function()
  {
  if (ajax.readyState==4 && ajax.status==200)
    {
   var hit = JSON.parse(ajax.responseText)
if(hit.source){
    bt.innerHTML+="<div id=yiyan>"+hit.text+"<div style='text-align:right;'><br>——"+hit.source+'</div></div>'
}
else{
    bt.innerHTML+="<div id=yiyan>"+hit.text+'</div>'
}

    }
  }
ajax.open('GET',url, true)
ajax.send()

</script>