-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathMRez321_nice-stingray-21.html
95 lines (83 loc) · 1.59 KB
/
MRez321_nice-stingray-21.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
<div class="tooltip-container">
<span class="tooltip">Hey There!</span>
<span class="text">Tooltip</span>
</div>
<style>
/* From Uiverse.io by MRez321 - Tags: tooltip, hover, transition */
.tooltip-container {
--background: #7579e7;
background: var(--background);
position: relative;
cursor: pointer;
transition: all 0.2s;
font-size: 17px;
border-radius: 10px;
width: 8em;
display: flex;
justify-content: center;
align-items: center;
}
.tooltip {
position: absolute;
top: 0;
left: 30%;
transform: translateX(-50%);
padding: 0.3em 0.6em;
opacity: 0;
pointer-events: none;
transition: all 0.3s;
background: var(--background);
border-radius: 5px;
width: 7em;
text-align: center;
}
.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;
animation: shake 500ms ease-in-out forwards;
}
@keyframes shake {
0% {
transform: rotate(2deg);
}
50% {
transform: rotate(-3deg);
}
70% {
transform: rotate(3deg);
}
100% {
transform: rotate(0deg);
}
}
.text {
position: relative;
padding: 0.7em 1.8em;
overflow: hidden;
}
.text::before {
content: "(^_^)/";
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
padding: inherit;
background-color: var(--background);
transition: 0.3s;
}
.tooltip-container:hover .text::before {
top: 0;
}
</style>