@@ -14,7 +14,9 @@ const toasts = [
14
14
class =" toasts-wrap animated_bottom"
15
15
transition:persist =" toasts"
16
16
>
17
- <div class =" by-drizzle" >Product by Drizzle Team</div >
17
+ <div id =" product-by-drizzle" class =" by-drizzle fade-out" >
18
+ Product by Drizzle Team
19
+ </div >
18
20
{
19
21
toasts .map ((toast , index ) => (
20
22
<a
@@ -35,6 +37,13 @@ const toasts = [
35
37
<span class = " toast-title" >{ toast .title } </span >
36
38
<span class = " toast-description" >{ toast .description } </span >
37
39
</div >
40
+ <div class = " black-friday-wrap" >
41
+ <div class = " black-friday" >
42
+ black
43
+ <br />
44
+ friday
45
+ </div >
46
+ </div >
38
47
</div >
39
48
</a >
40
49
))
@@ -52,7 +61,7 @@ const toasts = [
52
61
width: 100%;
53
62
opacity: 1;
54
63
transition: opacity 1s;
55
- margin-bottom: 32px ;
64
+ margin-bottom: 48px ;
56
65
}
57
66
58
67
.toasts-wrap-fade {
@@ -61,9 +70,17 @@ const toasts = [
61
70
}
62
71
63
72
.toast {
73
+ position: relative;
74
+ padding: 1px;
75
+ overflow: hidden;
76
+ border-radius: 8px;
64
77
transition: transform 0.2s cubic-bezier(0.41, 0.41, 0.35, 1.3);
65
78
}
66
79
80
+ .toast:hover::before {
81
+ opacity: 1;
82
+ }
83
+
67
84
.toasts-wrap:has(.toast:hover) .toast {
68
85
transform: none !important;
69
86
}
@@ -81,10 +98,32 @@ const toasts = [
81
98
display: flex;
82
99
align-items: center;
83
100
width: 100%;
84
- /* box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px 0px; */
85
101
background: #fbfbfc;
86
102
border-radius: 8px;
87
103
border: 1px solid #e0e1e3;
104
+ overflow: hidden;
105
+ }
106
+
107
+ html.dark .toast::before {
108
+ background-image: url("../../assets/images/dark-gradient.png");
109
+ }
110
+
111
+ .toast::before {
112
+ content: "";
113
+ position: absolute;
114
+ top: 50%;
115
+ left: 50%;
116
+ transform: translate(-50%, -50%);
117
+ width: 240px;
118
+ height: 240px;
119
+ background-image: url("../../assets/images/light-gradient.png");
120
+ background-size: 240px 240px;
121
+ background-position: center center;
122
+ transform: rotate(45deg) scale(1.45);
123
+ animation: spin 10s linear infinite;
124
+ z-index: -1;
125
+ opacity: 0;
126
+ transition: opacity 0.2s;
88
127
}
89
128
90
129
.toast-text {
@@ -111,7 +150,7 @@ const toasts = [
111
150
112
151
@keyframes bottom {
113
152
0% {
114
- transform: translateY(100 %);
153
+ transform: translateY(150 %);
115
154
opacity: 0;
116
155
}
117
156
75% {
@@ -166,9 +205,11 @@ const toasts = [
166
205
.by-drizzle {
167
206
text-transform: uppercase;
168
207
font-size: 10px;
169
- bottom: -24px ;
208
+ bottom: -32px ;
170
209
position: absolute;
171
- transition: bottom 0.2s;
210
+ transition:
211
+ bottom 0.2s,
212
+ opacity 0.3s;
172
213
margin-bottom: 8px;
173
214
left: 50%;
174
215
color: #909090;
@@ -178,6 +219,35 @@ const toasts = [
178
219
padding: 0 8px;
179
220
border-bottom-left-radius: 8px;
180
221
border-bottom-right-radius: 8px;
222
+ opacity: 1;
223
+ }
224
+
225
+ .fade-out {
226
+ opacity: 0;
227
+ }
228
+
229
+ .black-friday-wrap {
230
+ position: absolute;
231
+ right: 8px;
232
+ top: 50%;
233
+ transform: translateY(-50%);
234
+ }
235
+
236
+ html.dark .black-friday {
237
+ background-color: #fff;
238
+ color: #000;
239
+ }
240
+
241
+ .black-friday {
242
+ transform: rotateZ(45deg);
243
+ font-size: 8px;
244
+ text-transform: uppercase;
245
+ font-weight: 700;
246
+ background-color: #111;
247
+ color: #fff;
248
+ padding: 3px;
249
+ border-radius: 3px;
250
+ line-height: normal;
181
251
}
182
252
</style >
183
253
<style is:global >
@@ -200,6 +270,12 @@ const toasts = [
200
270
</script >
201
271
<script >
202
272
const initToasts = () => {
273
+ const productByDrizzle = document.getElementById("product-by-drizzle");
274
+ if (productByDrizzle) {
275
+ setTimeout(() => {
276
+ productByDrizzle.classList.remove("fade-out");
277
+ }, 300);
278
+ }
203
279
const toasts = document.querySelectorAll(
204
280
"[data-toast]",
205
281
) as NodeListOf<HTMLElement>;
0 commit comments