@melt-js/comps-vue2 2026.11.5 → 2026.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -36
- package/hel_dist/css/chunk-ad8df0e6.e2ca7fbd.css +1 -0
- package/hel_dist/hel-meta.json +23 -18
- package/hel_dist/img/clouds_back.d1a6739b.jpg +0 -0
- package/hel_dist/img/clouds_front.b35c0bd4.jpg +0 -0
- package/hel_dist/img/clouds_left.4f5664b9.jpg +0 -0
- package/hel_dist/img/clouds_right.0e9ec637.jpg +0 -0
- package/hel_dist/img/clouds_top.31039c75.jpg +0 -0
- package/hel_dist/index.html +1 -1
- package/hel_dist/js/{app~493df0b3.f16034ff.js → app~493df0b3.677583d3.js} +2 -2
- package/hel_dist/js/{app~493df0b3.f16034ff.js.map → app~493df0b3.677583d3.js.map} +1 -1
- package/hel_dist/js/chunk-ad8df0e6.39491564.js +2 -0
- package/hel_dist/js/chunk-ad8df0e6.39491564.js.map +1 -0
- package/package.json +6 -1
- package/src/components/BirdSvg/index.vue +101 -0
- package/src/components/BirdSvg/source/README.md +17 -0
- package/src/components/BirdSvg/source/index.html +65 -0
- package/src/components/BirdSvg/source/style.css +284 -0
- package/src/components/BirdSvg/style.css +194 -0
- package/src/components/Butterflies3d/assets/clouds_back.jpg +0 -0
- package/src/components/Butterflies3d/assets/clouds_front.jpg +0 -0
- package/src/components/Butterflies3d/assets/clouds_left.jpg +0 -0
- package/src/components/Butterflies3d/assets/clouds_right.jpg +0 -0
- package/src/components/Butterflies3d/assets/clouds_top.jpg +0 -0
- package/src/components/Butterflies3d/assets/wing-pattern.gif +0 -0
- package/src/components/Butterflies3d/index.vue +245 -0
- package/src/components/Butterflies3d/source/README.md +17 -0
- package/src/components/Butterflies3d/source/index.html +305 -0
- package/src/components/Butterflies3d/source/reset.css +1 -0
- package/src/components/Butterflies3d/source/style.css +831 -0
- package/src/components/Butterflies3d/style.css +295 -0
- package/src/components/CatFace/index.vue +128 -0
- package/src/components/CatFace/source/README.md +19 -0
- package/src/components/CatFace/source/cat.less +374 -0
- package/src/components/CatFace/source/index.html +92 -0
- package/src/components/CatFace/style.css +394 -0
- package/src/components/FrogExpressions/index.vue +94 -0
- package/src/components/FrogExpressions/source/README.md +17 -0
- package/src/components/FrogExpressions/source/demo.css +45 -0
- package/src/components/FrogExpressions/source/frog.html +375 -0
- package/src/components/FrogExpressions/source/style.css +1555 -0
- package/src/components/FrogExpressions/style.css +1109 -0
- package/src/components/WhaleFollow/index.vue +276 -0
- package/src/components/WhaleFollow/source/README.md +19 -0
- package/src/components/WhaleFollow/source/README.txt +4 -0
- package/src/components/WhaleFollow/source/index.html +29 -0
- package/src/components/WhaleFollow/source/index.js +106 -0
- package/src/components/WhaleFollow/source/license.txt +9 -0
- package/src/components/WhaleFollow/source/style.css +2 -0
- package/src/components/WhaleFollow/style.css +36 -0
- package/src/components/WhaleFollow/whaleData.js +277 -0
- package/src/components/index.js +10 -0
- package/src/entrance/libTypes.ts +15 -0
- package/hel_dist/css/chunk-e3b20906.1a16268b.css +0 -1
- package/hel_dist/js/chunk-e3b20906.e04b1c48.js +0 -2
- package/hel_dist/js/chunk-e3b20906.e04b1c48.js.map +0 -1
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 纯 CSS 小猫笑脸
|
|
3
|
+
*
|
|
4
|
+
* 抽取自 night-demo-codepen-gulp-2019 的
|
|
5
|
+
* gulp3-jquery-melt-ie8-mpa/_melt/static/css/animals/cat.less(由 _animal.less 汇总),
|
|
6
|
+
* 原始文件见同目录 source/cat.less。相对原文件的改动只有这些:
|
|
7
|
+
* - LESS 嵌套展开成平铺 CSS,类名前缀从 .catCartoon 改为组件根节点 .cat-face
|
|
8
|
+
* - 去掉 -ms- / -moz- / -o- 前缀、未使用的 .ceshi 规则、.yan_right 上不可见的红底
|
|
9
|
+
* - 组件根节点负责居中、背景、裁剪与缩放;不再使用原页面的 body 背景与 top:50px 偏移
|
|
10
|
+
* - 宿主如果启用了全局 border-box,这里显式恢复组件内的 content-box,
|
|
11
|
+
* 保证 400 / 340 / 100 这些像素尺寸与原始效果一致
|
|
12
|
+
* - 新增 .is-active 变体:active prop 可以把 hover 表情锁定为打开状态
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/* -------------------------------------------------------------------- 舞台 */
|
|
16
|
+
|
|
17
|
+
.cat-face {
|
|
18
|
+
position: relative;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
min-height: 420px;
|
|
26
|
+
padding: 20px 8px 28px;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
background: #f6f7a7;
|
|
29
|
+
user-select: none;
|
|
30
|
+
-webkit-tap-highlight-color: transparent;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.cat-face *,
|
|
34
|
+
.cat-face *::before,
|
|
35
|
+
.cat-face *::after {
|
|
36
|
+
box-sizing: content-box;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.cat-face .mao_box {
|
|
40
|
+
position: relative;
|
|
41
|
+
flex: none;
|
|
42
|
+
/* scale prop 通过 --cat-scale 注入;不传时由下面的窄屏媒体查询决定 */
|
|
43
|
+
transform: scale(var(--cat-scale, 1));
|
|
44
|
+
transform-origin: 50% 50%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.cat-face .mao {
|
|
48
|
+
margin: 0 auto;
|
|
49
|
+
width: 400px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.cat-face .mao_head {
|
|
53
|
+
margin: 0 auto;
|
|
54
|
+
width: 400px;
|
|
55
|
+
height: 340px;
|
|
56
|
+
background: #f6f7f2;
|
|
57
|
+
position: relative;
|
|
58
|
+
border-radius: 50% 50% 35% 35%;
|
|
59
|
+
border: solid 2px #2e2e2e;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
z-index: 10;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.cat-face .huawen {
|
|
65
|
+
position: absolute;
|
|
66
|
+
height: 160px;
|
|
67
|
+
width: 180px;
|
|
68
|
+
background: #8d8d8d;
|
|
69
|
+
left: 110px;
|
|
70
|
+
border-radius: 0% 0% 50% 50%;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cat-face .huawen > div:first-child {
|
|
75
|
+
height: 160px;
|
|
76
|
+
width: 90px;
|
|
77
|
+
background: #f0ac6b;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* -------------------------------------------------------------------- 耳朵 */
|
|
81
|
+
|
|
82
|
+
.cat-face .erduo {
|
|
83
|
+
width: 374px;
|
|
84
|
+
height: 120px;
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: -6px;
|
|
87
|
+
left: 50%;
|
|
88
|
+
margin-left: -187px;
|
|
89
|
+
border-radius: 0% 0% 0% 0%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* 左耳 */
|
|
93
|
+
.cat-face .erduo > div:first-child {
|
|
94
|
+
height: 200px;
|
|
95
|
+
width: 160px;
|
|
96
|
+
border: 2px solid #2e2e2e;
|
|
97
|
+
background: #f3f3f3;
|
|
98
|
+
transform: rotate(-15deg);
|
|
99
|
+
border-radius: 4% 80% 0% 50%;
|
|
100
|
+
position: absolute;
|
|
101
|
+
left: -20px;
|
|
102
|
+
top: 0px;
|
|
103
|
+
transition: transform 1s, left 1s;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* 右耳 */
|
|
107
|
+
.cat-face .erduo > div:last-child {
|
|
108
|
+
height: 180px;
|
|
109
|
+
width: 160px;
|
|
110
|
+
border: 2px solid #2e2e2e;
|
|
111
|
+
background: #f3f3f3;
|
|
112
|
+
transform: rotate(15deg);
|
|
113
|
+
border-radius: 80% 4% 50% 0%;
|
|
114
|
+
position: absolute;
|
|
115
|
+
right: -20px;
|
|
116
|
+
top: 0px;
|
|
117
|
+
transition: transform 1s, right 1s;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* 悬停 / active:两只耳朵立起来 */
|
|
121
|
+
.cat-face .mao:hover .erduo > div:first-child,
|
|
122
|
+
.cat-face.is-active .mao .erduo > div:first-child {
|
|
123
|
+
left: -10px;
|
|
124
|
+
transform: rotate(0deg);
|
|
125
|
+
border-radius: 4% 80% 0% 60%;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.cat-face .mao:hover .erduo > div:last-child,
|
|
129
|
+
.cat-face.is-active .mao .erduo > div:last-child {
|
|
130
|
+
right: -10px;
|
|
131
|
+
transform: rotate(0deg);
|
|
132
|
+
border-radius: 80% 4% 60% 0%;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* -------------------------------------------------------------------- 眼睛 */
|
|
136
|
+
|
|
137
|
+
.cat-face .yanjing {
|
|
138
|
+
height: 60px;
|
|
139
|
+
width: 300px;
|
|
140
|
+
position: absolute;
|
|
141
|
+
top: 200px;
|
|
142
|
+
z-index: 20;
|
|
143
|
+
left: 50%;
|
|
144
|
+
margin-left: -150px;
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* 左眼 */
|
|
149
|
+
.cat-face .yanquan {
|
|
150
|
+
height: 100px;
|
|
151
|
+
width: 100px;
|
|
152
|
+
border: 2px solid #2e2e2e;
|
|
153
|
+
border-radius: 50% 50% 50% 50%;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
position: absolute;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* 左眼珠子 */
|
|
159
|
+
.cat-face .yanquan > div:first-child {
|
|
160
|
+
height: 100px;
|
|
161
|
+
width: 30px;
|
|
162
|
+
background-color: #2e2e2e;
|
|
163
|
+
margin-left: 35px;
|
|
164
|
+
transition: all 1s;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* 悬停 / active:瞳孔放大 */
|
|
168
|
+
.cat-face .mao:hover .yanquan > div:first-child,
|
|
169
|
+
.cat-face.is-active .mao .yanquan > div:first-child {
|
|
170
|
+
width: 40px;
|
|
171
|
+
margin-left: 30px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* 眼皮:默认盖住上半只眼睛 */
|
|
175
|
+
.cat-face .yanquan_hedding {
|
|
176
|
+
height: 100px;
|
|
177
|
+
width: 180px;
|
|
178
|
+
border-top: 2px solid #2e2e2e;
|
|
179
|
+
border-radius: 50% 50% 50% 50%;
|
|
180
|
+
background: #f6f7f2;
|
|
181
|
+
margin-top: 50px;
|
|
182
|
+
margin-left: -40px;
|
|
183
|
+
position: absolute;
|
|
184
|
+
transition: margin-top 1s;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* 腮红 */
|
|
188
|
+
.cat-face .hong {
|
|
189
|
+
position: absolute;
|
|
190
|
+
height: 28px;
|
|
191
|
+
width: 70px;
|
|
192
|
+
background: red;
|
|
193
|
+
top: 34px;
|
|
194
|
+
left: 18px;
|
|
195
|
+
border-radius: 50% 50% 50% 50%;
|
|
196
|
+
background-image: radial-gradient(
|
|
197
|
+
ellipse at 50% 50%,
|
|
198
|
+
rgba(253, 214, 240, 0.8) 0%,
|
|
199
|
+
rgba(253, 224, 244, 0.8) 66%,
|
|
200
|
+
rgba(253, 234, 247, 0.8) 100%
|
|
201
|
+
);
|
|
202
|
+
opacity: 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* 右眼容器 */
|
|
206
|
+
.cat-face .yan_right {
|
|
207
|
+
left: 196px;
|
|
208
|
+
top: 0px;
|
|
209
|
+
position: absolute;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* 悬停 / active:眼皮抬起、腮红浮现 */
|
|
213
|
+
.cat-face .mao:hover .yanquan_hedding,
|
|
214
|
+
.cat-face.is-active .mao .yanquan_hedding {
|
|
215
|
+
margin-top: 30px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.cat-face .mao:hover .hong,
|
|
219
|
+
.cat-face.is-active .mao .hong {
|
|
220
|
+
opacity: 0.8;
|
|
221
|
+
transition: opacity 0.5s ease-in 0.2s;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* ---------------------------------------------------------------- 脸部花纹 */
|
|
225
|
+
|
|
226
|
+
.cat-face .face_huawen {
|
|
227
|
+
height: 80px;
|
|
228
|
+
width: 380px;
|
|
229
|
+
position: absolute;
|
|
230
|
+
top: 190px;
|
|
231
|
+
z-index: 20;
|
|
232
|
+
left: 50%;
|
|
233
|
+
margin-left: -190px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.cat-face .face_huawen_huawen > div:first-child {
|
|
237
|
+
width: 30px;
|
|
238
|
+
height: 10px;
|
|
239
|
+
border-top: 6px #e53941 solid;
|
|
240
|
+
border-radius: 30% 80% 20% 50%;
|
|
241
|
+
transform: rotate(25deg);
|
|
242
|
+
margin-left: 20px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.cat-face .face_huawen_huawen > div:nth-child(2) {
|
|
246
|
+
width: 20px;
|
|
247
|
+
height: 6px;
|
|
248
|
+
background-color: #e53941;
|
|
249
|
+
border-radius: 50% 50% 50% 50%;
|
|
250
|
+
transform: rotate(25deg);
|
|
251
|
+
margin-left: 20px;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.cat-face .face_huawen_huawen > div:nth-child(3) {
|
|
255
|
+
width: 32px;
|
|
256
|
+
height: 10px;
|
|
257
|
+
border-bottom: 4px #e53941 solid;
|
|
258
|
+
border-radius: 30% 0% 90% 30%;
|
|
259
|
+
transform: rotate(25deg);
|
|
260
|
+
margin-left: 8px;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.cat-face .face_huawen_huawen > div:nth-child(4) {
|
|
264
|
+
margin-top: 20px;
|
|
265
|
+
width: 26px;
|
|
266
|
+
height: 20px;
|
|
267
|
+
border-bottom: 4px #e53941 solid;
|
|
268
|
+
border-radius: 30% 0% 90% 30%;
|
|
269
|
+
transform: rotate(30deg);
|
|
270
|
+
margin-left: 28px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.cat-face .face_huawen_huawen > div:last-child {
|
|
274
|
+
width: 22px;
|
|
275
|
+
height: 10px;
|
|
276
|
+
border-bottom: 3px #e53941 solid;
|
|
277
|
+
border-radius: 0% 0% 50% 50%;
|
|
278
|
+
transform: rotate(-15deg);
|
|
279
|
+
margin-left: 40px;
|
|
280
|
+
margin-top: -8px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* 右脸花纹:镜像左脸 */
|
|
284
|
+
.cat-face .huawen_right {
|
|
285
|
+
float: right;
|
|
286
|
+
transform: rotateY(180deg);
|
|
287
|
+
margin-top: -85px;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* -------------------------------------------------------------------- 鼻子 */
|
|
291
|
+
|
|
292
|
+
.cat-face .bizi {
|
|
293
|
+
width: 30px;
|
|
294
|
+
height: 36px;
|
|
295
|
+
position: absolute;
|
|
296
|
+
left: 50%;
|
|
297
|
+
margin-left: -15px;
|
|
298
|
+
top: 260px;
|
|
299
|
+
z-index: 30;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.cat-face .bizi > div:first-child {
|
|
303
|
+
width: 30px;
|
|
304
|
+
height: 10px;
|
|
305
|
+
border-bottom: 8px solid #2e2e2e;
|
|
306
|
+
border-radius: 0% 0% 50% 50%;
|
|
307
|
+
margin-top: -10px;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* -------------------------------------------------------------------- 嘴巴 */
|
|
311
|
+
|
|
312
|
+
.cat-face .zuiba_box {
|
|
313
|
+
width: 200px;
|
|
314
|
+
height: 36px;
|
|
315
|
+
position: absolute;
|
|
316
|
+
overflow: hidden;
|
|
317
|
+
left: 50%;
|
|
318
|
+
margin-left: -100px;
|
|
319
|
+
top: 260px;
|
|
320
|
+
z-index: 30;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.cat-face .zuiba {
|
|
324
|
+
margin-left: 85px;
|
|
325
|
+
margin-top: 6px;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.cat-face .zuiba > div:first-child {
|
|
329
|
+
width: 4px;
|
|
330
|
+
height: 8px;
|
|
331
|
+
background: #2e2e2e;
|
|
332
|
+
margin-left: 13px;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/* 右半边嘴巴 */
|
|
336
|
+
.cat-face .zuiba > div:nth-child(2) {
|
|
337
|
+
width: 50px;
|
|
338
|
+
height: 40px;
|
|
339
|
+
border-bottom: 4px solid #2e2e2e;
|
|
340
|
+
border-left: 4px solid #2e2e2e;
|
|
341
|
+
border-radius: 40% 0% 20% 50%;
|
|
342
|
+
margin-left: 13px;
|
|
343
|
+
margin-top: -26px;
|
|
344
|
+
position: absolute;
|
|
345
|
+
transition: border-radius 1s;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* 左半边嘴巴 */
|
|
349
|
+
.cat-face .zuiba > div:nth-child(3) {
|
|
350
|
+
width: 50px;
|
|
351
|
+
height: 40px;
|
|
352
|
+
border-bottom: 4px solid #2e2e2e;
|
|
353
|
+
border-right: 4px solid #2e2e2e;
|
|
354
|
+
border-radius: 0% 40% 50% 20%;
|
|
355
|
+
margin-left: -38px;
|
|
356
|
+
margin-top: -26px;
|
|
357
|
+
position: absolute;
|
|
358
|
+
transition: border-radius 1s;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* 悬停 / active:嘴角上扬 */
|
|
362
|
+
.cat-face .mao:hover .zuiba > div:nth-child(2),
|
|
363
|
+
.cat-face.is-active .mao .zuiba > div:nth-child(2) {
|
|
364
|
+
border-radius: 50% 50% 50% 50%;
|
|
365
|
+
width: 40px;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.cat-face .mao:hover .zuiba > div:nth-child(3),
|
|
369
|
+
.cat-face.is-active .mao .zuiba > div:nth-child(3) {
|
|
370
|
+
width: 40px;
|
|
371
|
+
margin-left: -30px;
|
|
372
|
+
border-radius: 50% 50% 50% 50%;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/* ------------------------------------------------------------- 布局辅助 / 缩放 */
|
|
376
|
+
|
|
377
|
+
/* 原页面用 <div style="clear:both"> 清浮动,这里换成类名 */
|
|
378
|
+
.cat-face .clear {
|
|
379
|
+
clear: both;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
@media (max-width: 560px) {
|
|
383
|
+
.cat-face {
|
|
384
|
+
--cat-scale: 0.82;
|
|
385
|
+
min-height: 360px;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
@media (max-width: 420px) {
|
|
390
|
+
.cat-face {
|
|
391
|
+
--cat-scale: 0.7;
|
|
392
|
+
min-height: 300px;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="frog-expressions"
|
|
4
|
+
:class="{ 'is-paused': paused }"
|
|
5
|
+
role="img"
|
|
6
|
+
aria-label="12 种纯 CSS 绘制的青蛙表情"
|
|
7
|
+
>
|
|
8
|
+
<div class="emoji-container">
|
|
9
|
+
<div v-for="item in expressions" :key="item.id" class="icon" :title="item.name">
|
|
10
|
+
<div class="frog" :id="'frog-' + item.id">
|
|
11
|
+
<div class="body">
|
|
12
|
+
<div v-if="item.blush" class="blush"></div>
|
|
13
|
+
<div v-if="item.tear" class="tear"></div>
|
|
14
|
+
<div class="mouth" :class="{ 'big-mouth': item.bigMouth }">
|
|
15
|
+
<div v-if="item.tongue" class="toungue"></div>
|
|
16
|
+
</div>
|
|
17
|
+
<div v-if="item.sleepy" class="sleepy-icons">
|
|
18
|
+
<div>Z</div>
|
|
19
|
+
<div>Z</div>
|
|
20
|
+
<div>Z</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="eyes">
|
|
25
|
+
<div
|
|
26
|
+
class="eye eye-left"
|
|
27
|
+
:class="{ wink: item.wink, 'extra-light': item.extraLight }"
|
|
28
|
+
>
|
|
29
|
+
<div class="eye-inner">
|
|
30
|
+
<div class="pupil"><div class="light"></div></div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="eye eye-right" :class="{ 'extra-light': item.extraLight }">
|
|
34
|
+
<div class="eye-inner">
|
|
35
|
+
<div class="pupil"><div class="light"></div></div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
/**
|
|
47
|
+
* 12 种纯 CSS 青蛙表情
|
|
48
|
+
*
|
|
49
|
+
* 抽取自 https://github.com/luo0412/night-demo-codepen-gulp-2019 的
|
|
50
|
+
* gulp3-jquery-melt-ie8-mpa/_melt/ch2-effects/03-animal/frog-expression/frog.html,
|
|
51
|
+
* 样式来自同目录 css/style.css,原始文件都保留在同目录 source/。
|
|
52
|
+
*
|
|
53
|
+
* - 12 个表情仍是纯 CSS 绘制(圆角、伪元素、边框、关键帧),没有图片 / SVG / canvas
|
|
54
|
+
* - 每个表情用源文件的 #frog-1 ~ #frog-12 作为局部样式锚点;一个组件实例里各出现一次,
|
|
55
|
+
* 同页需要多个画廊时建议分别挂载(ID 不跨实例复用)
|
|
56
|
+
* - 源文件里 1/7/10/12 号在 HTML 上相同,差异全部来自 CSS 关键帧与伪元素,已原样保留
|
|
57
|
+
* - paused prop 会暂停全部表情动画
|
|
58
|
+
*
|
|
59
|
+
* 对外:props = paused
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
const EXPRESSIONS = [
|
|
63
|
+
{ id: 1, name: '微笑' },
|
|
64
|
+
{ id: 2, name: '心动', blush: true, bigMouth: true },
|
|
65
|
+
{ id: 3, name: '眨眼吐舌', tongue: true, wink: true },
|
|
66
|
+
{ id: 4, name: '大笑', bigMouth: true, tongue: true, extraLight: true },
|
|
67
|
+
{ id: 5, name: '害羞', blush: true },
|
|
68
|
+
{ id: 6, name: '闪亮', blush: true, extraLight: true },
|
|
69
|
+
{ id: 7, name: '呆住' },
|
|
70
|
+
{ id: 8, name: '困倦', sleepy: true },
|
|
71
|
+
{ id: 9, name: '生气', blush: true },
|
|
72
|
+
{ id: 10, name: '晕乎' },
|
|
73
|
+
{ id: 11, name: '哭泣', tear: true },
|
|
74
|
+
{ id: 12, name: '恼火' }
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
export default {
|
|
78
|
+
name: 'FrogExpressions',
|
|
79
|
+
props: {
|
|
80
|
+
// 暂停所有表情动画
|
|
81
|
+
paused: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
data() {
|
|
87
|
+
return {
|
|
88
|
+
expressions: EXPRESSIONS
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<style scoped src="./style.css"></style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# 原始来源
|
|
2
|
+
|
|
3
|
+
- 页面:<https://github.com/luo0412/night-demo-codepen-gulp-2019/blob/master/gulp3-jquery-melt-ie8-mpa/_melt/ch2-effects/03-animal/frog-expression/frog.html>
|
|
4
|
+
- 样式:同目录 `css/style.css`(`demo.css` 是页面级背景 / reset,一并保留备查)
|
|
5
|
+
- 本目录的 `frog.html`、`style.css`、`demo.css` 原样拷贝自上述位置,仅用于保留出处。
|
|
6
|
+
|
|
7
|
+
改写为 Vue 2 组件(`../index.vue` + `../style.css`)时的处理:
|
|
8
|
+
|
|
9
|
+
- 12 个表情的 DOM 结构改为 `v-for` + 标志位生成(`blush` / `big-mouth` / `toungue` /
|
|
10
|
+
`wink` / `extra-light` / `sleepy-icons` / `tear`),与源 HTML 的每个 `#frog-N` 一一对应。
|
|
11
|
+
- 每个表情仍使用源文件的 `#frog-1` ~ `#frog-12` 作为局部样式锚点,CSS 里所有
|
|
12
|
+
`#frog-N` 规则原样保留(每个组件实例中各出现一次)。
|
|
13
|
+
- 去掉页面级 `body` / `.container` 布局、`*` reset 与 `-webkit-` 前缀;画廊改为
|
|
14
|
+
`.frog-expressions` 下的 flex 换行 + `gap`,窄屏自动 2~3 列。
|
|
15
|
+
- 新增 `.is-paused`:`paused` prop 暂停全部表情动画。
|
|
16
|
+
- 1 / 7 / 10 / 12 号在 HTML 上结构相同,差异全部来自 CSS 关键帧与伪元素,已原样保留;
|
|
17
|
+
`#frog-9` 的深绿身体、`#frog-12` 的红色生气动画也都在 CSS 里。
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
body, html {
|
|
2
|
+
font-size: 100%;
|
|
3
|
+
padding: 0;
|
|
4
|
+
margin: 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* Reset */
|
|
8
|
+
*,
|
|
9
|
+
*:after,
|
|
10
|
+
*:before {
|
|
11
|
+
-webkit-box-sizing: border-box;
|
|
12
|
+
-moz-box-sizing: border-box;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Clearfix hack by Nicolas Gallagher: http://nicolasgallagher.com/micro-clearfix-hack/ */
|
|
17
|
+
.clearfix:before,
|
|
18
|
+
.clearfix:after {
|
|
19
|
+
content: " ";
|
|
20
|
+
display: table;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.clearfix:after {
|
|
24
|
+
clear: both;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
body {
|
|
28
|
+
background: #494A5F;
|
|
29
|
+
color: #D5D6E2;
|
|
30
|
+
font-weight: 500;
|
|
31
|
+
font-size: 1.05em;
|
|
32
|
+
font-family: "Microsoft YaHei", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
a {
|
|
36
|
+
outline: none;
|
|
37
|
+
text-decoration: none;
|
|
38
|
+
-webkit-transition: 0.2s;
|
|
39
|
+
transition: 0.2s;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
a:hover, a:focus {
|
|
43
|
+
color: #74777b;
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
}
|