【js+css】博客园页面美化

css部分

 

html {
height: 90%;
}
#site_nav_under {
display: none;
}
.c_ad_block, .ad_text_commentbox {
display: none;
margin: 0;
padding: 0;
}
#ad_under_google {
height: 0;
overflow: hidden;
}
#ad_under_google a {
display: none;
}
#home {
margin: 0 auto;
width: 1000px;
background-color: #fff;
padding: 30px;
margin-top: 30px;
margin-bottom: 30px;
box-shadow: 0 2px 6px rgba(100, 100, 100, 0.5);
}


#blogTitle h1 a,#blogTitle h2 {
display: none;
}

#blogTitle h2 {
background:url("https://images.cnblogs.com/cnblogs_com/971125zhang/1783703/t_2006090924241591694616_592538(%E5%B7%B2%E5%8E%BB%E5%BA%95).png?t=1591694991411") no-repeat center 0px;
width: 750px;
background-size: 700px 34px;
}

#blogTitle h1 {
background:url("https://images.cnblogs.com/cnblogs_com/971125zhang/1780332/t_200604082005e01fe9858a414100a4ae0876aadeb903(%E5%B7%B2%E5%8E%BB%E5%BA%95).png?t=1591258850222") no-repeat center 21px;
}


#navigator {
font-size: 13px;
border-bottom: 1px solid #ededed;
border-top: 1px solid #ededed;
clear: both;
margin-top: 25px;
}

#navigator {
background-color: #169fe6;
height: 60px;
clear: both;
position: relative;
border: 1px solid #138cca;
border-left: none;
border-right: none;
}

#blogTitle {
background: url(https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1591262282481&di=52a07925930e2d7ea686f5c409418bf7&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fblog%2F201405%2F23%2F20140523090717_HMEw4.gif) repeat center 21px;
height: 314px;
clear: both;
width: 1000px;
margin: 0 auto;
position: relative;
}

.day {
background: #fff;
padding: 20px;
border: 1px solid #dedede;
margin-bottom: -1px;
width: 955px;
}


body{
background-image:url("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1591260360620&di=87053441d11d164083d6936600c94282&imgtype=0&src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201612%2F20%2F20161220232418_ZsThA.thumb.400_0.jpeg");
background-repeat:repeat;
background-attachment: fixed;
filter:alpha(opacity=70); -moz-opacity:0.8; -khtml-opacity: 0.8; opacity: 0.8;
cursor: url(https://files.cnblogs.com/files/wkfvawl/cursor.ico),auto;
}


#footer {
display: none;
}

/*改变分享样式*/
#green_channel {
display: none;
}
.postDesc {
display: none;
}
/*屏蔽评论下的广告*/
#opt_under_post{
display: none;
}
#under_post_news{
display: none;
}
#ad_t2{
display: none;
}
#under_post_kb{
display: none;
}
/*屏蔽个人信息*/
#blog_post_info_block {
display: none;
}

 

#mainContent {
background: none;
float: left;
overflow: visible;
text-overflow: ellipsis;
width: 1000px;
word-break: break-all;
}
#comment_nav{
display: none;
}
#blog-comments-placeholder{
display: none;
}
#comment_form_container{
display: none;
}

 

 

 

 js部分

 

<script type="text/javascript">


if (window.console) {
var cons = console;
if (cons) {
cons.log("%c\n ", "font-size:100px;background:url('https://pic.cnblogs.com/avatar/2055357/20200603103200.png') no-repeat 1px");

console.log("%c欢迎参观来自:Java·小白的后台","background: rgba(252,234,187,1);background: -moz-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%,rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -webkit-gradient(left top, right top, color-stop(0%, rgba(252,234,187,1)), color-stop(12%, rgba(175,250,77,1)), color-stop(28%, rgba(0,247,49,1)), color-stop(39%, rgba(0,210,247,1)), color-stop(51%, rgba(0,189,247,1)), color-stop(64%, rgba(133,108,217,1)), color-stop(78%, rgba(177,0,247,1)), color-stop(87%, rgba(247,0,189,1)), color-stop(100%, rgba(245,22,52,1)));background: -webkit-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -o-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -ms-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: linear-gradient(to right, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fceabb', endColorstr='#f51634', GradientType=1 );font-size:2em;")
}
}

/* 鼠标特效 */
var a_idx =Math.floor(Math.random() * (7 - 0) + 0);
jQuery(document).ready(function($) {
$("body").click(function(e) {
var a = new Array("❤变瘦❤","❤变帅❤","❤变漂亮❤","❤智商+1❤","❤情商+1❤","❀桃花+1❀","❤升职❤","❤加薪❤");
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-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>
<script src="https://files.cnblogs.com/files/zhonglinke/TweenMax.min.js"></script>
<script src="https://files.cnblogs.com/files/zhonglinke/ScrollToPlugin.min.js"></script>
<style type="text/css">
/* 小火箭css */
#gotop1 {
width: 80px;
position: fixed;
bottom: 30px;
cursor: pointer;
z-index: 99998;
right: 3%;
}
/* 小火箭悬停特效 */
#gotop1:hover {
animation: rubberBand 1s;
}

@keyframes rubberBand {
from {
transform: scale3d(1, 1, 1);
}

30% {
transform: scale3d(1.25, 0.75, 1);
}

40% {
transform: scale3d(0.75, 1.25, 1);
}

50% {
transform: scale3d(1.15, 0.85, 1);
}

65% {
transform: scale3d(.95, 1.05, 1);
}

75% {
transform: scale3d(1.05, .95, 1);
}

to {
transform: scale3d(1, 1, 1);
}
}
/* end 小火箭 */

</style>

<span id="gotop1" style="">
<img src="https://www.cnblogs.com/images/cnblogs_com/zhonglinke/1429059/t_huojian1.png" tppabs="http://www.jq22.com/demo/jquery-top20161222/img/huojian.svg" alt="返回顶部小火箭">
</span>
<script type="text/javascript">
/* 选择你喜欢的速度类型,复制下面的某段代码即可。不明处请咨询:qpjk.cc */
$(function() {
// 返回顶部,绑定gotop1图标和gotop2文字事件
$("#gotop1,#gotop2").click(function(e) {
TweenMax.to(window, 1.5, {scrollTo:0, ease: Expo.easeInOut});
var huojian = new TimelineLite();
huojian.to("#gotop1", 1, {rotationY:720, scale:0.6, y:"+=40", ease: Power4.easeOut})
.to("#gotop1", 1, {y:-1000, opacity:0, ease: Power4.easeOut}, 0.6)
.to("#gotop1", 1, {y:0, rotationY:0, opacity:1, scale:1, ease: Expo.easeOut, clearProps: "all"}, "1.4");
});

});
</script>
<script>
document.addEventListener("visibilitychange", function () {
if (document.hidden) {
document.title="用户离开❤";
} else {
document.title="欢迎回来❤";
setTimeout(function(){
document.title= "❤Java·小白❤";
}, 2000);
}
}, false);
</script>

});

});
</script>

 

 

 

效果如下:

 

 

 

posted @ 2020-03-04 17:34  Java·小白  阅读(195)  评论(1)    收藏  举报
返回顶部小火箭