-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhover.html
525 lines (467 loc) · 15.8 KB
/
hover.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
<html>
<head>
<title>css-hover特效</title>
<style>
.wrap{
height: 100vh;
}
/* 发送效果 */
#send-btn{
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
#send-btn button {
background: #5f55af;
border: 0;
border-radius: 5px;
padding: 10px 30px 10px 20px;
color: white;
text-transform: uppercase;
font-weight: bold;
}
#send-btn button img {
display: inline-block;
vertical-align: middle;
padding-right: 5px;
width: 30px;
}
#send-btn button:hover img {
animation: fly 2s ease 1;
}
@keyframes fly {
0% {
transform: translateX(0%);
}
50% {
transform: translateX(300%);
}
100% {
transform: translateX(0);
}
}
/* 霓虹效果 */
#neon-btn {
display: flex;
align-items: center;
justify-content: space-around;
height: 100vh;
background: #031628;
}
.btn {
border: 1px solid;
background-color: transparent;
text-transform: uppercase;
font-size: 14px;
padding: 10px 20px;
font-weight: 300;
}
.one {
color: #4cc9f0;
}
.two {
color: #f038ff;
}
.three {
color: #b9e769;
}
.four{
color: #b9e769;
}
.btn:hover {
color: white;
border: 0;
}
.one:hover {
background-color: #4cc9f0;
-webkit-box-shadow: 10px 10px 99px 6px rgba(76,201,240,1);
-moz-box-shadow: 10px 10px 99px 6px rgba(76,201,240,1);
box-shadow: 10px 10px 99px 6px rgba(76,201,240,1);
}
.two:hover {
background-color: #f038ff;
-webkit-box-shadow: 10px 10px 99px 6px rgba(240, 56, 255, 1);
-moz-box-shadow: 10px 10px 99px 6px rgba(240, 56, 255, 1);
box-shadow: 10px 10px 99px 6px rgba(240, 56, 255, 1);
}
.three:hover {
background-color: #b9e769;
-webkit-box-shadow: 10px 10px 99px 6px rgba(185, 231, 105, 1);
-moz-box-shadow: 10px 10px 99px 6px rgba(185, 231, 105, 1);
box-shadow: 10px 10px 99px 6px rgba(185, 231, 105, 1);
}
.four:hover{
/* background-color: #b9e769; */
box-shadow: inset 1px 1px 10px 10px rgba(185, 231, 105, 1);
}
/* 边框效果 */
#draw-border {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
flex-direction: column;
}
#draw-border button {
border: 0;
background: none;
text-transform: uppercase;
color: #4361ee;
font-weight: bold;
position: relative;
outline: none;
padding: 10px 20px;
box-sizing: border-box;
margin-bottom: 50px;
}
#draw-border button::before, button::after {
box-sizing: inherit;
position: absolute;
content: '';
border: 2px solid transparent;
width: 0;
height: 0;
}
#draw-border button::after {
bottom: 0;
right: 0;
}
#draw-border button::before {
top: 0;
left: 0;
}
#draw-border button:hover::before, button:hover::after {
width: 100%;
height: 100%;
}
#draw-border button:hover::before {
border-top-color: #4361ee;
border-right-color: #4361ee;
transition: width 0.3s ease-out, height 0.3s ease-out 0.3s;
}
#draw-border button:hover::after {
border-bottom-color: #4361ee;
border-left-color: #4361ee;
transition: border-color 0s ease-out 0.6s, width 0.3s ease-out 0.6s, height 0.3s ease-out 1s;
}
#draw-border .draw-img{
display: block;
position: relative;
box-sizing: border-box;
}
.draw-img::before, .draw-img::after{
box-sizing: inherit;
position: absolute;
content: '';
border: 3px solid transparent;
width: 0;
height: 0;
}
.draw-img::after{
bottom: 0;
right: 0;
}
.draw-img::before{
top: 0;
left: 0;
}
.draw-img:hover::before, .draw-img:hover::after{
width: 100%;
height: 100%;
}
.draw-img:hover::before{
border-top-color: #b9e769;
border-right-color:#b9e769;
transition: width 0.3s ease-out, height 0.3s ease-out 0.3s;
}
.draw-img:hover::after{
border-bottom-color:#b9e769;
border-left-color: #b9e769;
transition: border-color 0s ease-out 0.6s, width 0.3s ease-out 0.6s, height 0.3s ease-out 1s;
}
/*圆形效果*/
#circle-btn {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
#circle-btn .btn-container {
position: relative;
}
#circle-btn button {
border: 0;
border-radius: 50px;
color: white;
background: #5f55af;
padding: 15px 20px 16px 60px;
text-transform: uppercase;
background: linear-gradient(to right, #f72585 50%, #5f55af 50%);
background-size: 200% 100%;
background-position: right bottom;
transition:all 2s ease;
}
/* #circle-btn svg {
background: #f72585;
padding: 8px;
border-radius: 50%;
position: absolute;
left: 0;
top: 0%;
}*/
#circle-btn button:hover {
background-position: left bottom;
}
/*圆角效果*/
#border-btn {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
#border-btn button {
border: 0;
border-radius: 10px;
background: #2ec4b6;
text-transform: uppercase;
color: white;
font-size: 16px;
font-weight: bold;
padding: 15px 30px;
outline: none;
position: relative;
transition: border-radius 3s;
-webkit-transition: border-radius 3s;
}
#border-btn button:hover {
border-bottom-right-radius: 50px;
border-top-left-radius: 50px;
border-bottom-left-radius: 10px;
border-top-right-radius: 10px;
}
/*冰冻效果*/
#frozen-btn {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
#frozen-btn button {
border: 0;
margin: 20px;
text-transform: uppercase;
font-size: 20px;
font-weight: bold;
padding: 15px 50px;
border-radius: 50px;
color: white;
outline: none;
position: relative;
}
#frozen-btn button:before{
content: '';
display: block;
background: linear-gradient(to left, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.4) 50%);
background-size: 210% 100%;
background-position: right bottom;
height: 100%;
width: 100%;
position: absolute;
top: 0;
bottom:0;
right:0;
left: 0;
border-radius: 50px;
transition: all 1s;
-webkit-transition: all 1s;
}
#frozen-btn .green {
background-image: linear-gradient(to right, #25aae1, #40e495);
box-shadow: 0 4px 15px 0 rgba(49, 196, 190, 0.75);
}
#frozen-btn .purple {
background-image: linear-gradient(to right, #6253e1, #852D91);
box-shadow: 0 4px 15px 0 rgba(236, 116, 149, 0.75);
}
#frozen-btn .purple:hover:before {
background-position: left bottom;
}
#frozen-btn .green:hover:before {
background-position: left bottom;
}
/*闪亮效果*/
#shiny-shadow {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
background: #1c2541;
}
#shiny-shadow button {
border: 2px solid white;
background: transparent;
text-transform: uppercase;
color: white;
padding: 15px 50px;
outline: none;
overflow: hidden;
position: relative;
}
#shiny-shadow span {
z-index: 20;
}
#shiny-shadow button:after {
content: '';
display: block;
position: absolute;
top: -36px;
left: -100px;
background: white;
width: 50px;
height: 125px;
opacity: 20%;
transform: rotate(-45deg);
}
#shiny-shadow button:hover:after {
left: 120%;
transition: all 600ms cubic-bezier(0.3, 1, 0.2, 1);
-webkit-transition: all 600ms cubic-bezier(0.3, 1, 0.2, 1);
}
/*加载效果*/
#loading-btn {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
#loading-btn button {
background: transparent;
border: 0;
border-radius: 0;
text-transform: uppercase;
font-weight: bold;
font-size: 20px;
padding: 15px 50px;
position: relative;
}
#loading-btn button:before {
transition: all 0.8s cubic-bezier(0.7, -0.5, 0.2, 2);
content: '';
width: 1%;
height: 100%;
background: #ff5964;
position: absolute;
top: 0;
left: 0;
}
#loading-btn button span {
mix-blend-mode: darken;
}
#loading-btn button:hover:before {
background: #ff5964;
width: 100%;
}
.gradient{
/*background: linear-gradient(1turn, #e66465, #9198e5);*/
/*background: linear-gradient(red, orange, yellow, green, blue); */
/*background: linear-gradient(45deg,red 0%, orange 25%, yellow 50%, green 75%, blue 100%);*/
background: linear-gradient(135deg, red, red 60%, blue);
/*background: linear-gradient(red 0%, 50%, blue 90%);*/
/*background: linear-gradient(red 40%, yellow 30%, blue 65%);*/
width: 200px;
height: 200px;
}
/* 波浪线 */
.hover_link{
color: blue;
font-size: 30px;
}
.hover_link:hover{
color: #f30;
text-decoration-style: wavy;
}
.svg-wave {
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cpath fill='none' stroke='%23333' d='M0 3.5c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3'/%3E%3C/svg%3E") repeat-x 0 100%;
background-size: 20px auto;
}
.svg-wave {
animation: waveMove 1s infinite linear;
}
@keyframes waveMove {
from { background-position: 0 100%; }
to { background-position: -20px 100%; }
}
.flow-wave {
background: radial-gradient(circle at 10px -7px, transparent 8px, currentColor 8px, currentColor 9px, transparent 9px) repeat-x,
radial-gradient(circle at 10px 27px, transparent 8px, currentColor 8px, currentColor 9px, transparent 9px) repeat-x;
background-size: 20px 20px;
background-position: -10px calc(100% + 16px), 0 calc(100% - 4px);
}
.flow-wave {
animation: waveFlow 1s infinite linear;
}
@keyframes waveFlow {
from { background-position-x: -10px, 0; }
to { background-position-x: -30px, -20px; }
}
</style>
</head>
<!-- 发送效果 -->
<div id="send-btn">
<button>
<!-- <svg xmlns="send.svg" version="1.1">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" />
</svg> -->
<img src="img/send.png" alt="">
Send
</button>
</div>
<!-- 霓虹效果 -->
<div id="neon-btn">
<button class="btn one">Hover me</button>
<button class="btn two">Hover me</button>
<button class="btn three">Hover me</button>
<button class="btn four">Hover me</button>
</div>
<!-- 边框效果 -->
<div id="draw-border">
<button>Hover me</button>
</div>
<!-- 圆形效果 -->
<div class="wrap">
<div id="circle-btn">
<div class="btn-container">
<!-- <svg xmlns="send.svg" version="1.1"></svg> -->
<span></span>
<button>Hover me</button>
</div>
</div>
</div>
<!-- 圆角效果 -->
<div class="wrap">
<div id="border-btn">
<button>Hover me</button>
</div>
</div>
<!-- 冰冻效果 -->
<div id="frozen-btn">
<button class="green">Hover me</button>
<button class="purple">Hover me</button>
</div>
<!-- 闪亮效果 -->
<div id="shiny-shadow">
<button><span>Hover me</span></button>
</div>
<!-- 加载效果 -->
<div id="loading-btn">
<button><span>Hover me</span></button>
</div>
<div class="gradient"></div>
<!-- 波浪线 -->
<class="wrap">
<a href="" class="hover_link">选中效果</a>
<a class="flow-wave">css径向渐变模拟波浪线</a>
</div>
</div>
</html>