-
Notifications
You must be signed in to change notification settings - Fork 0
/
003_3d_grid_perspective.html
90 lines (83 loc) · 2.21 KB
/
003_3d_grid_perspective.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
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html lang="ko">
<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" />
<title>Document</title>
<link rel="stylesheet" href="../reset.css" />
<style>
body {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
}
.container {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: repeat(4, 1fr);
gap: 20px;
width: 460px;
transform: translate(-10px, -10px) rotateX(60deg) rotateY(-10deg)
rotateZ(45deg);
transform-style: preserve-3d;
}
.item {
position: relative;
width: 100px;
height: 100px;
background-color: rgba(0, 0, 0, 0.5);
cursor: pointer;
}
.item::after {
content: "";
position: absolute;
top: -10px;
left: -10px;
width: 100%;
height: 100%;
background-color: lightskyblue;
}
.item:nth-child(3n)::after {
background-color: lemonchiffon;
}
.item:nth-child(3n-1)::after {
background-color: lightsalmon;
}
.item:hover::after {
animation: here 0.3s alternate infinite;
}
@keyframes here {
0% {
top: -10px;
left: -10px;
}
100% {
top: -20px;
left: -20px;
}
}
</style>
</head>
<body>
<main class="container">
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
<section class="item"></section>
</main>
</body>
</html>