为自己的博客园博客添加L2Dwidget.js看板娘
如果是博客园,直接在设置-->页脚 HTML 代码,加上下面代码:
1 <!-- L2Dwidget.js L2D网页动画人物 --> 2 <script src="https://eqcn.ajz.miesnfu.com/wp-content/plugins/wp-3d-pony/live2dw/lib/L2Dwidget.min.js"></script> 3 <script> 4 L2Dwidget.init({ 5 "model": { "jsonPath":"https://unpkg.com/live2d-widget-model-shizuku@1.0.5/assets/shizuku.model.json", "scale": 1, "hHeadPos":0.5, "vHeadPos":0.618 }, 6 "display": { "position": "right", "width": 100, "height": 200, "hOffset": 0, "vOffset": 0 }, 7 "mobile": { "show": true, "scale": 0.5 }, 8 "react": { "opacityDefault": 0.7, "opacityOnHover": 0.2 } 9 }); 10 </script> 11 <!-- 12 其他可选的模型: 13 小帅哥: https://unpkg.com/live2d-widget-model-chitose@1.0.5/assets/chitose.model.json 14 萌娘:https://unpkg.com/live2d-widget-model-shizuku@1.0.5/assets/shizuku.model.json 15 小可爱(女):https://unpkg.com/live2d-widget-model-koharu@1.0.5/assets/koharu.model.json 16 小可爱(男):https://unpkg.com/live2d-widget-model-haruto@1.0.5/assets/haruto.model.json 17 初音:https://unpkg.com/live2d-widget-model-miku@1.0.5/assets/miku.model.json 18 -->
如下图添加代码:
// 上面的代码中:position 是调整方向的;"width": 100, "height": 200 :是调整2D图大小的,着看个人喜好;
"display": { "position": "right", "width": 100, "height": 200, "hOffset": 0, "vOffset": 0 },
样式根据自己选择,效果如本博客,选用的初音0.0