-
Notifications
You must be signed in to change notification settings - Fork 105
/
gharsh11032000_spotty-zebra-83.html
141 lines (125 loc) · 2.54 KB
/
gharsh11032000_spotty-zebra-83.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
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
<div class="tooltip-container">
<span class="tooltip">Uiverse.io</span>
<span class="text">Tooltip 👆</span>
<span>Hello! 👋</span>
</div>
<style>
/* From Uiverse.io by gharsh11032000 - Tags: tooltip, animation, hover, bounce */
/* This is an example, feel free to delete this code */
.tooltip-container {
--background: #333333;
--color: #e8e8e8;
position: relative;
cursor: pointer;
transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
font-size: 18px;
font-weight: 600;
color: var(--color);
padding: 0.7em 1.8em;
border-radius: 8px;
text-transform: uppercase;
height: 60px;
width: 180px;
display: grid;
place-items: center;
border: 2px solid var(--color);
}
.text {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: grid;
place-items: center;
transform-origin: -100%;
transform: scale(1);
transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.tooltip-container span:last-child {
position: absolute;
top: 0%;
left: 100%;
width: 100%;
height: 100%;
border-radius: 8px;
opacity: 1;
background-color: var(--background);
z-index: -1;
border: 2px solid var(--background);
transform: scale(0);
transform-origin: 0;
transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
display: grid;
place-items: center;
}
.tooltip {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
padding: 0.3em 0.6em;
opacity: 0;
pointer-events: none;
transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
background: var(--background);
z-index: -1;
border-radius: 8px;
scale: 0;
transform-origin: 0 0;
text-transform: capitalize;
font-weight: 400;
font-size: 16px;
box-shadow: rgba(0, 0, 0, 0.25) 0 8px 15px;
}
.tooltip::before {
position: absolute;
content: "";
height: 0.6em;
width: 0.6em;
bottom: -0.2em;
left: 50%;
transform: translate(-50%) rotate(45deg);
background: var(--background);
}
.tooltip-container:hover .tooltip {
top: -100%;
opacity: 1;
visibility: visible;
pointer-events: auto;
scale: 1;
animation: shake 0.5s ease-in-out both;
}
.tooltip-container:hover {
box-shadow: rgba(0, 0, 0, 0.25) 0 8px 15px;
color: white;
border-color: transparent;
}
.tooltip-container:hover span:last-child {
transform: scale(1);
left: 0;
}
.tooltip-container:hover .text {
opacity: 0;
top: 0%;
left: 100%;
transform: scale(0);
}
@keyframes shake {
0% {
rotate: 0;
}
25% {
rotate: 7deg;
}
50% {
rotate: -7deg;
}
75% {
rotate: 1deg;
}
100% {
rotate: 0;
}
}
</style>