博客园侧边栏样式
插入时钟:
http://www.blogclock.cn/
插入访客来源:
http://s11.flagcounter.com/more/Fe64/
插入总访客数:
http://www.amazingcounters.com/
插入QQ通讯组件:
https://connect.qq.com/intro/wpa
网易音乐:
https://www.cnblogs.com/hujunzheng/p/4702282.html
将生成后的代码copy进博客园后台设置—博客侧边栏公告(支持HTML代码)(支持JS代码)输入框中
下面的是笔者博客的样式,不做解释。
如果读者想设置自己的样式可参考大神的样式设置,很详细也很炫酷:博客园自定义页面风格设计 后续篇(页面设计模式及代码高亮 鼠标点击效果升级)
选择博客皮肤:SimplyMemory,接下来的修改是在此皮肤基础上做的调整。
页面定制CSS代码:
element.style { font-size: 0px; font-weight:0l; } /*快速评论*/ #div_digg { position: fixed; bottom: 10px; right: 15px; border: 2px solid #ECD7B1; padding: 10px; width: 48px; 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); } .postBody a, .feedbackCon a{ text-decoration: none; color: #c28f6c; } /*搜索框*/ .input_my_zzk { border: 1px solid rgba(163, 82, 225, 0.8) ; } /*统计*/ .blogStats { float: right; font-size: 14px; color: rgba(255,255,255,1); } /*翻页*/ .pager { color: #E91E63 ; font-size: 15px; } .pager a { box-shadow: 0 1px 3px rgba(255, 255, 255, 1) ; border: 0px solid rgba(255, 255, 255, 1) ; background: rgba(255, 255, 255, 1) ; color: #fff; transition: all 0.4s linear 0s; } .pager a:hover { background: rgba(163, 82, 225, 0.2) ; color: rgba(163, 82, 225, 1); } /*最末版权*/ #footer { color: rgba(163, 82, 225, 0.8) ; text-align: center; min-height: 15px; _height: 15px; border-top: 1px solid rgba(163, 82, 225, 0.5) ; margin-top: 50px; padding-top: 10px; margin-bottom: 10px; } /*公告栏*/ #sideBar h3 { font-size: 15px; color: rgba(163, 82, 225, 1) ; padding-left: 3px; border-left: 5px solid rgba(163, 82, 225, 0.8) ; } #sideBar a { color:rgba(163, 82, 225, 0.6) ; } #sideBarMain li { font-size: 13px; color: rgba(163, 82, 225, 1) ; } #sideBar a:hover{ font-size: 14px; color: rgba(163, 82, 225, 1); } .newsItem, .catListEssay, .catListLink, .catListNoteBook, .catListTag, .catListPostCategory, .catListPostArchive, .catListImageCategory, .catListArticleArchive, .catListView, .catListFeedback, .mySearch, .catListComment, .catListBlogRank, .catList, .catListArticleCategory, .input_my_zzk{ background: none; } /*去除文章页底部推广链接*/ .c_ad_block { display: none; } /*分类中文章标题*/ .entrylistPosttitle { border-left: 4px solid rgba(163, 82, 225, 1) ; margin-left: 4px; margin-bottom: 5px; font-size: 16px; width: 100%; clear: both; } .entrylistPosttitle a:link, .entrylistPosttitle a:visited, .entrylistPosttitle a:active { color: rgba(163, 82, 225, 1) ; transition: all 0.4s linear 0s; } /*a链接*/ .postBody a:link, .postBody a:visited, .postBody a:active { text-decoration: underline; } a:visited { color: rgba(163, 82, 225, 1) ; text-decoration: none; } a:link { color: rgba(163, 82, 225, 1) ; text-decoration: none; } /*提交评论按钮*/ .comment_btn { color: #fff; background: rgba(163, 82, 225, 1) ; } /*背景图*/ body { background:rgba(152, 0, 216, 1) url('http://images.cnblogs.com/cnblogs_com/wuyazi/1207561/t_e0009de805e4657cf96f621532bf2677.jpg') fixed no-repeat;; background-position: 50% 0%; background-size: cover; color: #000000ed; } /*主色*/ #home { margin: 0 auto; width: 76%; min-width: 950px; background-color:rgba(255, 255, 255, 0.8); padding: 30px; margin-top: 50px; margin-bottom: 50px; box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3); } /*自己博客名称距离标题栏高度*/ #blogTitle { height: 80px; /*高度*/ clear: both; } /*设置自己的博客名称大小*/ #blogTitle h1 { font-size: 36px; font-weight: bold; line-height: 1.8em;/*原始 1.6em*/ margin-top: 10px;/*原始 15px */ } #blogTitle h1 a { color: rgba(163, 82, 225, 1) ; } #blogTitle h1 a:hover { color: #9C27B0 ; } /*博客签名设置*/ #blogTitle h2 { font-weight: normal; font-size: 15px; /*原始 16px ;font-size: 1.0rem;*/ color: rgba(163, 82, 225, 0.8); text-align: left; transition: all 0.4s linear 0s; } /*标题字体*/ #navigator { font-size: 18px; border-bottom: 1px rgba(163, 82, 225, 1) ; border-top: 1px solid rgba(163, 82, 225, 1) ; height: 50px; background: rgba(163, 82, 225, 0.8) ; clear: both; margin-top: 25px; } #navList a:link, #navList a:visited, #navList a:active { color: rgba(255,255,255,1); font-weight: bold; } #navList a { padding-top: 13px; } /*文章、随便、评论统计*/ .blogStats { margin-right: 12px; } /*文章标题设置*/ .postTitle { border-left: 4px solid rgba(163, 82, 225, 1) ; margin-left: 5px; margin-bottom: 3px; font-size: 16px; width: 100%; clear: both; } .postTitle a:link, .postTitle a:visited, .postTitle a:active { color:rgba(163, 82, 225, 1) ; transition: all 0.4s linear 0s; } #ad_t2{ display:none; } /*代码*/ .cnblogs_code, .cnblogs_code div, .cnblogs_code pre { background-color:rgba(255,255,255, 0.1); border:none; } /*签名*/ #AllanboltSignature, #AllanboltSignature, .comment_textarea, #div_digg{ background-color:rgba(255,255,255, 0.4); border: none; box-shadow:none; } /*github*/ .git-link { z-index: 100; position: fixed; top: 0; right: 0; border: 0; height: 149px; width: 149px; transform: rotate(90deg); -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -ms-transform: rotate(90deg); background-image: url(//images2015.cnblogs.com/blog/459873/201603/459873-20160317090540131-1089895320.png); } /*图片溢出隐藏设置*/ #topics, #mainContent { overflow: visible; } #postDesc { float: none; } /*评论*/ #tbCommentBody { background: url(https://images.cnblogs.com/cnblogs_com/tynam/1207561/o_200113015817command.gif); background-size: 100% 100%; } #comment_form_container .comment_textarea { width: 98%; } /*点赞*/ .buryit { display: none; } #div_digg { background-color: rgba(255,255,255, 0); } #div_digg .diggit { background: url(https://images.cnblogs.com/cnblogs_com/tynam/1415353/o_20051409241619300543988356147944760546156.gif) no-repeat; background-size: 100%; width: 115px; height: 154px; position: relative; right: 91px; } #digg_tips { color: #ebbffb; } #div_digg .diggnum { position: absolute; right: 14px; top: -16px; left: 91px; animation: tynam-stars .4s infinite linear; } .diggnum { color: #ebbffb; font-size: 53px; } @keyframes tynam-stars { 0% {transform: rotate(12deg) translateY(0px);} 50% {transform: rotate(35deg) translateY(-30px);} 100% {transform: rotate(12deg) translateY(0px);} }
博客侧边栏公告:
<p class="para">联系我:<a href="mailto:tynam.yang@gmail.com" title="email">tynam.yang@gmail.com</a></p> <!-- github --> <a class="git-link" href="https://github.com/tynam-yang"></a>
页首HTML代码:
<!--背景星云连接--> <script> !function(){ function n(n,e,t){ return n.getAttribute(e)||t } function e(n){ return document.getElementsByTagName(n) } function t(){ var t=e("script"),o=t.length,i=t[o-1]; return{ l:o,z:n(i,"zIndex",-1),o:n(i,"opacity",1),c:n(i,"color","255,255,255"),n:n(i,"count",99) } } function o(){ a=m.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth, c=m.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight } function i(){ r.clearRect(0,0,a,c); var n,e,t,o,m,l; s.forEach(function(i,x){ for(i.x+=i.xa,i.y+=i.ya,i.xa*=i.x>a||i.x<0?-1:1,i.ya*=i.y>c||i.y<0?-1:1,r.fillRect(i.x-.5,i.y-.5,1,1),e=x+1;e<u.length;e++)n=u[e], null!==n.x&&null!==n.y&&(o=i.x-n.x,m=i.y-n.y, l=o*o+m*m,l<n.max&&(n===y&&l>=n.max/2&&(i.x-=.03*o,i.y-=.03*m), t=(n.max-l)/n.max,r.beginPath(),r.lineWidth=t/2,r.strokeStyle="rgba("+d.c+","+(t+.2)+")",r.moveTo(i.x,i.y),r.lineTo(n.x,n.y),r.stroke())) }), x(i) } var a,c,u,m=document.createElement("canvas"), d=t(),l="c_n"+d.l,r=m.getContext("2d"), x=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame|| function(n){ window.setTimeout(n,1e3/45) }, w=Math.random,y={x:null,y:null,max:2e4};m.id=l,m.style.cssText="position:fixed;top:0;left:0;z-index:"+d.z+";opacity:"+d.o,e("body")[0].appendChild(m),o(),window.onresize=o, window.onmousemove=function(n){ n=n||window.event,y.x=n.clientX,y.y=n.clientY }, window.onmouseout=function(){ y.x=null,y.y=null }; for(var s=[],f=0;d.n>f;f++){ var h=w()*a,g=w()*c,v=2*w()-1,p=2*w()-1;s.push({x:h,y:g,xa:v,ya:p,max:6e3}) } u=s.concat([y]), setTimeout(function(){i()},100) }(); </script> <!-- 更换地址栏logo --> <script type="text/javascript" language="javascript"> document.getElementById('favicon').href = 'https://files.cnblogs.com/files/tynam/logo.ico'; </script>
页脚HTML代码:
<script type="text/javascript"> /* 鼠标特效 */ 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, "position": "absolute", "font-size": "2.1rem", "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> <!-- 点击图片放大显示 --> <!-- zoom.js 的样式 --> <link rel="stylesheet" type="text/css" href="https://blog-static.cnblogs.com/files/yadongliang/zoom.css"> <!-- jQuery 的 cdn --> <script src="https://cdn.bootcss.com/jquery/1.8.3/jquery.min.js"></script> <!-- Bootstrap 的 transition.js cdn(过渡动画插件)--> <script src="https://cdn.bootcss.com/bootstrap/3.2.0/js/transition.js"></script> <!-- zoom.js 核心代码 --> <script src="https://blog-static.cnblogs.com/files/yadongliang/zoom.js"></script> <script type='text/javascript'>$('#cnblogs_post_body img').attr('data-action', 'zoom');</script> <!-- 点击图片放大显示结束 -->
还有其他一些样式,笔者没有使用:
公告栏添加赞赏功能:
<!--打赏--> <meta charset="UTF-8"> <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> <script> $(function(){ $(".pay_item").click(function(){ $(this).addClass('checked').siblings('.pay_item').removeClass('checked'); var dataid=$(this).attr('data-id'); $(".shang_payimg img").attr("src","https://www.cnblogs.com/images/cnblogs_com/tynam/1353054/t_"+dataid+".jpg"); $("#shang_pay_txt").text(dataid=="alipay"?"支付宝":"微信"); }); }); function dashangToggle(){ $(".hide_box").fadeToggle(); $(".shang_box").fadeToggle(); } </script> <style> .content{width:80%;margin:10px auto;} .hide_box{z-index:999;filter:alpha(opacity=50);background:#666;opacity: 0.5;-moz-opacity: 0.5;left:0;top:0;height:99%;width:100%;position:fixed;display:none;} .shang_box{width:430px;height:430px;padding:10px;background-color:#fff;border-radius:10px;position:fixed;z-index:1000;left:50%;top:50%;margin-left:-280px;margin-top:-280px;border:1px dotted #dedede;display:none;} .shang_box img{border:none;border-width:0;} .dashang{display:block;margin:2px auto;color:rgba(255, 255, 255, 1);text-align:center;text-decoration:none;border-radius:10px;font-weight:bold;font-size:16px;transition: all 0.3s;} .dashang:hover{opacity:0.8;padding:2px;font-size:17px;} .dashangText{display:block;ne-height:25px;color:rgba(255, 255, 255, 1);text-align:center;text-decoration:none;border-radius:13px;font-weight:2px;font-size:9px;transition: all 0.3s;padding-bottom:15px;} .dashangText:hover{opacity:0.8;ont-size:14px;} .shang_close{float:right;display:inline-block;} .shang_logo{display:block;text-align:center;margin:20px auto;} .shang_tit{width: 100%;height: 75px;text-align: center;line-height: 66px;color: #a3a3a3;font-size: 16px;background:#fff;font-family: 'Microsoft YaHei';margin-top: 7px;margin-right:2px;} .shang_tit p{color:#a3a3a3;text-align:center;font-size:16px;} .shang_payimg{width:140px;border:6px solid rgba(163, 82, 225, 1) ;margin:0 auto;border-radius:3px;height:140px;} .shang_payimg img{display:block;text-align:center;width:140px;height:140px; } .pay_explain{text-align:center;margin:10px auto;font-size:12px;color:#545454;} .radiobox{width: 16px;height: 16px;background: url('https://www.cnblogs.com/images/cnblogs_com/tynam/1353083/o_radio2.jpg');display: block;float: left;margin-top: 5px;margin-right: 14px;} .checked .radiobox{background:url('https://www.cnblogs.com/images/cnblogs_com/tynam/1353083/o_radio1.jpg');} .shang_payselect{text-align:center;margin:0 auto;margin-top:40px;cursor:pointer;height:60px;width:280px;} .shang_payselect .pay_item{display:inline-block;margin-right:10px;float:left;} .shang_info{clear:both;} .shang_info p,.shang_info a{color:#C3C3C3;text-align:center;font-size:12px;text-decoration:none;line-height:2em;} </style> <p><a href="javascript:void(0)" onclick="dashangToggle()" class="dashang" title="支持一下">????请多多支持????</a></p> <p><a href="javascript:void(0)" onclick="dashangToggle()" class="dashangText" >点击此处进行打赏</a></p> <div class="hide_box"></div> <div class="shang_box"> <a class="shang_close" href="javascript:void(0)" onclick="dashangToggle()" title="关闭"><img src="https://www.cnblogs.com/images/cnblogs_com/tynam/1353083/o_close.jpg" alt="取消" /></a> <div class="shang_tit"> <p>感谢您的支持,我会继续好读书:读好书的!</p> </div> <div class="shang_payimg"> <img src="https://www.cnblogs.com/images/cnblogs_com/tynam/1353054/t_alipay.jpg" alt="扫码支持" title="扫一扫" /> </div> <div class="pay_explain">请多多关照:扫一扫进行打赏</div> <div class="shang_payselect"> <div class="pay_item checked" data-id="alipay"> <span class="radiobox"></span> <span class="pay_logo"><img src="https://www.cnblogs.com/images/cnblogs_com/tynam/1353067/o_alipaylogo.jpg" alt="支付宝" /></span> </div> <div class="pay_item" data-id="weipay"> <span class="radiobox"></span> <span class="pay_logo"><img src="https://www.cnblogs.com/images/cnblogs_com/tynam/1353067/o_wechatlog.jpg" alt="微信" /></span> </div> </div> <div class="shang_info"> <p>打开<span id="shang_pay_txt">支付宝</span>扫一扫,即可进行扫码打赏哦</p> <p>Powered by Tynam.Yang 乐读书:读乐书!!!</p> </div> </div> </div> <!--上边的为打赏-->