/* 你的 HTML 代码将放在这里 */
L
O
A
D
I
N
G
紅葉
有趣的小东西

有趣的小东西

有点用的小网站

主页导航网站(需要科学上网,有用但不多)

vscode好玩插件

1.code GPT(帮你联想代码,写注释)

github copilot 代码GPT

TONGYI Lingma (同等功能)

CodeGeeX (同等功能)

2.MD文件预览

Markdown Preview Github Styling

Markdown All in One

3.滑词翻译

Code Translate

4.代码截图

CodeSnap

博客pro

本博客用hexo为框架 kira为主题

kira-hexo

美化-添加好玩的玩意

● 添加鼠标点击爱心效果

找到/hexo-theme-kira文件夹里面/source/js 下新建文件 love.js,在 love.js 文件中添加以下代码:

1
!function(e,t,a){function n(){c(".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: 500%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),o(),r()}function r(){for(var e=0;e<d.length;e++)d[e].alpha<=0?(t.body.removeChild(d[e].el),d.splice(e,1)):(d[e].y--,d[e].scale+=.004,d[e].alpha-=.013,d[e].el.style.cssText="left:"+d[e].x+"px;top:"+d[e].y+"px;opacity:"+d[e].alpha+";transform:scale("+d[e].scale+","+d[e].scale+") rotate(45deg);background:"+d[e].color+";z-index:99999");requestAnimationFrame(r)}function o(){var t="function"==typeof e.onclick&&e.onclick;e.onclick=function(e){t&&t(),i(e)}}function i(e){var a=t.createElement("div");a.className="heart",d.push({el:a,x:e.clientX-5,y:e.clientY-5,scale:1,alpha:1,color:s()}),t.body.appendChild(a)}function c(e){var a=t.createElement("style");a.type="text/css";try{a.appendChild(t.createTextNode(e))}catch(t){a.styleSheet.cssText=e}t.getElementsByTagName("head")[0].appendChild(a)}function s(){return"rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"}var d=[];e.requestAnimationFrame=function(){return e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)}}(),n()}(window,document);

找到/hexo-theme-kira文件夹/layout/ 除了layout.ejs外,其他xx.ejs都要加 少一个则不能全覆盖 文件末尾添加以下代码:

1
2
<!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/love.js"></script>

完成以上操作后,当我们点击鼠标的时候就可以看见爱心的特效了

本文作者:紅葉
本文链接:https://swe-et.github.io/funny/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可