-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransform.html
More file actions
104 lines (91 loc) · 2.42 KB
/
Copy pathTransform.html
File metadata and controls
104 lines (91 loc) · 2.42 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>transform</title>
<style>
h2 {
text-align: center;
}
.box-container {
display: flex;
flex-wrap: wrap;
gap: 1rem;
justify-content: center;
}
.card {
width: 100px;
height: 100px;
background-color: #d7c1c1;
display: flex;
justify-content: center;
align-items: center;
transition: transform 5s;
}
.card.translate:hover {
transform: translate(20px, 20px);
}
.card.rotate:hover {
transform: rotate(50deg);
}
.card.scale:hover {
transform: scale(2, 0.5);
}
.card.skew:hover {
transform: skew(20deg, 10deg);
}
.card.mix:hover {
transform: rotate(-30deg) translateY(20px)scale(1.2);
}
.all {
width: 200px; height: 120px;
margin: 3rem auto;
perspective: 600px; /* depth */
}
.box {
width: 100%;
height: 100%;
position: relative;
transform-style: preserve-3d;
transition: transform 8s;
border: 1px solid red;
}
.box:hover{
transform: rotatey(180deg);
}
.face {
display: flex; align-items: center; justify-content: center;
position: absolute;
width: 100%; height: 100%;
backface-visibility: hidden;
display: flex; align-items: center; justify-content: center;
font-size: 1.2rem; color: #b8abab;
border-radius: 8px;
}
.front { background: #e74c3c; }
.back {
background: #2ecc71;
transform: rotateY(180deg);
}
</style>
</head>
<body>
<h2>2D</h2>
<div class="box-container">
<div class="card translate">Translate</div>
<div class="card rotate">Rotate</div>
<div class="card scale">Scale</div>
<div class="card skew">Skew</div>
<div class="card mix">Mix</div>
</div>
<h2>3D</h2>
<div class="all">
<div class="box">
<div class="face front">Front</div>
<div class="face back">Back</div>
</div>
<div>test</div>
</div>
</body>
</html>