| 1 |
/** |
| 2 |
* Fomo Notifications - Frontend CSS |
| 3 |
* Lightweight notification styles |
| 4 |
* |
| 5 |
* @package King_Addons |
| 6 |
*/ |
| 7 |
|
| 8 |
/* ============================================ |
| 9 |
CSS Variables |
| 10 |
============================================ */ |
| 11 |
|
| 12 |
:root { |
| 13 |
--kng-fomo-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif; |
| 14 |
--kng-fomo-z-index: 99999; |
| 15 |
} |
| 16 |
|
| 17 |
/* ============================================ |
| 18 |
Notification Container |
| 19 |
============================================ */ |
| 20 |
|
| 21 |
.kng-fomo-notification-wrap { |
| 22 |
position: fixed; |
| 23 |
z-index: var(--kng-fomo-z-index, 99999); |
| 24 |
pointer-events: none; |
| 25 |
font-family: var(--kng-fomo-font); |
| 26 |
-webkit-font-smoothing: antialiased; |
| 27 |
} |
| 28 |
|
| 29 |
/* Positions */ |
| 30 |
.kng-fomo-notification-wrap--bottom-left { |
| 31 |
bottom: 24px; |
| 32 |
left: 24px; |
| 33 |
} |
| 34 |
|
| 35 |
.kng-fomo-notification-wrap--bottom-right { |
| 36 |
bottom: 24px; |
| 37 |
right: 24px; |
| 38 |
} |
| 39 |
|
| 40 |
.kng-fomo-notification-wrap--top-left { |
| 41 |
top: 24px; |
| 42 |
left: 24px; |
| 43 |
} |
| 44 |
|
| 45 |
.kng-fomo-notification-wrap--top-right { |
| 46 |
top: 24px; |
| 47 |
right: 24px; |
| 48 |
} |
| 49 |
|
| 50 |
.kng-fomo-notification-wrap--bottom-center { |
| 51 |
bottom: 24px; |
| 52 |
left: 50%; |
| 53 |
transform: translateX(-50%); |
| 54 |
} |
| 55 |
|
| 56 |
.kng-fomo-notification-wrap--top-center { |
| 57 |
top: 24px; |
| 58 |
left: 50%; |
| 59 |
transform: translateX(-50%); |
| 60 |
} |
| 61 |
|
| 62 |
/* ============================================ |
| 63 |
Notification Card |
| 64 |
============================================ */ |
| 65 |
|
| 66 |
.kng-fomo-notification { |
| 67 |
display: flex; |
| 68 |
align-items: flex-start; |
| 69 |
gap: 14px; |
| 70 |
padding: 16px 18px; |
| 71 |
background: var(--kng-fomo-bg, #ffffff); |
| 72 |
color: var(--kng-fomo-text, #1d1d1f); |
| 73 |
border-radius: var(--kng-fomo-radius, 16px); |
| 74 |
max-width: 360px; |
| 75 |
min-width: 300px; |
| 76 |
pointer-events: auto; |
| 77 |
position: relative; |
| 78 |
opacity: 0; |
| 79 |
visibility: hidden; |
| 80 |
transform: translateY(20px); |
| 81 |
transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease; |
| 82 |
} |
| 83 |
|
| 84 |
.kng-fomo-notification.is-visible { |
| 85 |
opacity: 1; |
| 86 |
visibility: visible; |
| 87 |
transform: translateY(0); |
| 88 |
} |
| 89 |
|
| 90 |
/* Shadow variant */ |
| 91 |
.kng-fomo-notification--shadow { |
| 92 |
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); |
| 93 |
} |
| 94 |
|
| 95 |
/* Clickable */ |
| 96 |
.kng-fomo-notification--clickable { |
| 97 |
cursor: pointer; |
| 98 |
} |
| 99 |
|
| 100 |
.kng-fomo-notification--clickable:hover { |
| 101 |
transform: translateY(-2px); |
| 102 |
} |
| 103 |
|
| 104 |
/* ============================================ |
| 105 |
Animation Variants |
| 106 |
============================================ */ |
| 107 |
|
| 108 |
/* Slide animation */ |
| 109 |
.kng-fomo-notification--slide { |
| 110 |
transform: translateX(-100%); |
| 111 |
} |
| 112 |
|
| 113 |
.kng-fomo-notification-wrap--bottom-right .kng-fomo-notification--slide, |
| 114 |
.kng-fomo-notification-wrap--top-right .kng-fomo-notification--slide { |
| 115 |
transform: translateX(100%); |
| 116 |
} |
| 117 |
|
| 118 |
.kng-fomo-notification--slide.is-visible { |
| 119 |
transform: translateX(0); |
| 120 |
} |
| 121 |
|
| 122 |
/* Fade animation */ |
| 123 |
.kng-fomo-notification--fade { |
| 124 |
transform: none; |
| 125 |
} |
| 126 |
|
| 127 |
/* Bounce animation */ |
| 128 |
.kng-fomo-notification--bounce.is-visible { |
| 129 |
animation: kng-fomo-bounce 0.5s ease; |
| 130 |
} |
| 131 |
|
| 132 |
@keyframes kng-fomo-bounce { |
| 133 |
0% { transform: scale(0.8); opacity: 0; } |
| 134 |
50% { transform: scale(1.05); } |
| 135 |
100% { transform: scale(1); opacity: 1; } |
| 136 |
} |
| 137 |
|
| 138 |
/* Scale animation */ |
| 139 |
.kng-fomo-notification--scale { |
| 140 |
transform: scale(0.8); |
| 141 |
} |
| 142 |
|
| 143 |
.kng-fomo-notification--scale.is-visible { |
| 144 |
transform: scale(1); |
| 145 |
} |
| 146 |
|
| 147 |
/* ============================================ |
| 148 |
Notification Image |
| 149 |
============================================ */ |
| 150 |
|
| 151 |
.kng-fomo-notification__image { |
| 152 |
width: 56px; |
| 153 |
height: 56px; |
| 154 |
border-radius: 12px; |
| 155 |
overflow: hidden; |
| 156 |
flex-shrink: 0; |
| 157 |
background: rgba(0, 0, 0, 0.05); |
| 158 |
} |
| 159 |
|
| 160 |
.kng-fomo-notification__image img { |
| 161 |
width: 100%; |
| 162 |
height: 100%; |
| 163 |
object-fit: cover; |
| 164 |
display: block; |
| 165 |
} |
| 166 |
|
| 167 |
.kng-fomo-notification__image--avatar { |
| 168 |
border-radius: 50%; |
| 169 |
} |
| 170 |
|
| 171 |
/* ============================================ |
| 172 |
Notification Content |
| 173 |
============================================ */ |
| 174 |
|
| 175 |
.kng-fomo-notification__content { |
| 176 |
flex: 1; |
| 177 |
min-width: 0; |
| 178 |
} |
| 179 |
|
| 180 |
.kng-fomo-notification__title { |
| 181 |
font-size: 14px; |
| 182 |
font-weight: 600; |
| 183 |
color: var(--kng-fomo-text, #1d1d1f); |
| 184 |
margin: 0 0 4px; |
| 185 |
line-height: 1.4; |
| 186 |
} |
| 187 |
|
| 188 |
.kng-fomo-notification__message { |
| 189 |
font-size: 13px; |
| 190 |
color: var(--kng-fomo-text, #1d1d1f); |
| 191 |
opacity: 0.75; |
| 192 |
margin: 0; |
| 193 |
line-height: 1.4; |
| 194 |
overflow: hidden; |
| 195 |
text-overflow: ellipsis; |
| 196 |
display: -webkit-box; |
| 197 |
-webkit-line-clamp: 2; |
| 198 |
-webkit-box-orient: vertical; |
| 199 |
} |
| 200 |
|
| 201 |
.kng-fomo-notification__time { |
| 202 |
font-size: 11px; |
| 203 |
color: var(--kng-fomo-accent, #0071e3); |
| 204 |
margin-top: 8px; |
| 205 |
display: flex; |
| 206 |
align-items: center; |
| 207 |
gap: 4px; |
| 208 |
} |
| 209 |
|
| 210 |
.kng-fomo-notification__time svg { |
| 211 |
width: 12px; |
| 212 |
height: 12px; |
| 213 |
} |
| 214 |
|
| 215 |
/* ============================================ |
| 216 |
Call to Action |
| 217 |
============================================ */ |
| 218 |
|
| 219 |
.kng-fomo-notification__cta { |
| 220 |
display: inline-flex; |
| 221 |
align-items: center; |
| 222 |
gap: 4px; |
| 223 |
margin-top: 10px; |
| 224 |
padding: 6px 12px; |
| 225 |
font-size: 12px; |
| 226 |
font-weight: 500; |
| 227 |
color: #ffffff; |
| 228 |
background: var(--kng-fomo-accent, #0071e3); |
| 229 |
border-radius: 100px; |
| 230 |
text-decoration: none; |
| 231 |
transition: opacity 0.2s ease; |
| 232 |
} |
| 233 |
|
| 234 |
.kng-fomo-notification__cta:hover { |
| 235 |
opacity: 0.9; |
| 236 |
} |
| 237 |
|
| 238 |
.kng-fomo-notification__cta svg { |
| 239 |
width: 12px; |
| 240 |
height: 12px; |
| 241 |
} |
| 242 |
|
| 243 |
/* ============================================ |
| 244 |
Close Button |
| 245 |
============================================ */ |
| 246 |
|
| 247 |
.kng-fomo-notification__close { |
| 248 |
position: absolute; |
| 249 |
top: 8px; |
| 250 |
right: 8px; |
| 251 |
width: 24px; |
| 252 |
height: 24px; |
| 253 |
display: flex; |
| 254 |
align-items: center; |
| 255 |
justify-content: center; |
| 256 |
background: rgba(0, 0, 0, 0.05); |
| 257 |
border: none; |
| 258 |
border-radius: 50%; |
| 259 |
cursor: pointer; |
| 260 |
opacity: 0; |
| 261 |
transition: opacity 0.2s ease, background 0.2s ease; |
| 262 |
padding: 0; |
| 263 |
} |
| 264 |
|
| 265 |
.kng-fomo-notification:hover .kng-fomo-notification__close { |
| 266 |
opacity: 1; |
| 267 |
} |
| 268 |
|
| 269 |
.kng-fomo-notification__close:hover { |
| 270 |
background: rgba(0, 0, 0, 0.1); |
| 271 |
} |
| 272 |
|
| 273 |
.kng-fomo-notification__close svg { |
| 274 |
width: 12px; |
| 275 |
height: 12px; |
| 276 |
color: var(--kng-fomo-text, #1d1d1f); |
| 277 |
opacity: 0.6; |
| 278 |
} |
| 279 |
|
| 280 |
/* ============================================ |
| 281 |
Notification Bar (Top/Bottom Bar) |
| 282 |
============================================ */ |
| 283 |
|
| 284 |
.kng-fomo-bar { |
| 285 |
position: fixed; |
| 286 |
left: 0; |
| 287 |
right: 0; |
| 288 |
z-index: var(--kng-fomo-z-index, 99999); |
| 289 |
display: flex; |
| 290 |
align-items: center; |
| 291 |
justify-content: center; |
| 292 |
gap: 16px; |
| 293 |
padding: 14px 24px; |
| 294 |
background: var(--kng-fomo-bg, #1d1d1f); |
| 295 |
color: var(--kng-fomo-text, #ffffff); |
| 296 |
font-family: var(--kng-fomo-font); |
| 297 |
font-size: 14px; |
| 298 |
text-align: center; |
| 299 |
transform: translateY(-100%); |
| 300 |
transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1); |
| 301 |
} |
| 302 |
|
| 303 |
.kng-fomo-bar--top { |
| 304 |
top: 0; |
| 305 |
transform: translateY(-100%); |
| 306 |
} |
| 307 |
|
| 308 |
.kng-fomo-bar--bottom { |
| 309 |
bottom: 0; |
| 310 |
top: auto; |
| 311 |
transform: translateY(100%); |
| 312 |
} |
| 313 |
|
| 314 |
.kng-fomo-bar.is-visible { |
| 315 |
transform: translateY(0); |
| 316 |
} |
| 317 |
|
| 318 |
.kng-fomo-bar__message { |
| 319 |
margin: 0; |
| 320 |
line-height: 1.4; |
| 321 |
} |
| 322 |
|
| 323 |
.kng-fomo-bar__cta { |
| 324 |
display: inline-flex; |
| 325 |
align-items: center; |
| 326 |
gap: 6px; |
| 327 |
padding: 8px 16px; |
| 328 |
font-size: 13px; |
| 329 |
font-weight: 500; |
| 330 |
color: var(--kng-fomo-bg, #1d1d1f); |
| 331 |
background: var(--kng-fomo-text, #ffffff); |
| 332 |
border-radius: 100px; |
| 333 |
text-decoration: none; |
| 334 |
flex-shrink: 0; |
| 335 |
transition: opacity 0.2s ease; |
| 336 |
} |
| 337 |
|
| 338 |
.kng-fomo-bar__cta:hover { |
| 339 |
opacity: 0.9; |
| 340 |
} |
| 341 |
|
| 342 |
.kng-fomo-bar__close { |
| 343 |
position: absolute; |
| 344 |
right: 16px; |
| 345 |
width: 28px; |
| 346 |
height: 28px; |
| 347 |
display: flex; |
| 348 |
align-items: center; |
| 349 |
justify-content: center; |
| 350 |
background: rgba(255, 255, 255, 0.1); |
| 351 |
border: none; |
| 352 |
border-radius: 50%; |
| 353 |
cursor: pointer; |
| 354 |
transition: background 0.2s ease; |
| 355 |
padding: 0; |
| 356 |
} |
| 357 |
|
| 358 |
.kng-fomo-bar__close:hover { |
| 359 |
background: rgba(255, 255, 255, 0.2); |
| 360 |
} |
| 361 |
|
| 362 |
.kng-fomo-bar__close svg { |
| 363 |
width: 14px; |
| 364 |
height: 14px; |
| 365 |
color: currentColor; |
| 366 |
} |
| 367 |
|
| 368 |
/* ============================================ |
| 369 |
Responsive |
| 370 |
============================================ */ |
| 371 |
|
| 372 |
@media (max-width: 480px) { |
| 373 |
.kng-fomo-notification-wrap { |
| 374 |
left: 12px !important; |
| 375 |
right: 12px !important; |
| 376 |
bottom: 12px !important; |
| 377 |
top: auto !important; |
| 378 |
transform: none !important; |
| 379 |
} |
| 380 |
|
| 381 |
.kng-fomo-notification { |
| 382 |
max-width: 100%; |
| 383 |
min-width: auto; |
| 384 |
} |
| 385 |
|
| 386 |
.kng-fomo-bar { |
| 387 |
padding: 12px 48px 12px 16px; |
| 388 |
font-size: 13px; |
| 389 |
flex-wrap: wrap; |
| 390 |
} |
| 391 |
|
| 392 |
.kng-fomo-bar__cta { |
| 393 |
padding: 6px 12px; |
| 394 |
font-size: 12px; |
| 395 |
} |
| 396 |
} |
| 397 |
|
| 398 |
/* ============================================ |
| 399 |
Progress Bar (countdown) |
| 400 |
============================================ */ |
| 401 |
|
| 402 |
.kng-fomo-notification__progress { |
| 403 |
position: absolute; |
| 404 |
bottom: 0; |
| 405 |
left: 0; |
| 406 |
right: 0; |
| 407 |
height: 3px; |
| 408 |
background: rgba(0, 0, 0, 0.06); |
| 409 |
border-radius: 0 0 var(--kng-fomo-radius, 16px) var(--kng-fomo-radius, 16px); |
| 410 |
overflow: hidden; |
| 411 |
} |
| 412 |
|
| 413 |
.kng-fomo-notification__progress-bar { |
| 414 |
height: 100%; |
| 415 |
width: 100%; |
| 416 |
background: var(--kng-fomo-accent, #0071e3); |
| 417 |
border-radius: inherit; |
| 418 |
will-change: width; |
| 419 |
} |
| 420 |
|
| 421 |
/* ============================================ |
| 422 |
Body padding transition (for bars) |
| 423 |
============================================ */ |
| 424 |
|
| 425 |
body.has-kng-fomo-bar-top, |
| 426 |
body.has-kng-fomo-bar-bottom { |
| 427 |
transition: padding 0.4s cubic-bezier(0.25, 0.1, 0.25, 1); |
| 428 |
} |
| 429 |
|
| 430 |
/* ============================================ |
| 431 |
Print - Hide notifications |
| 432 |
============================================ */ |
| 433 |
|
| 434 |
@media print { |
| 435 |
.kng-fomo-notification-wrap, |
| 436 |
.kng-fomo-bar { |
| 437 |
display: none !important; |
| 438 |
} |
| 439 |
} |
| 440 |
|
| 441 |
/* ============================================ |
| 442 |
Reduced Motion |
| 443 |
============================================ */ |
| 444 |
|
| 445 |
@media (prefers-reduced-motion: reduce) { |
| 446 |
.kng-fomo-notification, |
| 447 |
.kng-fomo-bar { |
| 448 |
transition: opacity 0.15s ease; |
| 449 |
transform: none !important; |
| 450 |
} |
| 451 |
|
| 452 |
.kng-fomo-notification--bounce.is-visible { |
| 453 |
animation: none; |
| 454 |
} |
| 455 |
} |
| 456 |
|