惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
腾讯CDC
S
Securelist
Know Your Adversary
Know Your Adversary
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 【当耐特】
V2EX - 技术
V2EX - 技术
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
Cisco Talos Blog
Cisco Talos Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
W
WeLiveSecurity
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
博客园 - Franky
S
Security Affairs
博客园 - 司徒正美
V
V2EX
K
Kaspersky official blog
T
Threatpost
NISL@THU
NISL@THU
博客园 - 叶小钗
Help Net Security
Help Net Security
PCI Perspectives
PCI Perspectives
IT之家
IT之家
小众软件
小众软件
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Last Week in AI
Last Week in AI
Jina AI
Jina AI
爱范儿
爱范儿
罗磊的独立博客
N
News and Events Feed by Topic
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
L
LINUX DO - 热门话题
Google Online Security Blog
Google Online Security Blog
雷峰网
雷峰网
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint

星空下的YZY

【生活随笔】终于可以试一试new Bing了 指定日期网页自动变灰 【学习记录】微信小程序tabBar与自定义navigationBar踩坑记录 这小小破站(摸鱼)一周年啦 【个人记录参考】Vue3搭建项目 【学习记录】CSS动画 【随笔】将备案接入服务商转为腾讯云 正则表达式 【随笔】模拟退火 【随笔】博弈题基础回顾 live2d-widget(看板娘)修改及部署至服务器 【生活随笔】又是一年226,祝自己生日快乐 【杂记】各类零碎笔记(不定期更新) 友链朋友圈4.X.X前端适配尝试【基于店长Akilar的旧版方案】 使用JDBC操作数据库 Java读写txt文件 Hexo中使用ECharts动态图表尝试 【随笔】通过必应的工具发现别的网站未经允许的转载 【暂不公开】YZY的ACM模板整理-java版
更换Butterfly主题及其美化记录
星空下的YZY · 2022-01-10 · via 星空下的YZY

其实换主题已经有一段时间了,由于期末一下没太多时间整理,一耽搁,有些修改可能忘了,我就把能想起来的先记录下来,以备不时之需(所以,后续不定时更新)

由于想要增添一些新东西,原来使用的matery主题现有的布局,我认为再增添上东西后会影响布局的美观。在寻找解决方案的过程中,我发现了butterfly这个主题。该主题不但内容丰富、布局美观,并且自带了昼夜切换以及其侧边栏有较高的可拓展性。经过深思熟虑后,觉得将主题更换为butterfly主题。

1
- <div class="aplayer no-destroy" data-id="6804316983" data-server="netease" data-type="playlist" data-fixed="true" data-mini="true" data-listFolded="true" data-order="random" data-preload="auto" data-autoplay="false" muted></div>
1
2
- <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.min.js"></script>
1
2
3
4
5
@font-face{
font-family:'DIYJH' ;
src:url('/fonts/FZZJ-JHTJW.TTF');
font-display : swap;
}
1
https://github.com/226yzy/Hexo-BaiduPush.git
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
fish();
function fish() {
return (
$("footer").append(
'<div class="container" id="jsi-flying-fish-container"></div>'
),
$(".container").css({
width: "100%",
height: "160px",
margin: 0,
padding: 0,
}),
$("#footer-wrap").css({
position: "absolute",
"text-align": "center",
top: 0,
right: 0,
left: 0,
bottom: 0,
}),
this
);
}
var RENDERER = {
POINT_INTERVAL: 5,
FISH_COUNT: 2,
MAX_INTERVAL_COUNT: 50,
INIT_HEIGHT_RATE: 0.5,
THRESHOLD: 50,

init: function () {
this.setParameters();
this.reconstructMethods();
this.setup();
this.bindEvent();
this.render();
},
setParameters: function () {
this.$window = $(window);
this.$container = $("#jsi-flying-fish-container");
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%, 70%)");
this.skyGradient.addColorStop(1, "hsl(180, 80%, 90%)");

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.generateEpicenter(axis.x, axis.y, axis.y - this.axis.y);
this.axis = axis;
},
generateEpicenter: function (x, y, velocity) {
if (
y < this.height / 2 - this.THRESHOLD ||
y > this.height / 2 + this.THRESHOLD
) {
return;
}
var index = Math.round(x / this.pointInterval);

if (index < 0 || index >= this.points.length) {
return;
}
this.points[index].interfere(y, velocity);
},
controlStatus: function () {
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();
}
if (this.fishes.length < this.fishCount) {
if (--this.intervalCount == 0) {
this.intervalCount = this.MAX_INTERVAL_COUNT;
this.fishes.push(new FISH(this));
}
}
},
render: function () {
requestAnimationFrame(this.render);
this.controlStatus();

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].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);
}
},
};
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) {
this.fy =
this.renderer.height *
this.ACCELARATION_RATE *
(this.renderer.height - this.height - y >= 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 = {
GRAVITY: 0.4,

init: function () {
this.direction = Math.random() < 0.5;
this.x = this.direction
? this.renderer.width + this.renderer.THRESHOLD
: -this.renderer.THRESHOLD;
this.y = this.getRandomValue(
(this.renderer.height * 6) / 10,
(this.renderer.height * 9) / 10
);
this.previousY = this.y;
this.vx = this.getRandomValue(4, 10) * (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();
},
controlStatus: function (context) {
this.previousY = 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;
}
if (!this.isOut) {
this.theta += Math.PI / 20;
this.theta %= Math.PI * 2;
this.phi += Math.PI / 30;
this.phi %= Math.PI * 2;
}
this.renderer.generateEpicenter(
this.x + (this.direction ? -1 : 1) * this.renderer.THRESHOLD,
this.y,
this.y - this.previousY
);

if (
(this.vx > 0 && this.x > this.renderer.width + this.renderer.THRESHOLD) ||
(this.vx < 0 && this.x < -this.renderer.THRESHOLD)
) {
this.init();
}
},
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.2 * 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 / 10) * 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.controlStatus(context);
},
};
$(function () {
RENDERER.init();
});

1
npm install --save hexo-blog-encrypt
1
2
3
4
encrypt:
enable: true
default_abstract: 这是一篇加密文章,内容可能是个人试验内容水平有限暂不公开。如果你确实想看,请与我联系。
default_message: 输入密码,查看文章。
1
2
function dark() {window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;var n,e,i,h,t=.05,s=document.getElementById("universe"),o=!0,a="180,184,240",r="226,225,142",d="226,225,224",c=[];function f(){n=window.innerWidth,e=window.innerHeight,i=.216*n,s.setAttribute("width",n),s.setAttribute("height",e)}function u(){h.clearRect(0,0,n,e);for(var t=c.length,i=0;i<t;i++){var s=c[i];s.move(),s.fadeIn(),s.fadeOut(),s.draw()}}function y(){this.reset=function(){this.giant=m(3),this.comet=!this.giant&&!o&&m(10),this.x=l(0,n-10),this.y=l(0,e),this.r=l(1.1,2.6),this.dx=l(t,6*t)+(this.comet+1-1)*t*l(50,120)+2*t,this.dy=-l(t,6*t)-(this.comet+1-1)*t*l(50,120),this.fadingOut=null,this.fadingIn=!0,this.opacity=0,this.opacityTresh=l(.2,1-.4*(this.comet+1-1)),this.do=l(5e-4,.002)+.001*(this.comet+1-1)},this.fadeIn=function(){this.fadingIn&&(this.fadingIn=!(this.opacity>this.opacityTresh),this.opacity+=this.do)},this.fadeOut=function(){this.fadingOut&&(this.fadingOut=!(this.opacity<0),this.opacity-=this.do/2,(this.x>n||this.y<0)&&(this.fadingOut=!1,this.reset()))},this.draw=function(){if(h.beginPath(),this.giant)h.fillStyle="rgba("+a+","+this.opacity+")",h.arc(this.x,this.y,2,0,2*Math.PI,!1);else if(this.comet){h.fillStyle="rgba("+d+","+this.opacity+")",h.arc(this.x,this.y,1.5,0,2*Math.PI,!1);for(var t=0;t<30;t++)h.fillStyle="rgba("+d+","+(this.opacity-this.opacity/20*t)+")",h.rect(this.x-this.dx/4*t,this.y-this.dy/4*t-2,2,2),h.fill()}else h.fillStyle="rgba("+r+","+this.opacity+")",h.rect(this.x,this.y,this.r,this.r);h.closePath(),h.fill()},this.move=function(){this.x+=this.dx,this.y+=this.dy,!1===this.fadingOut&&this.reset(),(this.x>n-n/4||this.y<0)&&(this.fadingOut=!0)},setTimeout(function(){o=!1},50)}function m(t){return Math.floor(1e3*Math.random())+1<10*t}function l(t,i){return Math.random()*(i-t)+t}f(),window.addEventListener("resize",f,!1),function(){h=s.getContext("2d");for(var t=0;t<i;t++)c[t]=new y,c[t].reset();u()}(),function t(){document.getElementsByTagName('html')[0].getAttribute('data-theme')=='dark'&&u(),window.requestAnimationFrame(t)}()};
dark()
1
npm install hexo-simple-mindmap
1
2
3
4
5
6
7
8
9
10
{% pullquote mindmap mindmap-md %}

- [在 Hexo 中使用思维导图](https://hunterx.xyz/use-mindmap-in-hexo.html)
- 前言
- 操作指南
- 准备需要的文件
- 为主题添加 CSS/JS 文件
- 使用方法

{% endpullquote %}