-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.css
183 lines (158 loc) · 3.77 KB
/
index.css
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
.app {
transition: width, height, margin-top, cubic-bezier(0.25, 1, 0.5, 1) 100ms;
}
.app:hover {
width: 90px;
height: 90px;
margin-top: -30px;
}
/* Right side */
.app:hover + .app {
width: calc(80px + var(--dock-offset-right, 0px));
height: calc(80px + var(--dock-offset-right, 0px));
margin-top: calc(-20px + var(--dock-offset-right, 0px) * -1);
}
.app:hover + .app + .app {
width: calc(70px + var(--dock-offset-right, 0px));
height: calc(70px + var(--dock-offset-right, 0px));
margin-top: calc(-10px + var(--dock-offset-right, 0px) * -1);
}
/* Left side */
.app:has(+ .app:hover){
width: calc(80px + var(--dock-offset-left, 0px));
height: calc(80px + var(--dock-offset-left, 0px));
margin-top: calc(-20px + var(--dock-offset-left, 0px) * -1);
}
.app:has(+ .app + .app:hover){
width: calc(70px + var(--dock-offset-left, 0px));
height: calc(70px + var(--dock-offset-left, 0px));
margin-top: calc(-10px + var(--dock-offset-left, 0px) * -1);
}
/**
Styling that has nothing to do with the animation:
*/
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
background-image: url("https://www.frontend.fyi/playground-assets/macos-dock/macos-wallpaper-by-mohammad-alizade-4wzRuAb-KWs-unsplash.webp");
background-repeat: no-repeat;
background-size: cover;
}
body{
margin: 0;
}
.page {
min-height: 100dvh;
display: flex;
}
.dock {
margin: auto auto 12px auto;
border-radius: 24px;
padding: 0 12px;
background-image: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.15));
box-shadow:rgba(255, 255, 255, 0.17) 0px 0px 0px 1px inset;
}
.dock ul {
display: flex;
list-style-type: none;
padding: 0;
}
.app {
width: 60px;
height: 60px;
position: relative;
/* The only reason this padding is disabled, is because the icons have
a padding in the image that would take too much effort to remove :)
In case you add custom icons or anything without the padding in the image, you need
to add this padding on each app element. If you'd add it as a margin between the elements,
you would lose the over state when moving between icons. */
/* padding: 0 6px; */
}
.app img {
width: 100%;
height: 100%;
}
.app a {
width: 100%;
height: 100%;
display: block;
border-radius: 12px;
color: #fff;
}
.app:hover .tooltip,
.app:focus-within .tooltip {
opacity: 1;
}
.tooltip {
position: absolute;
top: -40px;
left: 50%;
transform: translateX(-50%);
opacity: 0;
transition: ease-in opacity 100ms;
display: block;
background: rgba(0,0,0,0.58);
padding: 8px;
border-radius: 12px;
height: 22px;
width: auto;
box-shadow:rgba(0, 0, 0, 0.17) 0px 12px 8px 1px;
white-space: nowrap;
}
.source-links {
position: absolute;
display: flex;
flex-direction: column;
align-items: flex-end;
right: 20px;
top: 20px;
text-align: right;
}
.source-links a {
color: #fff;
opacity: 0.3;
margin-bottom: 8px;
}
.source-links a:hover {
opacity: 1;
}
.mobile-message {
position: absolute;
width: 100%;
height: 100%;
color: #fff;
font-size: 18px;
font-weight: 600;
line-height: 1.2;
justify-content: center;
align-items: center;
display: none;
}
@media only screen and (max-width: 800px) {
.mobile-message {
display: flex;
}
}
.mobile-message p {
max-width: 70vw;
}
.mobile-message a {
color: #fff;
}
.mobile-message::before {
content: "";
position: fixed;
inset: 0;
background-color: rgba(255,255,255,0.3);
filter: blur(80px);
-webkit-filter: blur(80px);
}