-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
67 lines (57 loc) · 1.32 KB
/
style.css
File metadata and controls
67 lines (57 loc) · 1.32 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
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body{
width: 100%;
height: 100%;
background: #180909;
}
.container{
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
gap: 1rem;
/* add 3d representation to the container div element */
transform-style: preserve-3d;
transform: perspective(1000px);
}
.container .item{
width: 10rem;
height: 20rem;
/* add brightness animation effect */
transition: 0.5s;
filter: brightness(0);
cursor: pointer;
}
.container .item:hover{
filter: brightness(1);
transform: translateZ(200px);
}
/* add hover animation to the right item */
.container .item:hover + *{
filter: brightness(0.6);
transform: translateZ(150px) rotateY(40deg);
}
.container .item:hover + * + *{
filter: brightness(0.4);
transform: translateZ(70px) rotateY(20deg);
}
/* for left of the hover */
/* +* represent the right element but for left we don't have any thing like this */
.container .item:has(+ *:hover){
filter: brightness(0.6);
transform: translateZ(150px) rotateY(-40deg);
}
.container .item:has(+ * + *:hover){
filter: brightness(0.4);
transform: translateZ(70px) rotateY(-20deg);
}
.item img{
width: 100%;
height: 100%;
object-fit: cover;
}