博客主题分享
Posted buringstraw
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了博客主题分享相关的知识,希望对你有一定的参考价值。
(四处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>
以上是关于博客主题分享的主要内容,如果未能解决你的问题,请参考以下文章