[关闭]
@huangdanning 2021-07-08T15:51:39.000000Z 字数 8702 阅读 418

博客个性化设置记录2021、7、8

blog


一 footer

顶端

  1. <!-- 粒子时钟 -->
  2. <div style="">
  3. <canvas id="canvas" style="width:60%;">当前浏览器不支持canvas,请更换浏览器后再试</canvas>
  4. </div>
  5. <script>
  6. (function(){
  7. var digit=
  8. [
  9. [
  10. [0,0,1,1,1,0,0],
  11. [0,1,1,0,1,1,0],
  12. [1,1,0,0,0,1,1],
  13. [1,1,0,0,0,1,1],
  14. [1,1,0,0,0,1,1],
  15. [1,1,0,0,0,1,1],
  16. [1,1,0,0,0,1,1],
  17. [1,1,0,0,0,1,1],
  18. [0,1,1,0,1,1,0],
  19. [0,0,1,1,1,0,0]
  20. ],//0
  21. [
  22. [0,0,0,1,1,0,0],
  23. [0,1,1,1,1,0,0],
  24. [0,0,0,1,1,0,0],
  25. [0,0,0,1,1,0,0],
  26. [0,0,0,1,1,0,0],
  27. [0,0,0,1,1,0,0],
  28. [0,0,0,1,1,0,0],
  29. [0,0,0,1,1,0,0],
  30. [0,0,0,1,1,0,0],
  31. [1,1,1,1,1,1,1]
  32. ],//1
  33. [
  34. [0,1,1,1,1,1,0],
  35. [1,1,0,0,0,1,1],
  36. [0,0,0,0,0,1,1],
  37. [0,0,0,0,1,1,0],
  38. [0,0,0,1,1,0,0],
  39. [0,0,1,1,0,0,0],
  40. [0,1,1,0,0,0,0],
  41. [1,1,0,0,0,0,0],
  42. [1,1,0,0,0,1,1],
  43. [1,1,1,1,1,1,1]
  44. ],//2
  45. [
  46. [1,1,1,1,1,1,1],
  47. [0,0,0,0,0,1,1],
  48. [0,0,0,0,1,1,0],
  49. [0,0,0,1,1,0,0],
  50. [0,0,1,1,1,0,0],
  51. [0,0,0,0,1,1,0],
  52. [0,0,0,0,0,1,1],
  53. [0,0,0,0,0,1,1],
  54. [1,1,0,0,0,1,1],
  55. [0,1,1,1,1,1,0]
  56. ],//3
  57. [
  58. [0,0,0,0,1,1,0],
  59. [0,0,0,1,1,1,0],
  60. [0,0,1,1,1,1,0],
  61. [0,1,1,0,1,1,0],
  62. [1,1,0,0,1,1,0],
  63. [1,1,1,1,1,1,1],
  64. [0,0,0,0,1,1,0],
  65. [0,0,0,0,1,1,0],
  66. [0,0,0,0,1,1,0],
  67. [0,0,0,1,1,1,1]
  68. ],//4
  69. [
  70. [1,1,1,1,1,1,1],
  71. [1,1,0,0,0,0,0],
  72. [1,1,0,0,0,0,0],
  73. [1,1,1,1,1,1,0],
  74. [0,0,0,0,0,1,1],
  75. [0,0,0,0,0,1,1],
  76. [0,0,0,0,0,1,1],
  77. [0,0,0,0,0,1,1],
  78. [1,1,0,0,0,1,1],
  79. [0,1,1,1,1,1,0]
  80. ],//5
  81. [
  82. [0,0,0,0,1,1,0],
  83. [0,0,1,1,0,0,0],
  84. [0,1,1,0,0,0,0],
  85. [1,1,0,0,0,0,0],
  86. [1,1,0,1,1,1,0],
  87. [1,1,0,0,0,1,1],
  88. [1,1,0,0,0,1,1],
  89. [1,1,0,0,0,1,1],
  90. [1,1,0,0,0,1,1],
  91. [0,1,1,1,1,1,0]
  92. ],//6
  93. [
  94. [1,1,1,1,1,1,1],
  95. [1,1,0,0,0,1,1],
  96. [0,0,0,0,1,1,0],
  97. [0,0,0,0,1,1,0],
  98. [0,0,0,1,1,0,0],
  99. [0,0,0,1,1,0,0],
  100. [0,0,1,1,0,0,0],
  101. [0,0,1,1,0,0,0],
  102. [0,0,1,1,0,0,0],
  103. [0,0,1,1,0,0,0]
  104. ],//7
  105. [
  106. [0,1,1,1,1,1,0],
  107. [1,1,0,0,0,1,1],
  108. [1,1,0,0,0,1,1],
  109. [1,1,0,0,0,1,1],
  110. [0,1,1,1,1,1,0],
  111. [1,1,0,0,0,1,1],
  112. [1,1,0,0,0,1,1],
  113. [1,1,0,0,0,1,1],
  114. [1,1,0,0,0,1,1],
  115. [0,1,1,1,1,1,0]
  116. ],//8
  117. [
  118. [0,1,1,1,1,1,0],
  119. [1,1,0,0,0,1,1],
  120. [1,1,0,0,0,1,1],
  121. [1,1,0,0,0,1,1],
  122. [0,1,1,1,0,1,1],
  123. [0,0,0,0,0,1,1],
  124. [0,0,0,0,0,1,1],
  125. [0,0,0,0,1,1,0],
  126. [0,0,0,1,1,0,0],
  127. [0,1,1,0,0,0,0]
  128. ],//9
  129. [
  130. [0,0,0,0,0,0,0],
  131. [0,0,1,1,1,0,0],
  132. [0,0,1,1,1,0,0],
  133. [0,0,1,1,1,0,0],
  134. [0,0,0,0,0,0,0],
  135. [0,0,0,0,0,0,0],
  136. [0,0,1,1,1,0,0],
  137. [0,0,1,1,1,0,0],
  138. [0,0,1,1,1,0,0],
  139. [0,0,0,0,0,0,0]
  140. ]//:
  141. ];
  142. var canvas = document.getElementById('canvas');
  143. if(canvas.getContext){
  144. var cxt = canvas.getContext('2d');
  145. //声明canvas的宽高
  146. var H = 25,W = 700;
  147. canvas.height = H;
  148. canvas.width = W;
  149. cxt.fillStyle = '#f00';
  150. cxt.fillRect(10,10,50,50);
  151. //存储时间数据
  152. var data = [];
  153. //存储运动的小球
  154. var balls = [];
  155. //设置粒子半径
  156. var R = canvas.height/20-1;
  157. (function(){
  158. var temp = /(\d)(\d):(\d)(\d):(\d)(\d)/.exec(new Date());
  159. //存储时间数字,由十位小时、个位小时、冒号、十位分钟、个位分钟、冒号、十位秒钟、个位秒钟这7个数字组成
  160. data.push(temp[1],temp[2],10,temp[3],temp[4],10,temp[5],temp[6]);
  161. })();
  162. /*生成点阵数字*/
  163. function renderDigit(index,num){
  164. for(var i = 0; i < digit[num].length; i++){
  165. for(var j = 0; j < digit[num][i].length; j++){
  166. if(digit[num][i][j] == 1){
  167. cxt.beginPath();
  168. cxt.arc(14*(R+2)*index + j*2*(R+1)+(R+1),i*2*(R+1)+(R+1),R,0,2*Math.PI);
  169. cxt.closePath();
  170. cxt.fill();
  171. }
  172. }
  173. }
  174. }
  175. /*更新时钟*/
  176. function updateDigitTime(){
  177. var changeNumArray = [];
  178. var temp = /(\d)(\d):(\d)(\d):(\d)(\d)/.exec(new Date());
  179. var NewData = [];
  180. NewData.push(temp[1],temp[2],10,temp[3],temp[4],10,temp[5],temp[6]);
  181. for(var i = data.length-1; i >=0 ; i--){
  182. //时间发生变化
  183. if(NewData[i] !== data[i]){
  184. //将变化的数字值和在data数组中的索引存储在changeNumArray数组中
  185. changeNumArray.push(i+'_'+(Number(data[i])+1)%10);
  186. }
  187. }
  188. //增加小球
  189. for(var i = 0; i< changeNumArray.length; i++){
  190. addBalls.apply(this,changeNumArray[i].split('_'));
  191. }
  192. data = NewData.concat();
  193. }
  194. /*更新小球状态*/
  195. function updateBalls(){
  196. for(var i = 0; i < balls.length; i++){
  197. balls[i].stepY += balls[i].disY;
  198. balls[i].x += balls[i].stepX;
  199. balls[i].y += balls[i].stepY;
  200. if(balls[i].x > W + R || balls[i].y > H + R){
  201. balls.splice(i,1);
  202. i--;
  203. }
  204. }
  205. }
  206. /*增加要运动的小球*/
  207. function addBalls(index,num){
  208. var numArray = [1,2,3];
  209. var colorArray = ["#3BE","#09C","#A6C","#93C","#9C0","#690","#FB3","#F80","#F44","#C00"];
  210. for(var i = 0; i < digit[num].length; i++){
  211. for(var j = 0; j < digit[num][i].length; j++){
  212. if(digit[num][i][j] == 1){
  213. var ball = {
  214. x:14*(R+2)*index + j*2*(R+1)+(R+1),
  215. y:i*2*(R+1)+(R+1),
  216. stepX:Math.floor(Math.random() * 4 -2),
  217. stepY:-2*numArray[Math.floor(Math.random()*numArray.length)],
  218. color:colorArray[Math.floor(Math.random()*colorArray.length)],
  219. disY:1
  220. };
  221. balls.push(ball);
  222. }
  223. }
  224. }
  225. }
  226. /*渲染*/
  227. function render(){
  228. //重置画布宽度,达到清空画布的效果
  229. canvas.height = 100;
  230. //渲染时钟
  231. for(var i = 0; i < data.length; i++){
  232. renderDigit(i,data[i]);
  233. }
  234. //渲染小球
  235. for(var i = 0; i < balls.length; i++){
  236. cxt.beginPath();
  237. cxt.arc(balls[i].x,balls[i].y,R,0,2*Math.PI);
  238. cxt.fillStyle = balls[i].color;
  239. cxt.closePath();
  240. cxt.fill();
  241. }
  242. }
  243. clearInterval(oTimer);
  244. var oTimer = setInterval(function(){
  245. //更新时钟
  246. updateDigitTime();
  247. //更新小球状态
  248. updateBalls();
  249. //渲染
  250. render();
  251. },50);
  252. }
  253. })();
  254. </script>
  255. <!-- 粒子时钟 -->
  256. <!--一言-->
  257. <div class="sidebar-box">
  258. <div class="p-4">一言·Hitokoto</div>
  259. <script type="text/javascript" src="https://chuxjian.asia/hitokoto/?format=js&charset=utf-8"></script>
  260. <div class="hitokoto"><script>hitokoto()</script></div>
  261. </div>
  262. <!-- 开往-友链接力 -->
  263. <a href="https://travellings.link/" target="_blank" rel="noopener" title="开往-友链接力">
  264. <img src="https://cdn.jsdelivr.net/gh/volfclub/travellings@12.0/assets/logo.gif" alt="开往-友链接力" width="120">
  265. </a>
  266. <!-- 点击出现小心心 -->
  267. <script>
  268. (function(window,document,undefined){
  269. var hearts = [];
  270. window.requestAnimationFrame = (function(){
  271. return window.requestAnimationFrame ||
  272. window.webkitRequestAnimationFrame ||
  273. window.mozRequestAnimationFrame ||
  274. window.oRequestAnimationFrame ||
  275. window.msRequestAnimationFrame ||
  276. function (callback){
  277. setTimeout(callback,1000/60);
  278. }
  279. })();
  280. init();
  281. function init(){
  282. css(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: absolute;}.heart:after{top: -5px;}.heart:before{left: -5px;}");
  283. attachEvent();
  284. gameloop();
  285. }
  286. function gameloop(){
  287. for(var i=0;i<hearts.length;i++){
  288. if(hearts[i].alpha <=0){
  289. document.body.removeChild(hearts[i].el);
  290. hearts.splice(i,1);
  291. continue;
  292. }
  293. hearts[i].y--;
  294. hearts[i].scale += 0.004;
  295. hearts[i].alpha -= 0.013;
  296. hearts[i].el.style.cssText = "left:"+hearts[i].x+"px;top:"+hearts[i].y+"px;opacity:"+hearts[i].alpha+";transform:scale("+hearts[i].scale+","+hearts[i].scale+") rotate(45deg);background:"+hearts[i].color;
  297. }
  298. requestAnimationFrame(gameloop);
  299. }
  300. function attachEvent(){
  301. var old = typeof window.onclick==="function" && window.onclick;
  302. window.onclick = function(event){
  303. old && old();
  304. createHeart(event);
  305. }
  306. }
  307. function createHeart(event){
  308. var d = document.createElement("div");
  309. d.className = "heart";
  310. hearts.push({
  311. el : d,
  312. x : event.clientX - 5,
  313. y : event.clientY - 5,
  314. scale : 1,
  315. alpha : 1,
  316. color : randomColor()
  317. });
  318. document.body.appendChild(d);
  319. }
  320. function css(css){
  321. var style = document.createElement("style");
  322. style.type="text/css";
  323. try{
  324. style.appendChild(document.createTextNode(css));
  325. }catch(ex){
  326. style.styleSheet.cssText = css;
  327. }
  328. document.getElementsByTagName('head')[0].appendChild(style);
  329. }
  330. function randomColor(){
  331. return "rgb("+(~~(Math.random()*255))+","+(~~(Math.random()*255))+","+(~~(Math.random()*255))+")";
  332. }
  333. })(window,document);
  334. </script>

版权前

  1. <!-- 运行计时 -->
  2. <span id="timeDate">载入天数...</span><span id="times">载入时分秒...</span>
  3. <script>
  4. var now = new Date();
  5. function createtime() {
  6. var grt= new Date("07/06/2021 09:38:00");//在此处修改你的建站时间
  7. now.setTime(now.getTime()+250);
  8. days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days);
  9. hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours);
  10. if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
  11. mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;}
  12. seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
  13. snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;}
  14. document.getElementById("timeDate").innerHTML = "初x见已陪伴大家🧡"+dnum+" 天 ";
  15. document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒";
  16. }
  17. setInterval("createtime()",250);
  18. </script>

二 sidebar

最新回复上方

  1. <!-- 开往-友链接力 -->
  2. &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
  3. <a href="https://travellings.link/" target="_blank" rel="noopener" title="开往-友链接力">
  4. <img src="https://cdn.jsdelivr.net/gh/volfclub/travellings@12.0/assets/logo.gif" alt="开往-友链接力" width="120">
  5. </a>
  6. <br> </br>
  7. <div class="sidebar-box">
  8. <div class="p-4">我🌞们</div>
  9. <span id="runtime_span">网站已在风雨中运行:267天23小时45分40秒</span><script type="text/javascript">function show_runtime(){window.setTimeout("show_runtime()",1000);X=new Date("12/16/2019 10:52:50");Y=new Date();T=(Y.getTime()-X.getTime());M=24*60*60*1000;a=T/M;A=Math.floor(a);b=(a-A)*24;B=Math.floor(b);c=(b-B)*60;C=Math.floor((b-B)*60);D=Math.floor((c-C)*60);runtime_span.innerHTML="&nbsp&nbsp&nbsp我们已经在风雨中相爱💝"+A+"天"}show_runtime();</script>
  10. </div>

三 主题配置

f11d5377c655cfa9ddba6dab0e940a1a
https://pic.imgdb.cn/item/5f4752b1160a154a674f4644.png 站点图标

✈ 注册/登录
💏 我们の小站

https://pic.imgdb.cn/item/5f4a305b160a154a670eff27.jpg 顶部大图 590px
https://pic.imgdb.cn/item/5f47528b160a154a674f3cb1.jpg 侧边栏头像
本文章版权皆属于作者H_Daniel。转载时请备注原出处及作者,谢谢您的关注及支持! 声明

https://cdn.jsdelivr.net/gh/zwying0814/Cuteen@4.5/static/ CDN

body{cursor:url(https://pic.imgdb.cn/item/5f475371160a154a674f77ec.png),default;}
a:hover{cursor:url(https://pic.imgdb.cn/item/5f475387160a154a674f7ce1.png),pointer;}
//光标

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注