-
Notifications
You must be signed in to change notification settings - Fork 14
/
019.翻牌效果.html
60 lines (53 loc) · 1.34 KB
/
019.翻牌效果.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./assets/global.css" />
<style>
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.card-container {
width: 300px;
height: 400px;
position: relative;
perspective: 1000px;
}
.cover,
.back {
width: 100%;
height: 100%;
position: absolute;
backface-visibility: hidden;
transition: transform 0.5s ease-in-out;
}
.cover {
background-image: url("./assets/movie-poster/m-byxz.jpg");
background-size: cover;
transform: rotateY(0deg);
}
.back {
background-size: cover;
background-image: url("./assets/movie-poster/m-dbs.jpg");
transform: rotateY(180deg);
}
.card-container:hover .cover {
transform: rotateY(180deg);
}
.card-container:hover .back {
transform: rotateY(0deg);
}
</style>
</head>
<body>
<div class="card-container">
<div class="cover">COVER</div>
<div class="back">BACK</div>
</div>
</body>
</html>