-
Notifications
You must be signed in to change notification settings - Fork 0
/
glass.css
65 lines (56 loc) · 1.21 KB
/
glass.css
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
.glass-button {
position: relative;
display: inline-block;
padding: 10px 20px;
border: none;
border-radius: 10px;
background: rgba(0, 0, 0, 0.051);
backdrop-filter: blur(10px);
color: white;
font-size: 16px;
cursor: pointer;
overflow: hidden;
transition: transform 0.3s;
}
.glass-button a {
color: white;
text-decoration: none;
}
.glass-button::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.247);
transform: scale(0);
transition: transform 0.3s;
/* 触碰水波 */
}
.glass-button:hover::before {
transform: scale(1);
}
.glass-button:active {
background: rgba(255, 255, 255, 0);
transform: scale(0.85);
/* 修改这里,使按钮在按下时缩小到原来的 85% */
}
.glass-button:hover {
transform: scale(1.1);
}
.glass-button::after {
content: '';
position: absolute;
width: 5px;
height: 5px;
background: rgba(0, 0, 0, 0.538);
border-radius: 100%;
transform: scale(0);
opacity: 0;
transition: transform 0.5s, opacity 0.5s;
}
.glass-button:active::after {
transform: scale(200);
opacity: 1;
}