-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmask两张图片融合.html
55 lines (48 loc) · 1.16 KB
/
mask两张图片融合.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
@property --per {
syntax: '<angle>';
inherits: false;
initial-value: 135deg;
}
body {
display: flex;
justify-content: center;
align-items: center;
}
div {
position: relative;
width: 100px;
height: 100px;
background-image: url(https://avatars.githubusercontent.com/u/22010181);
background-repeat: no-repeat;
background-size: contain;
}
div::after {
content: "";
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: url(https://z3.ax1x.com/2021/09/30/4oUAiQ.png) no-repeat;
background-size: cover;
mask: linear-gradient(var(--per), #000 10%, transparent 70%, transparent);
-webkit-mask: linear-gradient(var(--per), #000 10%, transparent 70%, transparent);
transition: --per 1000ms linear;
cursor: pointer;
}
div:hover::after {
--per: 60deg
}
</style>
</head>
<body>
<div></div>
</body>
</html>