效果如下
教程
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
| html .sakana-box { position: fixed; right: 0; bottom: 0; transform-origin: 100% 100%; } .sakana-box { width: 500px; height: 80px; position: relative; pointer-events: none; z-index: 100; } @media screen and (max-width: 768px){ .sakana-box { width: 500px; height: 80px; position: relative; pointer-events: none; } } @media screen and (max-width: 768px){ html .sakana-box { position: inherit; right: 0; bottom: 0; transform-origin: 36% 160%; } } [data-theme="light"] .layout > div:first-child:not(.recent-posts) { background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: none; backdrop-filter: none!important; } [data-theme="dark"] .layout > div:first-child:not(.recent-posts) { background: rgba(15, 15, 15, .75); -webkit-backdrop-filter: none; backdrop-filter: none!important; } html.hide-aside .layout > div:first-child { width: 90%; }
|
1 2 3 4 5 6 7 8 9
| <div class="sakana-box"></div> <script src="https://cdn.staticaly.com/gh/linjiangyu2/halo@master/js/sakana.js"></script> <script> Sakana.init({ el: '.sakana-box', // 启动元素 node 或 选择器 scale: .5, // 缩放倍数 canSwitchCharacter: true, // 允许换角色 }); </script>
|
1 2 3 4 5 6 7 8 9 10
| inject: head: + - <link rel="stylesheet" href="/css/custom.css"> ...... pjax: enable: true exclude: + - /link/
|
就可以得到一个Sakana了~
效果如下
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
| <link rel="apple-touch-icon-precomposed" sizes="180x180" href="./img/icon-r.webp"> <meta name="description" content="念念不忘 必有回响"> + <style> + html .sakana-box{ + position: fixed; + right: 0; + bottom: 0; + transform-origin: 100% 100%; + } + </style> ...... <script src="./js/APlayer.min.js"></script> <script src="./js/Meting2.min.js"></script> <script async data-pjax src="./js/main.js"></script> + <div class="sakana-box"></div> + <script src="https://cdn.jsdelivr.net/gh/linjiangyu2/halo/js/sakana.js"></script> + <script> + + Sakana.setMute(false); + + Sakana.init({ + el: '.sakana-box', + scale: .5, + canSwitchCharacter: true, + }); + </script> </body> </html>
|
然后
推到github就可以了转载自:你会发光叭
![](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)