-
Notifications
You must be signed in to change notification settings - Fork 192
/
book.html
82 lines (79 loc) · 2 KB
/
book.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Book</title>
<style>
body {
background-color: #eceff1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 2rem;
--primaryColor: #01579b;
}
.book {
width: 200px;
height: 300px;
position: relative;
transform-style: preserve-3d;
transform: rotateY(-30deg);
transition: 1s ease;
animation: 1s ease 0s 1 initAnimation;
}
.book::before {
position: absolute;
content: ' ';
background-color: #00f;
left: 0;
top: 3px;
width: 48px;
height: 294px;
transform: translateX(172px) rotateY(90deg);
background: linear-gradient(90deg, #fff 0%, #f9f9f9 5%, #fff 10%, #f9f9f9 15%, #fff 20%, #f9f9f9 25%, #fff 30%, #f9f9f9 35%, #fff 40%, #f9f9f9 45%, #fff 50%, #f9f9f9 55%, #fff 60%, #f9f9f9 65%, #fff 70%, #f9f9f9 75%, #fff 80%, #f9f9f9 85%, #fff 90%, #f9f9f9 95%, #fff 100% );
}
.book::after {
position: absolute;
top: 0;
left: 0;
content: ' ';
width: 200px;
height: 300px;
transform: translateZ(-25px);
background-color: #0656ea;
border-radius: 0 2px 2px 0;
box-shadow: -10px 0 50px 10px #666;
}
.book:hover {
transform: rotateY(0deg);
}
.book > :first-child {
position: absolute;
top: 0;
left: 0;
background-color: #f00;
width: 200px;
height: 300px;
transform: translateZ(25px);
background-color: #0656ea;
border-radius: 0 2px 2px 0;
box-shadow: 5px 5px 20px #666;
}
.book-container {
display: flex;
align-items: center;
justify-content: center;
perspective: 600px;
}
</style>
</head>
<body>
<h1>3D CSS Book Image</h1>
<div class="book-container">
<div class="book">
<img src="https://img.alicdn.com/tfs/TB1ZtVcbIieb18jSZFvXXaI3FXa-500-750.png">
</div>
</div>
</body>
</html>