熱評
加載中...
當前位置:首頁技術館建站教學二開美化博客添加動態彈簧人物效果

博客添加動態彈簧人物效果

今天就來說一下博客怎麼添加 GitHub上sakana大佬的開源專案

效果演示

使用教學

找到主題編輯器,在 footer.php 添加如下代碼即可

<div class="sakana-box"></div>
    <script src="https://cdn.jsdelivr.net/npm/sakana"></script>
    <script>
        // 启动
        const sakana = Sakana.init({
          el:         '.sakana-box',     // 启动元素 node 或 选择器
          scale:      .5,                // 缩放倍数
          canSwitchCharacter: true,      // 允许换角色
          inertia:    0.01,              // 惯性
          decay:      0.97,              // 衰减
          r:          -20,                // 启动角度
          y:          10,                // 启动高度
          scale:      0.5,                 // 缩放倍数
          translateY: 0,                 // 位移高度
        });
    </script>
     
    <style>
        html .sakana-box{
            z-index: 80;
            position: fixed;
            right: 0;
            bottom: 0;
            transform-origin: 100% 100%; /* 从右下开始变换 */
        }
    </style>

如果彈簧人物載入緩慢,可以將 js 檔案下載到本地

AngelaL博客

       本文是原創文章,採用CC BY-NC-SA 4.0協議,完整轉載請註明來自AngelaL博客

給TA打賞
共{{data.count}}人
人已打賞
二開美化

根據不同時間顯示不同的提醒

2025-2-26 22:21:31

二開美化

【B2】免外掛程式實現 FancyBox燈箱

2025-2-27 0:01:06

0 條回复 A文章作者 M管理员
    
    暫無討論,說說你的看法吧
個人中心
購物車
優惠劵
今日簽到
有新私信 私信列表
搜索