直接粘贴以下代码(静态网页在_config.yml中添加,博客园在页尾html中加):linkrel=stylesheethref=https://cdn.jsdelivr.net/gh/Dreamer-Paul/Pio@2.4/static/pio.min.css/scriptasync=asyncsrc=https://c...
直接粘贴以下代码(静态网页在_config.yml中添加,博客园在页尾html中加):
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/Dreamer-Paul/Pio@2.4/static/pio.min.css"
/>
<script
async="async"
src="https://cdn.jsdelivr.net/combine/gh/Dreamer-Paul/Pio@2.4/static/l2d.min.js,gh/Dreamer-Paul/Pio@2.4/static/pio.min.js"
onl oad='
let pio_container = document.createElement("div");
pio_container.classList.add("pio-container");
pio_container.classList.add("right");
pio_container.style.bottom = "-2rem";
pio_container.style.zIndex = "1";
document.body.insertAdjacentElement("beforeend", pio_container);
let pio_action = document.createElement("div");
pio_action.classList.add("pio-action");
pio_container.insertAdjacentElement("beforeend", pio_action);
let pio_canvas = document.createElement("canvas");
pio_canvas.id = "pio";
pio_canvas.style.width = "14rem";
pio_canvas.width = "600";
pio_canvas.height = "800";
pio_container.insertAdjacentElement("beforeend", pio_canvas);
let pio = new Paul_Pio({
"mode": "fixed",
"hidden": true,
"content": {
"link": ["https:\/\/AbnerHung.github.io"],
"skin": ["要换成我的朋友吗?", "让她放个假吧~"],
"hidden": true,
},
"model": [
"https:\/\/cdn.jsdelivr.net/gh/xiaoski/live2d_models_collection/mikoto/mikoto.model.json",
"https:\/\/cdn.jsdelivr.net/gh/imuncle/live2d/model/tororo/tororo.model.json",
"https:\/\/cdn.jsdelivr.net/gh/imuncle/live2d/model/platelet-2/model.json",
"https:\/\/cdn.jsdelivr.net/gh/imuncle/live2d/model/xiaomai/xiaomai.model.json",
"https:\/\/cdn.jsdelivr.net/gh/imuncle/live2d/model/mashiro/seifuku.model.json",
"https:\/\/cdn.jsdelivr.net/gh/imuncle/live2d/model/Violet/14.json",
"https:\/\/cdn.jsdelivr.net/gh/xiaoski/live2d_models_collection/Kobayaxi/Kobayaxi.model.json",
"https:\/\/cdn.jsdelivr.net/gh/xiaoski/live2d_models_collection/uiharu/uiharu.model.json"
]
});'
></script>
模型以及js代码来源于网络~
沃梦达教程
本文标题为:用html代码给网页加个live2d看板娘吧
基础教程推荐
猜你喜欢
- vue keep-alive 2023-10-08
- Ajax和$.ajax使用实例详解(推荐) 2023-01-26
- Ajax 设置Access-Control-Allow-Origin实现跨域访问 2023-01-26
- 巧用ajax请求服务器加载数据列表时提示loading的方法 2023-02-01
- HTML常用标签之表格单元格合并 2022-08-25
- 比较Ajax的三种实现及JSON解析 2022-10-18
- 关于extjs:动态管理Ext.app.Application.controllers 2022-09-15
- vue-cli脚手架安装 2023-10-08
- Vue里ProxyTable配置不生效 2023-10-08
- android-SQLite代码段功能实现未在TextView中将文本格式设置为HTML 2023-10-27