其他分享
首页 > 其他分享> > 添加萌萌的看板娘

添加萌萌的看板娘

作者:互联网

首先,申请js权限

然后,上传资源文件到博客园,或者引用我的博客中已有的js文件:L2Dwidget.0.min.js和L2Dwidget.min.js

最后,在页脚代码中添加代码:

<script type="text/javascript" charset="utf-8" src="https://blog-static.cnblogs.com/files/bingDiv/L2Dwidget.0.min.js"></script>
<script type="text/javascript" charset="utf-8" src="https://blog-static.cnblogs.com/files/bingDiv/L2Dwidget.min.js"></script>
<script type="text/javascript">
/*
小帅哥: https://unpkg.com/live2d-widget-model-chitose@1.0.5/assets/chitose.model.json
萌娘:https://unpkg.com/live2d-widget-model-shizuku@1.0.5/assets/shizuku.model.json
小可爱(女):https://unpkg.com/live2d-widget-model-koharu@1.0.5/assets/koharu.model.json
小可爱(男):https://unpkg.com/live2d-widget-model-haruto@1.0.5/assets/haruto.model.json
初音:https://unpkg.com/live2d-widget-model-miku@1.0.5/assets/miku.model.json
制服可爱:https://unpkg.com/live2d-widget-model-z16@1.0.5/assets/z16.model.json
*/
L2Dwidget.init({
  "model": {
    jsonPath: "https://unpkg.com/live2d-widget-model-shizuku@1.0.5/assets/shizuku.model.json",
    "scale": 1
  },
  "display": {
    "position": "left",
    "width": 150,
    "height": 300,
     "hOffset": 0,
    "vOffset": -20
  },
  "mobile": {
    "show": true,
    "scale": 0.5
  },
  "react": {
    "opacityDefault": 0.7,
    "opacityOnHover": 0.2
  }
});
</script>

保存下就可以在自己的博客主页看到了妹子。

上面注释的是几个人物模型,可以选择替换,jsonPath后面的内容

标签:看板娘,widget,1.0,萌萌,live2d,json,添加,https,model
来源: https://www.cnblogs.com/bingDiv/p/13925568.html