博客园背景特效
不是原创!不是原创!我也是从别的博主那里复制过来的!侵权联系我!
皮肤我用的是下面这个,记得申请js权限!!!
在页面定制css代码中写入以下代码:
点击查看代码
/* **********************
* 整体布局
* **********************/
/* 整体布局 */
body {
background: rgb(250, 233, 250);
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica
Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
cursor: url(https://files.cnblogs.com/files/wkfvawl/cursor.ico),auto;
}
#home {
max-width: 1300px;
padding: 15px;
background: transparent;
box-shadow: none;
margin-top: 0;
width: auto;
}
#main {
margin-top: 15px;
}
#mainContent .forFlow {
padding-right: 20px;
}
/* 非阅读区域去掉白色背景 */
.newsItem,
.catListEssay,
.catListLink,
.catListNoteBook,
.catListTag,
.catListPostCategory,
.catListPostArchive,
.catListImageCategory,
.catListArticleArchive,
.catListView,
.catListFeedback,
.mySearch,
.catListComment,
.catListBlogRank,
.catList,
.catListArticleCategory {
background-color: transparent;
}
/* **********************
* 博客页首
* **********************/
/* 隐藏系统标题 */
#blogTitle {
display: none;
}
/* 顶部通告条 */
.c-notice {
padding: 10px 0;
background: rgba(165, 96, 165, 0.359);
font-size: 0.9em;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.23);
font-size: 13px;
}
.c-notice > div {
max-width: 1240px;
margin: 0 auto;
padding: 0 15px;
color: purple;
}
.c-notice a {
color: blue;
}
/* 头像和社交 */
.c-portrait {
text-align: center;
padding: 50px 0;
background: url("<p style="margin-bottom:15px;line-height:2">
微信号:<b style="color:#1aad19;font-size:16px;">Chloe56_</b>(备注博客园)
<br />
QQ号:<b style="color:#f85959;font-size:13px;">1490984095</b>(备注博客园)
<br />
所在地:黑龙江 哈尔滨
</p>
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"/>
<script src="https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget/autoload.js"></script>") fixed;
color: rgb(223, 241, 223);
margin-bottom: -40px;
}
/* 头像 */
.c-portrait > img {
display: inline-block;
height: 100px;
border-radius: 50%;
}
/* 标题和签名 */
.c-portrait h1 {
font-size: 30px;
font-weight: bold;
margin: 5px 0;
}
.c-portrait h1 a {
color: rgb(97, 16, 86);
}
.c-portrait h2 {
font-size: 20px;
margin: 7px 0 10px;
color: rgb(75, 7, 75);
}
/* 社交图标 */
.c-social a {
color: #fafafa;
display: inline-block;
vertical-align: middle;
}
/* **********************
* 导航栏
* **********************/
#navigator {
padding: 0 10px;
border-bottom: 2px solid #ccc;
}
#stats_article_count {
display: none;
}
/* **********************
* 侧边栏
* **********************/
#sideBar {
width: 250px;
margin-top: 0;
}
#sideBar a {
color: inherit;
}
/* 隐藏侧边公告标题 */
.newsItem .catListTitle {
display: none;
}
/* 增加列表项间距 */
.sidebar-block li {
margin-bottom: 5px;
}
/* **********************
* 文章列表
* **********************/
/* 文章列表 */
#topics .postTitle {
font-size: 28px;
margin: 35px 0 30px;
padding-left: 0;
}
#mainContent .day {
padding: 15px 20px;
background: #fff;
}
#mainContent .day .postTitle a {
display: inline-block;
}
/* **********************
* 文章详情
* **********************/
pre {
margin-bottom: 1.35em;
}
pre code {
padding: 10px 16px !important;
}
.post {
background: #fff;
padding: 0 60px 60px;
box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
}
/* 文章标题 */
.postTitle {
border-left: 8px solid #21759b;
margin-bottom: 5px;
font-weight: bold;
line-height: 1;
box-sizing: border-box;
}
.postTitle a:hover {
margin-left: 0;
}
/* 去除首行缩进 */
.postBody p,
.postCon p {
text-indent: 0;
}
/* 重写引用块样式 */
.postBody blockquote {
min-height: auto;
border-top: none;
border-bottom: none;
border-right: none;
padding: 0 0 0 1em;
}
/* 增加底部留白 */
#cnblogs_post_body {
padding-bottom: 5px;
}
/* 防止图片溢出 */
#cnblogs_post_body img {
max-width: 100%;
}
/* 文章底部信息 */
.postDesc {
margin-top: 0;
}
/* **********************
* 评论
* **********************/
#comment_form_container .comment_textarea {
width: 100%;
}
.comment_vote {
padding-right: 2px;
font-size: 14px;
margin-top: 10px;
}
.comment_vote a.comment_digg {
color: #f80;
}
.feedbackItem {
margin: 20px 0 25px;
background: #fff;
padding: 10px 15px;
}
.feedbackCon {
font-size: 13px;
border-bottom: 0;
padding: 10px 5px 0 5px;
text-align: justify;
}
/* **********************
* 文章评价
* **********************/
#div_digg {
position: fixed;
right: 30px;
bottom: 50px;
background: #fff;
padding: 20px 20px 15px;
border-radius: 5px;
border: 1px solid #888;
box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.3);
}
/* **********************
* 隐藏广告
* **********************/
#ad_t2,
#opt_under_post,
.c_ad_block,
#under_post_news,
#under_post_kb {
display: none !important;
}
/* **********************
* 适配手机
* **********************/
@media (max-width: 767px) {
#home {
padding-left: 0;
padding-right: 0;
}
#div_digg {
width: auto;
padding: 0;
right: -25px;
bottom: 3px;
box-shadow: none;
}
#div_digg .buryit {
display: none;
}
#mainContent .forFlow {
padding-right: 0;
}
#mainContent .post {
padding: 0 20px;
}
#sideBar,
#blog-comments-placeholder {
padding: 0 15px;
}
}
.container1{
width: 100%;
height:400px;
margin: 0;
padding: 0;
background-color:#FFFFFF;
float:left;
margin-top:-400px;
opacity:0.1;
}
博客侧边栏写入这个代码:
点击查看代码
<p style="margin-bottom:15px;line-height:2">
微信号:<b style="color:#1aad19;font-size:16px;">这里是微信号</b>(备注博客园)
<br />
QQ号:<b style="color:#f85959;font-size:13px;">这里是QQ号</b>(备注博客园)
<br />
所在地:**** **
</p>
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"/>
<script src="https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget/autoload.js"></script>
页首写入这个代码:
点击查看代码
<div class="c-notice">
<div>
这里是公告栏~
</div>
</div>
<div class="c-portrait">
<img src="" alt="这是一个头像 放地址就好了" />
<h1><a href="https://www.cnblogs.com/chloe56/">名字~</a></h1>
<h2>写个人简介咯~ </h2>
<div class="c-social">
<!-- 这里放你所拥有的社交图标 -->
</div>
</div>
页脚写入这个代码:
这里有鼠标点击特效、左下角人物、页面底部小海豚 嘻嘻~
点击查看代码
<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-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/wkfvawl/mouse-click.js"></script>
<canvas width="1777" height="841" style="position: fixed; left: 0px; top: 0px; z-index: 2147483647; pointer-events: none;"></canvas>
<div id="datouwang" class="container1"></div>
<script>
var RENDERER = {
POINT_INTERVAL : 5,
FISH_COUNT : 2,
MAX_INTERVAL_COUNT : 50,
INIT_HEIGHT_RATE : 0.5,
init : function(){
this.setParameters();
this.reconstructMethods();
this.setup();
this.bindEvent();
this.render();
},
setParameters : function(){
this.$window = $(window);
this.$container = $('#datouwang');
this.$canvas = $('<canvas />');
this.context = this.$canvas.appendTo(this.$container).get(0).getContext('2d');
this.points = [];
this.fishes = [];
this.watchIds = [];
},
createSurfacePoints : function(){
var count = Math.round(this.width / this.POINT_INTERVAL);
this.pointInterval = this.width / (count - 1);
this.points.push(new SURFACE_POINT(this, 0));
for(var i = 1; i < count; i++){
var point = new SURFACE_POINT(this, i * this.pointInterval),
previous = this.points[i - 1];
point.setPreviousPoint(previous);
previous.setNextPoint(point);
this.points.push(point);
}
},
reconstructMethods : function(){
this.watchWindowSize = this.watchWindowSize.bind(this);
this.jdugeToStopResize = this.jdugeToStopResize.bind(this);
this.startEpicenter = this.startEpicenter.bind(this);
this.moveEpicenter = this.moveEpicenter.bind(this);
this.render = this.render.bind(this);
},
setup : function(){
this.points.length = 0;
this.fishes.length = 0;
this.watchIds.length = 0;
this.intervalCount = this.MAX_INTERVAL_COUNT;
this.width = this.$container.width();
this.height = this.$container.height();
this.fishCount = this.FISH_COUNT * this.width / 500 * this.height / 500;
this.$canvas.attr({width : this.width, height : this.height});
this.skyGradient = this.context.createLinearGradient(0, 0, 0, this.height);
this.skyGradient.addColorStop(0, 'hsl(180, 80%, 90%)');
this.skyGradient.addColorStop(1, 'hsl(180, 80%, 60%)');
this.seaGradient = this.context.createLinearGradient(0, 0, 0, this.height);
this.seaGradient.addColorStop(0, 'hsl(180, 80%, 60%)');
this.seaGradient.addColorStop(0.5, 'hsl(180, 80%, 50%)');
this.seaGradient.addColorStop(1, 'hsl(210, 80%, 50%)');
this.fishes.push(new FISH(this));
this.createSurfacePoints();
},
watchWindowSize : function(){
this.clearTimer();
this.tmpWidth = this.$window.width();
this.tmpHeight = this.$window.height();
this.watchIds.push(setTimeout(this.jdugeToStopResize, this.WATCH_INTERVAL));
},
clearTimer : function(){
while(this.watchIds.length > 0){
clearTimeout(this.watchIds.pop());
}
},
jdugeToStopResize : function(){
var width = this.$window.width(),
height = this.$window.height(),
stopped = (width == this.tmpWidth && height == this.tmpHeight);
this.tmpWidth = width;
this.tmpHeight = height;
if(stopped){
this.setup();
}
},
bindEvent : function(){
this.$window.on('resize', this.watchWindowSize);
this.$container.on('mouseenter', this.startEpicenter);
this.$container.on('mousemove', this.moveEpicenter);
},
getAxis : function(event){
var offset = this.$container.offset();
return {
x : event.clientX - offset.left + this.$window.scrollLeft(),
y : event.clientY - offset.top + this.$window.scrollTop()
};
},
startEpicenter : function(event){
this.axis = this.getAxis(event);
},
moveEpicenter : function(event){
var axis = this.getAxis(event);
if(!this.axis){
this.axis = axis;
}
this.points[Math.round(axis.x / this.pointInterval)].interfere(axis.y, axis.y - this.axis.y);
this.axis = axis;
},
generateEpicenter : function(x, y, prevX, prevY){
var index = Math.round(x / this.pointInterval);
if(index < 0 || index >= this.points.length){
return;
}
this.points[index].interfere(y, y - prevY);
},
render : function(){
requestAnimationFrame(this.render);
this.context.fillStyle = this.skyGradient;
this.context.fillRect(0, 0, this.width, this.height);
this.context.fillStyle = this.seaGradient;
this.context.beginPath();
this.context.moveTo(0, this.height);
for(var i = 0, count = this.points.length; i < count; i++){
this.points[i].updateSelf();
}
for(var i = 0, count = this.points.length; i < count; i++){
this.points[i].updateNeighbors();
}
for(var i = 0, count = this.points.length; i < count; i++){
this.points[i].render(this.context);
}
this.context.lineTo(this.width, this.height);
this.context.closePath();
this.context.fill();
for(var i = 0, count = this.fishes.length; i < count; i++){
this.fishes[i].render(this.context);
}
if(this.fishes.length < this.fishCount){
if(--this.intervalCount == 0){
this.intervalCount = this.MAX_INTERVAL_COUNT;
this.fishes.push(new FISH(this));
}
}
}
};
var SURFACE_POINT = function(renderer, x){
this.renderer = renderer;
this.x = x;
this.init();
};
SURFACE_POINT.prototype = {
SPRING_CONSTANT : 0.03,
SPRING_FRICTION : 0.9,
WAVE_SPREAD : 0.3,
ACCELARATION_RATE : 0.01,
init : function(){
this.initHeight = this.renderer.height * this.renderer.INIT_HEIGHT_RATE;
this.height = this.initHeight;
this.fy = 0;
this.force = {previous : 0, next : 0};
},
setPreviousPoint : function(previous){
this.previous = previous;
},
setNextPoint : function(next){
this.next = next;
},
interfere : function(y, velocity){
var offset = this.renderer.height - this.height - y;
if(offset > 0 && velocity < 0 || offset < 0 && velocity > 0){
return;
}
this.fy = this.renderer.height * this.ACCELARATION_RATE * (offset >= 0 ? -1 : 1) * Math.abs(velocity);
},
updateSelf : function(){
this.fy += this.SPRING_CONSTANT * (this.initHeight - this.height);
this.fy *= this.SPRING_FRICTION;
this.height += this.fy;
},
updateNeighbors : function(){
if(this.previous){
this.force.previous = this.WAVE_SPREAD * (this.height - this.previous.height);
}
if(this.next){
this.force.next = this.WAVE_SPREAD * (this.height - this.next.height);
}
},
render : function(context){
if(this.previous){
this.previous.height += this.force.previous;
this.previous.fy += this.force.previous;
}
if(this.next){
this.next.height += this.force.next;
this.next.fy += this.force.next;
}
context.lineTo(this.x, this.renderer.height - this.height);
}
};
var FISH = function(renderer){
this.renderer = renderer;
this.init();
};
FISH.prototype = {
LENGTH : 40,
GRAVITY : 0.4,
init : function(){
this.direction = Math.random() < 0.5;
this.x = this.direction ? (this.renderer.width + this.LENGTH) : -this.LENGTH;
this.y = this.getRandomValue(this.renderer.height * 6 / 10, this.renderer.height * 9 / 10);
this.prevX = this.x;
this.prevY = this.y;
this.vx = this.getRandomValue(4, 8) * (this.direction ? -1 : 1);
this.vy = this.getRandomValue(-5, -2);
this.ay = this.getRandomValue(-0.2, -0.05);
this.theta = 0;
this.phi = 0;
this.isOut = false;
},
getRandomValue : function(min, max){
return min + (max - min) * Math.random();
},
render : function(context){
context.save();
context.translate(this.x, this.y);
context.rotate(Math.PI + Math.atan2(this.vy, this.vx));
context.scale(1, this.direction ? 1 : -1);
context.fillStyle = 'hsl(180, 30%, 80%)';
context.beginPath();
context.moveTo(-30, 0);
context.bezierCurveTo(-20, 15, 15, 10, 40, 0);
context.bezierCurveTo(15, -10, -20, -15, -30, 0);
context.fill();
context.save();
context.translate(40, 0);
context.scale(0.9 + 0.1 * Math.sin(this.theta), 1);
context.fillStyle = 'hsl(180, 30%, 80%)';
context.beginPath();
context.moveTo(0, 0);
context.quadraticCurveTo(5, 10, 20, 8);
context.quadraticCurveTo(12, 5, 10, 0);
context.quadraticCurveTo(12, -5, 20, -8);
context.quadraticCurveTo(5, -10, 0, 0);
context.fill();
context.restore();
context.save();
context.translate(-3, 0);
context.rotate(Math.PI / 3 + Math.PI / 20 * Math.sin(this.phi));
context.fillStyle = 'hsl(220, 80%, 40%)';
context.beginPath();
context.moveTo(-5, 0);
context.bezierCurveTo(-10, -10, -10, -30, 0, -40);
context.bezierCurveTo(12, -25, 8, -10, 0, 0);
context.closePath();
context.fill();
context.restore();
context.strokeStyle = 'hsl(220, 80%, 40%)';
context.beginPath();
context.arc(-15, -3, 5, 0, Math.PI * 2, false);
context.stroke();
context.fillStyle = 'hsl(220, 80%, 40%)';
context.beginPath();
context.arc(-15, -3, 3, 0, Math.PI * 2, false);
context.fill();
context.restore();
this.prevX = this.x;
this.prevY = this.y;
this.x += this.vx;
this.y += this.vy;
this.vy += this.ay;
if(this.y < this.renderer.height * this.renderer.INIT_HEIGHT_RATE){
this.vy += this.GRAVITY;
this.isOut = true;
}else{
if(this.isOut){
this.ay = this.getRandomValue(-0.2, -0.05);
}
this.isOut = false;
}
this.theta += Math.PI / 20;
this.theta %= Math.PI * 2;
this.phi += Math.PI / 30;
this.theta %= Math.PI * 2;
if(this.y > this.renderer.height * this.renderer.INIT_HEIGHT_RATE - this.LENGTH && this.y < this.renderer.height * this.renderer.INIT_HEIGHT_RATE + this.LENGTH){
this.renderer.generateEpicenter(this.x + (this.direction ? -1 : 1) * this.LENGTH, this.y, this.prevX, this.prevY);
}
if(this.vx > 0 && this.x > this.renderer.width + this.LENGTH || this.vx < 0 && this.x < -this.LENGTH){
this.init();
}
}
};
$(function(){
RENDERER.init();
});
</script>
overover 碎觉啦~
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· 展开说说关于C#中ORM框架的用法!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?