├── assets
├── flat-ui-icons-regular.eot
├── flat-ui-icons-regular.ttf
├── flat-ui-icons-regular.woff
├── autoload.js
├── waifu-tips.json
├── waifu.css
├── waifu-tips.js
└── flat-ui-icons-regular.svg
├── demo2-autoload.html
├── demo1-default.html
├── README.md
├── LICENSE
└── demo3-waifu-tips.html
/assets/flat-ui-icons-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fghrsh/live2d_demo/HEAD/assets/flat-ui-icons-regular.eot
--------------------------------------------------------------------------------
/assets/flat-ui-icons-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fghrsh/live2d_demo/HEAD/assets/flat-ui-icons-regular.ttf
--------------------------------------------------------------------------------
/assets/flat-ui-icons-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fghrsh/live2d_demo/HEAD/assets/flat-ui-icons-regular.woff
--------------------------------------------------------------------------------
/assets/autoload.js:
--------------------------------------------------------------------------------
1 | try {
2 | $("").attr({href: "assets/waifu.min.css?v=1.4.2", rel: "stylesheet", type: "text/css"}).appendTo('head');
3 | $('body').append('
');
4 | $.ajax({url: "assets/waifu-tips.min.js?v=1.4.2", dataType:"script", cache: true, success: function() {
5 | $.ajax({url: "assets/live2d.min.js?v=1.0.5", dataType:"script", cache: true, success: function() {
6 | /* 可直接修改部分参数 */
7 | live2d_settings['hitokotoAPI'] = "hitokoto.cn"; // 一言 API
8 | live2d_settings['modelId'] = 5; // 默认模型 ID
9 | live2d_settings['modelTexturesId'] = 1; // 默认材质 ID
10 | live2d_settings['modelStorage'] = false; // 不储存模型 ID
11 | /* 在 initModel 前添加 */
12 | initModel("assets/waifu-tips.json");
13 | }});
14 | }});
15 | } catch(err) { console.log("[Error] JQuery is not defined.") }
16 |
--------------------------------------------------------------------------------
/demo2-autoload.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Live2D 看板娘 v1.4 / Demo 2
6 |
7 |
8 |
9 | - 自动加载 autoload.js (一般网站引用推荐)
10 |
15 |
16 |
17 | <!DOCTYPE html>
18 | <html xmlns="http://www.w3.org/1999/xhtml">
19 | <head>
20 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
21 | <title>Live2D 看板娘 v1.4 / Demo 2</title>
22 | </head>
23 | <body style="font-family: 'Microsoft YaHei';">
24 | <h2><a href="https://www.fghrsh.net/post/123.html" style="color: #38A3DB; text-decoration: none;">Live2D 看板娘 v1.4</a> / Demo 2</h2>
25 | <h3> - 自动加载 autoload.js <span style="font-size: 12px;color: #666">(一般网站引用推荐)</span></h3>
26 | <ul>
27 | <li><a href="demo1-default.html" style="color: #38A3DB; text-decoration: none;" title="常规博客引用推荐">Demo 1 - 常规引用</a></li>
28 | <li><span title="一般网站引用推荐">Demo 2 (当前面页)</span></li>
29 | <li><a href="demo3-waifu-tips.html" style="color: #38A3DB; text-decoration: none;" title="博客园等网站引用推荐">Demo 3 - 内置 waifu-tips.json</a></li>
30 | </ul>
31 |
32 | <!-- waifu-tips.js 依赖 JQuery 库 -->
33 | <script src="assets/jquery.min.js?v=3.3.1"></script>
34 |
35 | <!-- 实现拖动效果,需引入 JQuery UI -->
36 | <script src="assets/jquery-ui.min.js?v=1.12.1"></script>
37 |
38 | <!-- 使用 aotuload.js 引入看板娘 -->
39 | <script src="assets/autoload.js?v=1.4.2"></script>
40 | </body>
41 | </html>
42 |
43 | # autoload.js
44 | try {
45 | $("<link>").attr({href: "assets/waifu.min.css?v=1.4.2", rel: "stylesheet", type: "text/css"}).appendTo('head');
46 | $('body').append('<div class="waifu"><div class="waifu-tips"></div><canvas id="live2d" class="live2d"></canvas><div class="waifu-tool"><span class="fui-home"></span> <span class="fui-chat"></span> <span class="fui-eye"></span> <span class="fui-user"></span> <span class="fui-photo"></span> <span class="fui-info-circle"></span> <span class="fui-cross"></span></div></div>');
47 | $.ajax({url: 'assets/waifu-tips.min.js?v=1.4.2',dataType:"script", cache: true, async: false});
48 | $.ajax({url: 'assets/live2d.min.js?v=1.0.5',dataType:"script", cache: true, async: false});
49 | /* 可直接修改部分参数 */
50 | live2d_settings['hitokotoAPI'] = 'hitokoto.cn'; // 一言 API
51 | live2d_settings['modelId'] = 5; // 默认模型 ID
52 | live2d_settings['modelTexturesId'] = 1; // 默认材质 ID
53 | live2d_settings['modelStorage'] = false; // 不储存模型 ID
54 | /* 在 initModel 前添加 */
55 | initModel('assets/waifu-tips.json');
56 | } catch(err) { console.log('[Error] JQuery is not defined.') }
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/assets/waifu-tips.json:
--------------------------------------------------------------------------------
1 | {
2 | "waifu": {
3 | "console_open_msg": ["哈哈,你打开了控制台,是想要看看我的秘密吗?"],
4 | "copy_message": ["你都复制了些什么呀,转载要记得加上出处哦"],
5 | "screenshot_message": ["照好了嘛,是不是很可爱呢?"],
6 | "hidden_message": ["我们还能再见面的吧…"],
7 | "load_rand_textures": ["我还没有其他衣服呢", "我的新衣服好看嘛"],
8 | "hour_tips": {
9 | "t5-7": ["早上好!一日之计在于晨,美好的一天就要开始了"],
10 | "t7-11": ["上午好!工作顺利嘛,不要久坐,多起来走动走动哦!"],
11 | "t11-14": ["中午了,工作了一个上午,现在是午餐时间!"],
12 | "t14-17": ["午后很容易犯困呢,今天的运动目标完成了吗?"],
13 | "t17-19": ["傍晚了!窗外夕阳的景色很美丽呢,最美不过夕阳红~"],
14 | "t19-21": ["晚上好,今天过得怎么样?"],
15 | "t21-23": ["已经这么晚了呀,早点休息吧,晚安~"],
16 | "t23-5": ["你是夜猫子呀?这么晚还不睡觉,明天起的来嘛"],
17 | "default": ["嗨~ 快来逗我玩吧!"]
18 | },
19 | "referrer_message": {
20 | "localhost": ["欢迎阅读『", "』", " - "],
21 | "baidu": ["Hello! 来自 百度搜索 的朋友
你是搜索 ", " 找到的我吗?"],
22 | "so": ["Hello! 来自 360搜索 的朋友
你是搜索 ", " 找到的我吗?"],
23 | "google": ["Hello! 来自 谷歌搜索 的朋友
欢迎阅读『", "』", " - "],
24 | "default": ["Hello! 来自 ", " 的朋友"],
25 | "none": ["欢迎阅读『", "』", " - "]
26 | },
27 | "referrer_hostname": {
28 | "example.com": ["示例网站"],
29 | "www.fghrsh.net": ["FGHRSH 的博客"]
30 | },
31 | "model_message": {
32 | "1": ["来自 Potion Maker 的 Pio 酱 ~"],
33 | "2": ["来自 Potion Maker 的 Tia 酱 ~"]
34 | },
35 | "hitokoto_api_message": {
36 | "lwl12.com": ["这句一言来自 『{source}』", ",是 {creator} 投稿的", "。"],
37 | "fghrsh.net": ["这句一言出处是 『{source}』,是 FGHRSH 在 {date} 收藏的!"],
38 | "jinrishici.com": ["这句诗词出自 《{title}》,是 {dynasty}诗人 {author} 创作的!"],
39 | "hitokoto.cn": ["这句一言来自 『{source}』,是 {creator} 在 hitokoto.cn 投稿的。"]
40 | }
41 | },
42 | "mouseover": [
43 | { "selector": ".container a[href^='http']", "text": ["要看看 {text} 么?"] },
44 | { "selector": ".fui-home", "text": ["点击前往首页,想回到上一页可以使用浏览器的后退功能哦"] },
45 | { "selector": ".fui-chat", "text": ["一言一语,一颦一笑。一字一句,一颗赛艇。"] },
46 | { "selector": ".fui-eye", "text": ["嗯··· 要切换 看板娘 吗?"] },
47 | { "selector": ".fui-user", "text": ["喜欢换装 Play 吗?"] },
48 | { "selector": ".fui-photo", "text": ["要拍张纪念照片吗?"] },
49 | { "selector": ".fui-info-circle", "text": ["这里有关于我的信息呢"] },
50 | { "selector": ".fui-cross", "text": ["你不喜欢我了吗..."] },
51 | { "selector": "#tor_show", "text": ["翻页比较麻烦吗,点击可以显示这篇文章的目录呢"] },
52 | { "selector": "#comment_go", "text": ["想要去评论些什么吗?"] },
53 | { "selector": "#night_mode", "text": ["深夜时要爱护眼睛呀"] },
54 | { "selector": "#qrcode", "text": ["手机扫一下就能继续看,很方便呢"] },
55 | { "selector": ".comment_reply", "text": ["要吐槽些什么呢"] },
56 | { "selector": "#back-to-top", "text": ["回到开始的地方吧"] },
57 | { "selector": "#author", "text": ["该怎么称呼你呢"] },
58 | { "selector": "#mail", "text": ["留下你的邮箱,不然就是无头像人士了"] },
59 | { "selector": "#url", "text": ["你的家在哪里呢,好让我去参观参观"] },
60 | { "selector": "#textarea", "text": ["认真填写哦,垃圾评论是禁止事项"] },
61 | { "selector": ".OwO-logo", "text": ["要插入一个表情吗"] },
62 | { "selector": "#csubmit", "text": ["要[提交]^(Commit)了吗,首次评论需要审核,请耐心等待~"] },
63 | { "selector": ".ImageBox", "text": ["点击图片可以放大呢"] },
64 | { "selector": "input[name=s]", "text": ["找不到想看的内容?搜索看看吧"] },
65 | { "selector": ".previous", "text": ["去上一页看看吧"] },
66 | { "selector": ".next", "text": ["去下一页看看吧"] },
67 | { "selector": ".dropdown-toggle", "text": ["这里是菜单"] },
68 | { "selector": "c-player a.play-icon", "text": ["想要听点音乐吗"] },
69 | { "selector": "c-player div.time", "text": ["在这里可以调整播放进度呢"] },
70 | { "selector": "c-player div.volume", "text": ["在这里可以调整音量呢"] },
71 | { "selector": "c-player div.list-button", "text": ["播放列表里都有什么呢"] },
72 | { "selector": "c-player div.lyric-button", "text": ["有歌词的话就能跟着一起唱呢"] },
73 | { "selector": ".waifu #live2d", "text": ["干嘛呢你,快把手拿开", "鼠…鼠标放错地方了!"] }
74 | ],
75 | "click": [
76 | {
77 | "selector": ".waifu #live2d",
78 | "text": [
79 | "是…是不小心碰到了吧",
80 | "萝莉控是什么呀",
81 | "你看到我的小熊了吗",
82 | "再摸的话我可要报警了!⌇●﹏●⌇",
83 | "110吗,这里有个变态一直在摸我(ó﹏ò。)"
84 | ]
85 | }
86 | ],
87 | "seasons": [
88 | { "date": "01/01", "text": ["元旦了呢,新的一年又开始了,今年是{year}年~"] },
89 | { "date": "02/14", "text": ["又是一年情人节,{year}年找到对象了嘛~"] },
90 | { "date": "03/08", "text": ["今天是妇女节!"] },
91 | { "date": "03/12", "text": ["今天是植树节,要保护环境呀"] },
92 | { "date": "04/01", "text": ["悄悄告诉你一个秘密~今天是愚人节,不要被骗了哦~"] },
93 | { "date": "05/01", "text": ["今天是五一劳动节,计划好假期去哪里了吗~"] },
94 | { "date": "06/01", "text": ["儿童节了呢,快活的时光总是短暂,要是永远长不大该多好啊…"] },
95 | { "date": "09/03", "text": ["中国人民抗日战争胜利纪念日,铭记历史、缅怀先烈、珍爱和平、开创未来。"] },
96 | { "date": "09/10", "text": ["教师节,在学校要给老师问声好呀~"] },
97 | { "date": "10/01", "text": ["国庆节,新中国已经成立69年了呢"] },
98 | { "date": "11/05-11/12", "text": ["今年的双十一是和谁一起过的呢~"] },
99 | { "date": "12/20-12/31", "text": ["这几天是圣诞节,主人肯定又去剁手买买买了~"] }
100 | ]
101 | }
--------------------------------------------------------------------------------
/demo1-default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Live2D 看板娘 v1.4 / Demo 1
6 |
7 |
8 |
9 |
10 | - 常规引用 (常规博客引用推荐)
11 |
16 |
17 |
18 | <!DOCTYPE html>
19 | <html xmlns="http://www.w3.org/1999/xhtml">
20 | <head>
21 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
22 | <title>Live2D 看板娘 v1.4 / Demo 1</title>
23 | <link rel="stylesheet" type="text/css" href="assets/waifu.min.css?v=1.4.2"/>
24 | </head>
25 | <body style="font-family: 'Microsoft YaHei';">
26 | <h2><a href="https://www.fghrsh.net/post/123.html" style="color: #38A3DB; text-decoration: none;">Live2D 看板娘 v1.4</a> / Demo 1</h2>
27 | <h3> - 常规引用 <span style="font-size: 12px;color: #666">(常规博客引用推荐)</span></h3>
28 | <ul>
29 | <li><span title="常规博客引用推荐">Demo 1 (当前面页)</span></li>
30 | <li><a href="demo2-autoload.html" style="color: #38A3DB; text-decoration: none;" title="一般网站引用推荐">Demo 2 - 自动加载 autoload.js</a></li>
31 | <li><a href="demo3-waifu-tips.html" style="color: #38A3DB; text-decoration: none;" title="博客园等网站引用推荐">Demo 3 - 内置 waifu-tips.json</a></li>
32 | </ul>
33 |
34 | <!-- waifu-tips.js 依赖 JQuery 库 -->
35 | <script src="assets/jquery.min.js?v=3.3.1"></script>
36 |
37 | <!-- 实现拖动效果,需引入 JQuery UI -->
38 | <script src="assets/jquery-ui.min.js?v=1.12.1"></script>
39 |
40 | <div class="waifu">
41 | <div class="waifu-tips"></div>
42 | <canvas id="live2d" class="live2d"></canvas>
43 | <div class="waifu-tool">
44 | <span class="fui-home"></span>
45 | <span class="fui-chat"></span>
46 | <span class="fui-eye"></span>
47 | <span class="fui-user"></span>
48 | <span class="fui-photo"></span>
49 | <span class="fui-info-circle"></span>
50 | <span class="fui-cross"></span>
51 | </div>
52 | </div>
53 |
54 | <script src="assets/waifu-tips.min.js?v=1.4.2"></script>
55 | <script src="assets/live2d.min.js?v=1.0.5"></script>
56 | <script type="text/javascript">
57 | /* 可直接修改部分参数 */
58 | live2d_settings['modelId'] = 1; // 默认模型 ID
59 | live2d_settings['modelTexturesId'] = 87; // 默认材质 ID
60 | live2d_settings['modelStorage'] = false; // 不储存模型 ID
61 | live2d_settings['canCloseLive2d'] = false; // 隐藏 关闭看板娘 按钮
62 | live2d_settings['canTurnToHomePage'] = false; // 隐藏 返回首页 按钮
63 | live2d_settings['waifuSize'] = '600x535'; // 看板娘大小
64 | live2d_settings['waifuTipsSize'] = '570x150'; // 提示框大小
65 | live2d_settings['waifuFontSize'] = '30px'; // 提示框字体
66 | live2d_settings['waifuToolFont'] = '36px'; // 工具栏字体
67 | live2d_settings['waifuToolLine'] = '50px'; // 工具栏行高
68 | live2d_settings['waifuToolTop'] = '-60px'; // 工具栏顶部边距
69 | live2d_settings['waifuDraggable'] = 'axis-x'; // 拖拽样式
70 | /* 在 initModel 前添加 */
71 | initModel("assets/waifu-tips.json?v=1.4.2")
72 | </script>
73 | </body>
74 | </html>
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/assets/waifu.css:
--------------------------------------------------------------------------------
1 | .waifu {
2 | position: fixed;
3 | bottom: 0;
4 | z-index: 1;
5 | font-size: 0;
6 | -webkit-transform: translateY(3px);
7 | transform: translateY(3px);
8 | }
9 | .waifu:hover {
10 | -webkit-transform: translateY(0);
11 | transform: translateY(0);
12 | }
13 | .waifu-tips {
14 | opacity: 0;
15 | margin: -20px 20px;
16 | padding: 5px 10px;
17 | border: 1px solid rgba(224, 186, 140, 0.62);
18 | border-radius: 12px;
19 | background-color: rgba(236, 217, 188, 0.5);
20 | box-shadow: 0 3px 15px 2px rgba(191, 158, 118, 0.2);
21 | text-overflow: ellipsis;
22 | overflow: hidden;
23 | position: absolute;
24 | animation-delay: 5s;
25 | animation-duration: 50s;
26 | animation-iteration-count: infinite;
27 | animation-name: shake;
28 | animation-timing-function: ease-in-out;
29 | }
30 | .waifu-tool {
31 | display: none;
32 | color: #aaa;
33 | top: 50px;
34 | right: 10px;
35 | position: absolute;
36 | }
37 | .waifu:hover .waifu-tool {
38 | display: block;
39 | }
40 | .waifu-tool span {
41 | display: block;
42 | cursor: pointer;
43 | color: #5b6c7d;
44 | transition: 0.2s;
45 | }
46 | .waifu-tool span:hover {
47 | color: #34495e;
48 | }
49 | .waifu #live2d{
50 | position: relative;
51 | }
52 |
53 | @keyframes shake {
54 | 2% {
55 | transform: translate(0.5px, -1.5px) rotate(-0.5deg);
56 | }
57 |
58 | 4% {
59 | transform: translate(0.5px, 1.5px) rotate(1.5deg);
60 | }
61 |
62 | 6% {
63 | transform: translate(1.5px, 1.5px) rotate(1.5deg);
64 | }
65 |
66 | 8% {
67 | transform: translate(2.5px, 1.5px) rotate(0.5deg);
68 | }
69 |
70 | 10% {
71 | transform: translate(0.5px, 2.5px) rotate(0.5deg);
72 | }
73 |
74 | 12% {
75 | transform: translate(1.5px, 1.5px) rotate(0.5deg);
76 | }
77 |
78 | 14% {
79 | transform: translate(0.5px, 0.5px) rotate(0.5deg);
80 | }
81 |
82 | 16% {
83 | transform: translate(-1.5px, -0.5px) rotate(1.5deg);
84 | }
85 |
86 | 18% {
87 | transform: translate(0.5px, 0.5px) rotate(1.5deg);
88 | }
89 |
90 | 20% {
91 | transform: translate(2.5px, 2.5px) rotate(1.5deg);
92 | }
93 |
94 | 22% {
95 | transform: translate(0.5px, -1.5px) rotate(1.5deg);
96 | }
97 |
98 | 24% {
99 | transform: translate(-1.5px, 1.5px) rotate(-0.5deg);
100 | }
101 |
102 | 26% {
103 | transform: translate(1.5px, 0.5px) rotate(1.5deg);
104 | }
105 |
106 | 28% {
107 | transform: translate(-0.5px, -0.5px) rotate(-0.5deg);
108 | }
109 |
110 | 30% {
111 | transform: translate(1.5px, -0.5px) rotate(-0.5deg);
112 | }
113 |
114 | 32% {
115 | transform: translate(2.5px, -1.5px) rotate(1.5deg);
116 | }
117 |
118 | 34% {
119 | transform: translate(2.5px, 2.5px) rotate(-0.5deg);
120 | }
121 |
122 | 36% {
123 | transform: translate(0.5px, -1.5px) rotate(0.5deg);
124 | }
125 |
126 | 38% {
127 | transform: translate(2.5px, -0.5px) rotate(-0.5deg);
128 | }
129 |
130 | 40% {
131 | transform: translate(-0.5px, 2.5px) rotate(0.5deg);
132 | }
133 |
134 | 42% {
135 | transform: translate(-1.5px, 2.5px) rotate(0.5deg);
136 | }
137 |
138 | 44% {
139 | transform: translate(-1.5px, 1.5px) rotate(0.5deg);
140 | }
141 |
142 | 46% {
143 | transform: translate(1.5px, -0.5px) rotate(-0.5deg);
144 | }
145 |
146 | 48% {
147 | transform: translate(2.5px, -0.5px) rotate(0.5deg);
148 | }
149 |
150 | 50% {
151 | transform: translate(-1.5px, 1.5px) rotate(0.5deg);
152 | }
153 |
154 | 52% {
155 | transform: translate(-0.5px, 1.5px) rotate(0.5deg);
156 | }
157 |
158 | 54% {
159 | transform: translate(-1.5px, 1.5px) rotate(0.5deg);
160 | }
161 |
162 | 56% {
163 | transform: translate(0.5px, 2.5px) rotate(1.5deg);
164 | }
165 |
166 | 58% {
167 | transform: translate(2.5px, 2.5px) rotate(0.5deg);
168 | }
169 |
170 | 60% {
171 | transform: translate(2.5px, -1.5px) rotate(1.5deg);
172 | }
173 |
174 | 62% {
175 | transform: translate(-1.5px, 0.5px) rotate(1.5deg);
176 | }
177 |
178 | 64% {
179 | transform: translate(-1.5px, 1.5px) rotate(1.5deg);
180 | }
181 |
182 | 66% {
183 | transform: translate(0.5px, 2.5px) rotate(1.5deg);
184 | }
185 |
186 | 68% {
187 | transform: translate(2.5px, -1.5px) rotate(1.5deg);
188 | }
189 |
190 | 70% {
191 | transform: translate(2.5px, 2.5px) rotate(0.5deg);
192 | }
193 |
194 | 72% {
195 | transform: translate(-0.5px, -1.5px) rotate(1.5deg);
196 | }
197 |
198 | 74% {
199 | transform: translate(-1.5px, 2.5px) rotate(1.5deg);
200 | }
201 |
202 | 76% {
203 | transform: translate(-1.5px, 2.5px) rotate(1.5deg);
204 | }
205 |
206 | 78% {
207 | transform: translate(-1.5px, 2.5px) rotate(0.5deg);
208 | }
209 |
210 | 80% {
211 | transform: translate(-1.5px, 0.5px) rotate(-0.5deg);
212 | }
213 |
214 | 82% {
215 | transform: translate(-1.5px, 0.5px) rotate(-0.5deg);
216 | }
217 |
218 | 84% {
219 | transform: translate(-0.5px, 0.5px) rotate(1.5deg);
220 | }
221 |
222 | 86% {
223 | transform: translate(2.5px, 1.5px) rotate(0.5deg);
224 | }
225 |
226 | 88% {
227 | transform: translate(-1.5px, 0.5px) rotate(1.5deg);
228 | }
229 |
230 | 90% {
231 | transform: translate(-1.5px, -0.5px) rotate(-0.5deg);
232 | }
233 |
234 | 92% {
235 | transform: translate(-1.5px, -1.5px) rotate(1.5deg);
236 | }
237 |
238 | 94% {
239 | transform: translate(0.5px, 0.5px) rotate(-0.5deg);
240 | }
241 |
242 | 96% {
243 | transform: translate(2.5px, -0.5px) rotate(-0.5deg);
244 | }
245 |
246 | 98% {
247 | transform: translate(-1.5px, -1.5px) rotate(-0.5deg);
248 | }
249 |
250 | 0%, 100% {
251 | transform: translate(0, 0) rotate(0);
252 | }
253 | }
254 | @font-face {
255 | font-family: 'Flat-UI-Icons';
256 | src: url('flat-ui-icons-regular.eot');
257 | src: url('flat-ui-icons-regular.eot?#iefix') format('embedded-opentype'), url('flat-ui-icons-regular.woff') format('woff'), url('flat-ui-icons-regular.ttf') format('truetype'), url('flat-ui-icons-regular.svg#flat-ui-icons-regular') format('svg');
258 | }
259 | [class^="fui-"],
260 | [class*="fui-"] {
261 | font-family: 'Flat-UI-Icons';
262 | speak: none;
263 | font-style: normal;
264 | font-weight: normal;
265 | font-variant: normal;
266 | text-transform: none;
267 | -webkit-font-smoothing: antialiased;
268 | -moz-osx-font-smoothing: grayscale;
269 | }
270 | .fui-cross:before {
271 | content: "\e609";
272 | }
273 | .fui-info-circle:before {
274 | content: "\e60f";
275 | }
276 | .fui-photo:before {
277 | content: "\e62a";
278 | }
279 | .fui-eye:before {
280 | content: "\e62c";
281 | }
282 | .fui-chat:before {
283 | content: "\e62d";
284 | }
285 | .fui-home:before {
286 | content: "\e62e";
287 | }
288 | .fui-user:before {
289 | content: "\e631";
290 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Live2D demo
2 |
3 | Live2D 看板娘插件 (https://www.fghrsh.net/post/123.html) 的前端 HTML 源码
4 |
5 | ### 特性
6 |
7 | - 基于 API 加载模型,支持 定制 提示语
8 | - 增加 参数设置 一键定制看板娘,易用性++
9 | - 增加 看板娘样式设置,可直接设置宽高度等
10 | - 支持多种一言接口,基于 JQuery UI 实现拖拽
11 |
12 | ## 使用
13 |
14 | ### 目录结构
15 |
16 | ```shell
17 | │ demo1-default.html // 常规引用 Demo
18 | │ demo2-autoload.html // autoload.js Demo
19 | │ demo3-waifu-tips.html // 内置 waifu-tips Demo
20 | │
21 | └─assets
22 | autoload.js // 自动异步加载
23 | flat-ui-icons-regular.eot // Flat UI 字体
24 | flat-ui-icons-regular.svg // Flat UI 字体
25 | flat-ui-icons-regular.ttf // Flat UI 字体
26 | flat-ui-icons-regular.woff // Flat UI 字体
27 | live2d.js // Live2D 核心
28 | waifu-tips.js // Live2D 看板娘 扩展
29 | waifu-tips.json // Live2D 看板娘 提示语
30 | waifu.css // Live2D 看板娘 样式表
31 | ```
32 |
33 | ### 食用方法
34 |
35 | - 依赖类库
36 | - JQuery (`waifu-tips.js`)
37 | - JQuery UI (仅实现 *拖拽效果* 需要)
38 |
39 | - 常规方式引入
40 |
41 | 1. 在 `` 前引入 `waifu.css` 样式表
42 | 2. 在 `
54 |
55 | · · · · · ·
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
79 | ` 前引入 `waifu-tips.js` 和 `live2d.js`
43 | 3. 在 `` 前插入 初始化 JS,可在 初始化前 设置参数
44 |
45 | ```html
46 |
47 |