| 1 |
/** |
| 2 |
* Sticky Contact Bar - Frontend Styles |
| 3 |
* |
| 4 |
* @package King_Addons |
| 5 |
*/ |
| 6 |
|
| 7 |
/* Base bar styles */ |
| 8 |
.ka-sticky-contact-bar { |
| 9 |
position: fixed; |
| 10 |
z-index: var(--ka-scbar-z, 9999); |
| 11 |
background: var(--ka-scbar-bg, rgba(20, 20, 20, 0.95)); |
| 12 |
border-radius: var(--ka-scbar-radius, 14px); |
| 13 |
box-shadow: var(--ka-scbar-shadow, 0 10px 30px rgba(0, 0, 0, 0.18)); |
| 14 |
color: #fff; |
| 15 |
transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); |
| 16 |
opacity: 0; |
| 17 |
pointer-events: none; |
| 18 |
max-width: 94vw; |
| 19 |
-webkit-backdrop-filter: blur(10px); |
| 20 |
backdrop-filter: blur(10px); |
| 21 |
} |
| 22 |
|
| 23 |
.ka-sticky-contact-bar.is-visible { |
| 24 |
opacity: 1; |
| 25 |
pointer-events: auto; |
| 26 |
} |
| 27 |
|
| 28 |
.ka-sticky-contact-bar.is-hidden { |
| 29 |
opacity: 0; |
| 30 |
pointer-events: none; |
| 31 |
} |
| 32 |
|
| 33 |
.ka-sticky-contact-bar__inner { |
| 34 |
display: flex; |
| 35 |
gap: var(--ka-scbar-gap, 10px); |
| 36 |
align-items: center; |
| 37 |
padding: 10px; |
| 38 |
} |
| 39 |
|
| 40 |
/* Bottom position */ |
| 41 |
.ka-position-bottom { |
| 42 |
left: 50%; |
| 43 |
transform: translate(-50%, 20px); |
| 44 |
bottom: calc(12px + env(safe-area-inset-bottom, 0px)); |
| 45 |
width: auto; |
| 46 |
} |
| 47 |
|
| 48 |
.ka-position-bottom.is-visible { |
| 49 |
transform: translate(-50%, 0); |
| 50 |
} |
| 51 |
|
| 52 |
.ka-position-bottom.is-hidden { |
| 53 |
transform: translate(-50%, 100%); |
| 54 |
} |
| 55 |
|
| 56 |
/* Left/Right positions */ |
| 57 |
.ka-position-left, |
| 58 |
.ka-position-right { |
| 59 |
top: 50%; |
| 60 |
transform: translateY(-50%); |
| 61 |
transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); |
| 62 |
} |
| 63 |
|
| 64 |
.ka-position-left { |
| 65 |
left: 16px; |
| 66 |
} |
| 67 |
|
| 68 |
.ka-position-left.is-hidden { |
| 69 |
transform: translateY(-50%) translateX(-100%); |
| 70 |
} |
| 71 |
|
| 72 |
.ka-position-right { |
| 73 |
right: 16px; |
| 74 |
} |
| 75 |
|
| 76 |
.ka-position-right.is-hidden { |
| 77 |
transform: translateY(-50%) translateX(100%); |
| 78 |
} |
| 79 |
|
| 80 |
.ka-position-left .ka-sticky-contact-bar__inner, |
| 81 |
.ka-position-right .ka-sticky-contact-bar__inner { |
| 82 |
flex-direction: column; |
| 83 |
} |
| 84 |
|
| 85 |
/* Alignment for bottom position */ |
| 86 |
.ka-align-left.ka-position-bottom { |
| 87 |
left: 16px; |
| 88 |
right: auto; |
| 89 |
transform: translate(0, 20px); |
| 90 |
} |
| 91 |
|
| 92 |
.ka-align-right.ka-position-bottom { |
| 93 |
left: auto; |
| 94 |
right: 16px; |
| 95 |
transform: translate(0, 20px); |
| 96 |
} |
| 97 |
|
| 98 |
.ka-align-center.ka-position-bottom { |
| 99 |
left: 50%; |
| 100 |
right: auto; |
| 101 |
} |
| 102 |
|
| 103 |
.ka-align-left.ka-position-bottom.is-visible, |
| 104 |
.ka-align-right.ka-position-bottom.is-visible { |
| 105 |
transform: translate(0, 0); |
| 106 |
} |
| 107 |
|
| 108 |
.ka-align-left.ka-position-bottom.is-hidden, |
| 109 |
.ka-align-right.ka-position-bottom.is-hidden { |
| 110 |
transform: translate(0, 100%); |
| 111 |
} |
| 112 |
|
| 113 |
/* Contact item buttons */ |
| 114 |
.ka-sticky-contact-item { |
| 115 |
width: var(--ka-scbar-size, 48px); |
| 116 |
height: var(--ka-scbar-size, 48px); |
| 117 |
display: inline-flex; |
| 118 |
align-items: center; |
| 119 |
justify-content: center; |
| 120 |
position: relative; |
| 121 |
background: var(--ka-scbar-item-bg, #111); |
| 122 |
color: var(--ka-scbar-icon-color, #fff); |
| 123 |
text-decoration: none; |
| 124 |
transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; |
| 125 |
flex-shrink: 0; |
| 126 |
} |
| 127 |
|
| 128 |
.ka-sticky-contact-item:hover, |
| 129 |
.ka-sticky-contact-item:focus-visible { |
| 130 |
background: var(--ka-scbar-item-bg-hover, var(--ka-scbar-item-bg, #111)); |
| 131 |
color: var(--ka-scbar-icon-color-hover, var(--ka-scbar-icon-color, #fff)); |
| 132 |
transform: translateY(-3px); |
| 133 |
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); |
| 134 |
} |
| 135 |
|
| 136 |
.ka-sticky-contact-item:focus-visible { |
| 137 |
outline: 2px solid #fff; |
| 138 |
outline-offset: 2px; |
| 139 |
} |
| 140 |
|
| 141 |
/* Icon container */ |
| 142 |
.ka-sticky-contact-icon { |
| 143 |
display: flex; |
| 144 |
align-items: center; |
| 145 |
justify-content: center; |
| 146 |
line-height: 1; |
| 147 |
} |
| 148 |
|
| 149 |
/* Icon sizing - FontAwesome/icon fonts */ |
| 150 |
.ka-sticky-contact-item i { |
| 151 |
font-size: calc(var(--ka-scbar-size, 48px) * 0.45); |
| 152 |
} |
| 153 |
|
| 154 |
/* Icon sizing - SVG */ |
| 155 |
.ka-sticky-contact-icon svg { |
| 156 |
width: calc(var(--ka-scbar-size, 48px) * 0.45); |
| 157 |
height: calc(var(--ka-scbar-size, 48px) * 0.45); |
| 158 |
fill: currentColor; |
| 159 |
flex-shrink: 0; |
| 160 |
} |
| 161 |
|
| 162 |
/* Shape variants */ |
| 163 |
.ka-shape-circle .ka-sticky-contact-item { |
| 164 |
border-radius: 999px; |
| 165 |
} |
| 166 |
|
| 167 |
.ka-shape-rounded .ka-sticky-contact-item { |
| 168 |
border-radius: 12px; |
| 169 |
} |
| 170 |
|
| 171 |
.ka-shape-square .ka-sticky-contact-item { |
| 172 |
border-radius: 6px; |
| 173 |
} |
| 174 |
|
| 175 |
/* Label tooltip - Left/Right positions */ |
| 176 |
.ka-sticky-contact-item__label { |
| 177 |
position: absolute; |
| 178 |
white-space: nowrap; |
| 179 |
padding: 6px 12px; |
| 180 |
background: rgba(0, 0, 0, 0.9); |
| 181 |
color: #fff; |
| 182 |
border-radius: 6px; |
| 183 |
font-size: 12px; |
| 184 |
font-weight: 500; |
| 185 |
opacity: 0; |
| 186 |
pointer-events: none; |
| 187 |
transition: opacity 0.2s ease, transform 0.2s ease; |
| 188 |
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); |
| 189 |
} |
| 190 |
|
| 191 |
/* Left position - label on right side */ |
| 192 |
.ka-position-left .ka-sticky-contact-item__label { |
| 193 |
left: 100%; |
| 194 |
margin-left: 10px; |
| 195 |
top: 50%; |
| 196 |
transform: translateY(-50%) translateX(6px); |
| 197 |
} |
| 198 |
|
| 199 |
/* Right position - label on left side */ |
| 200 |
.ka-position-right .ka-sticky-contact-item__label { |
| 201 |
right: 100%; |
| 202 |
left: auto; |
| 203 |
margin-right: 10px; |
| 204 |
top: 50%; |
| 205 |
transform: translateY(-50%) translateX(-6px); |
| 206 |
} |
| 207 |
|
| 208 |
/* Bottom position - label on top */ |
| 209 |
.ka-position-bottom .ka-sticky-contact-item__label { |
| 210 |
bottom: 100%; |
| 211 |
left: 50%; |
| 212 |
top: auto; |
| 213 |
margin-bottom: 8px; |
| 214 |
margin-left: 0; |
| 215 |
margin-right: 0; |
| 216 |
transform: translateX(-50%) translateY(6px); |
| 217 |
} |
| 218 |
|
| 219 |
/* Show label on hover */ |
| 220 |
.ka-sticky-contact-item--label-visible:hover .ka-sticky-contact-item__label, |
| 221 |
.ka-sticky-contact-item--label-visible:focus-visible .ka-sticky-contact-item__label { |
| 222 |
opacity: 1; |
| 223 |
} |
| 224 |
|
| 225 |
.ka-position-left .ka-sticky-contact-item--label-visible:hover .ka-sticky-contact-item__label, |
| 226 |
.ka-position-left .ka-sticky-contact-item--label-visible:focus-visible .ka-sticky-contact-item__label { |
| 227 |
transform: translateY(-50%) translateX(0); |
| 228 |
} |
| 229 |
|
| 230 |
.ka-position-right .ka-sticky-contact-item--label-visible:hover .ka-sticky-contact-item__label, |
| 231 |
.ka-position-right .ka-sticky-contact-item--label-visible:focus-visible .ka-sticky-contact-item__label { |
| 232 |
transform: translateY(-50%) translateX(0); |
| 233 |
} |
| 234 |
|
| 235 |
.ka-position-bottom .ka-sticky-contact-item--label-visible:hover .ka-sticky-contact-item__label, |
| 236 |
.ka-position-bottom .ka-sticky-contact-item--label-visible:focus-visible .ka-sticky-contact-item__label { |
| 237 |
transform: translateX(-50%) translateY(0); |
| 238 |
} |
| 239 |
|
| 240 |
/* Badge */ |
| 241 |
.ka-sticky-contact-item__badge { |
| 242 |
position: absolute; |
| 243 |
top: -6px; |
| 244 |
right: -6px; |
| 245 |
background: #ff3b30; |
| 246 |
color: #fff; |
| 247 |
border-radius: 999px; |
| 248 |
padding: 3px 7px; |
| 249 |
font-size: 10px; |
| 250 |
font-weight: 600; |
| 251 |
line-height: 1; |
| 252 |
min-width: 16px; |
| 253 |
text-align: center; |
| 254 |
box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4); |
| 255 |
animation: ka-badge-bounce 0.3s ease; |
| 256 |
} |
| 257 |
|
| 258 |
@keyframes ka-badge-bounce { |
| 259 |
0% { transform: scale(0); } |
| 260 |
50% { transform: scale(1.2); } |
| 261 |
100% { transform: scale(1); } |
| 262 |
} |
| 263 |
|
| 264 |
/* Pulse effect */ |
| 265 |
.ka-sticky-contact-item--pulse::before { |
| 266 |
content: ''; |
| 267 |
position: absolute; |
| 268 |
inset: 0; |
| 269 |
border-radius: inherit; |
| 270 |
background: currentColor; |
| 271 |
opacity: 0; |
| 272 |
animation: ka-scbar-pulse 2s ease-out infinite; |
| 273 |
pointer-events: none; |
| 274 |
} |
| 275 |
|
| 276 |
@keyframes ka-scbar-pulse { |
| 277 |
0% { |
| 278 |
transform: scale(1); |
| 279 |
opacity: 0.4; |
| 280 |
} |
| 281 |
50% { |
| 282 |
transform: scale(1.5); |
| 283 |
opacity: 0; |
| 284 |
} |
| 285 |
100% { |
| 286 |
transform: scale(1.5); |
| 287 |
opacity: 0; |
| 288 |
} |
| 289 |
} |
| 290 |
|
| 291 |
/* Device visibility */ |
| 292 |
.ka-mobile-only { |
| 293 |
display: none !important; |
| 294 |
} |
| 295 |
|
| 296 |
.ka-desktop-only { |
| 297 |
display: inline-flex !important; |
| 298 |
} |
| 299 |
|
| 300 |
/* Default button colors by type */ |
| 301 |
.ka-type-whatsapp { |
| 302 |
--ka-scbar-item-bg: #25D366; |
| 303 |
--ka-scbar-item-bg-hover: #1da851; |
| 304 |
} |
| 305 |
|
| 306 |
.ka-type-telegram { |
| 307 |
--ka-scbar-item-bg: #0088cc; |
| 308 |
--ka-scbar-item-bg-hover: #006daa; |
| 309 |
} |
| 310 |
|
| 311 |
.ka-type-messenger { |
| 312 |
--ka-scbar-item-bg: #0084ff; |
| 313 |
--ka-scbar-item-bg-hover: #006acc; |
| 314 |
} |
| 315 |
|
| 316 |
.ka-type-viber { |
| 317 |
--ka-scbar-item-bg: #7360f2; |
| 318 |
--ka-scbar-item-bg-hover: #5a48d5; |
| 319 |
} |
| 320 |
|
| 321 |
.ka-type-phone { |
| 322 |
--ka-scbar-item-bg: #34c759; |
| 323 |
--ka-scbar-item-bg-hover: #2aa147; |
| 324 |
} |
| 325 |
|
| 326 |
.ka-type-email { |
| 327 |
--ka-scbar-item-bg: #5856d6; |
| 328 |
--ka-scbar-item-bg-hover: #4644b3; |
| 329 |
} |
| 330 |
|
| 331 |
/* Reduced motion */ |
| 332 |
@media (prefers-reduced-motion: reduce) { |
| 333 |
.ka-sticky-contact-bar, |
| 334 |
.ka-sticky-contact-item, |
| 335 |
.ka-sticky-contact-item__label, |
| 336 |
.ka-sticky-contact-item__badge { |
| 337 |
transition: none; |
| 338 |
animation: none; |
| 339 |
} |
| 340 |
|
| 341 |
.ka-sticky-contact-item--pulse::before { |
| 342 |
animation: none; |
| 343 |
display: none; |
| 344 |
} |
| 345 |
} |
| 346 |
|
| 347 |
/* Mobile styles */ |
| 348 |
@media (max-width: 767px) { |
| 349 |
.ka-mobile-only { |
| 350 |
display: inline-flex !important; |
| 351 |
} |
| 352 |
|
| 353 |
.ka-desktop-only { |
| 354 |
display: none !important; |
| 355 |
} |
| 356 |
|
| 357 |
.ka-sticky-contact-bar__inner { |
| 358 |
padding: 8px 10px; |
| 359 |
} |
| 360 |
|
| 361 |
.ka-position-bottom { |
| 362 |
bottom: calc(14px + env(safe-area-inset-bottom, 0px)); |
| 363 |
max-width: calc(100vw - 32px); |
| 364 |
} |
| 365 |
|
| 366 |
.ka-position-left { |
| 367 |
left: 10px; |
| 368 |
} |
| 369 |
|
| 370 |
.ka-position-right { |
| 371 |
right: 10px; |
| 372 |
} |
| 373 |
|
| 374 |
/* Adjust item size on mobile */ |
| 375 |
.ka-sticky-contact-item { |
| 376 |
width: var(--ka-scbar-size-mobile, var(--ka-scbar-size, 44px)); |
| 377 |
height: var(--ka-scbar-size-mobile, var(--ka-scbar-size, 44px)); |
| 378 |
} |
| 379 |
} |
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|