-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.css
91 lines (80 loc) · 1.59 KB
/
style.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
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500&display=swap');
:root {
--nav-height: 5rem;
--bg: red;
--icon-size: calc(var(--nav-height) / 2);
--anim-speed: 0.5s;
}
* {
transition: all var(--anim-speed);
box-sizing: border-box;
}
body {
background-color: var(--bg);
/* centering */
display: grid;
place-items: center;
height: 100vh;
width: 100vw;
/* solving the issue of scrollbar */
margin: 0;
}
nav {
display: flex;
background-color: white;
height: var(--nav-height);
padding: 0 var(--icon-size);
gap: var(--icon-size);
border-radius: var(--nav-height);
}
.icon {
--disabled-color: grey;
font-size: var(--icon-size);
color: var(--disabled-color);
}
.icon-div {
display: flex;
height: 100%;
align-items: center;
position: relative;
}
.icon-div.active .icon {
color: var(--bg);
}
.icon-div:active {
--angle: 20deg;
transform: rotate(var(--angle));
}
.icon-div::before {
--top-visible: calc(-1 * var(--nav-height) / 3);
content: attr(data-text);
position: absolute;
top: 0;
z-index: -1;
left: 50%;
transform: translateX(-50%);
font-family: poppins;
width: max-content;
opacity: 0;
}
.icon-div.active::before {
animation: showDataText calc(var(--anim-speed) * 3);
}
@keyframes showDataText {
from {
top: 0;
opacity: 0;
}
30% {
top: var(--top-visible);
opacity: 1;
}
80% {
top: var(--top-visible);
opacity: 1;
}
to {
top: 0;
opacity: 0;
}
}