-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
118 lines (103 loc) · 2.47 KB
/
style.css
File metadata and controls
118 lines (103 loc) · 2.47 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@import url("https://fonts.googleapis.com/css2?family=Sura:wght@400;700&display=swap");
:root {
--size: 60vmin;
--space: 8vmin;
--duration: 300ms;
--ease-out: cubic-bezier(0.25, 1, 0.5, 1);
--bounce-out: cubic-bezier(0.34, 1.56, 0.64, 1);
}
* {
box-sizing: border-box;
}
body{
display: grid;
font-family: "Sura", sans-serif;
grid-gap: var(--space);
margin: 0 auto;
padding: var(--space);
background-color: rgb(29, 30, 34);
color: #fff;
place-items: center;
}
.promo{
position: relative;
width: var(--size);
height: var(--size);
cursor: pointer;
}
.title{
--font-size: calc(var(--size) / 8);
display: flex;
align-items: center;
position: absolute;
left: 0;
bottom: 0;
font-size: var(--font-size);
font-weight: 700;
line-height: 1.2;
white-space: nowrap;
transform: translate(-10%, -50%);
transition: transform var( --duration) var(--ease-out);
pointer-events: none;
}
.image-wrapper {
width: var(--size);
height: var(--size);
overflow: hidden;
clip-path: polygon(100% 0, 100% 50%, 100% 100%, 0% 100%, 0 49%, 0% 0%);
transition: transform var(--duration) var(--ease-out),
clip-path var(--duration) var(--ease-out)
}
.image-wrapper img {
position: relative;
width: 120%;
height: 100%;
object-fit: cover;
transform: translateX(-10%);
transition: transform var(--duration) var(--ease-out);
}
.promo:hover img {
transform: translateX(0);
}
.promo:hover .image-wrapper {
clip-path: polygon(75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50%, 0% 0%);
transform: translateX(25%);
transition-timing-function: var(--bounce-out);
}
.promo:hover .image-wrapper::after {
opacity: 1;
}
.promo:hover .title {
transform: translate(5%, -50%);
transition-timing-function: var(--bounce-out);
}
.title::after {
content: attr(data-cta);
display: inline-block;
margin-left: 1.5vmin;
font-size: calc(var(--font-size) / 3.25);
font-weight: 400;
letter-spacing: 0.125vmin;
transform: translateX(-25%);
transition: transform var(--duration) var(--ease-out),
opacity var(--duration) var(--ease-out);
opacity: 0;
}
.promo:hover .title::after {
opacity: 1;
transform: translateX(0);
transition-timing-function: var(--bounce-out);
}
.image-wrapper::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: var(--overlay-color);
mix-blend-mode: multiply;
opacity: 0;
transform: translateZ(0);
transition: opacity var(--duration) var(--ease-out);
}