| 1 |
/** |
| 2 |
* King Addons Custom Cursor Styles |
| 3 |
* Provides styling for the custom cursor feature. |
| 4 |
*/ |
| 5 |
|
| 6 |
/* Main cursor container */ |
| 7 |
.ka-custom-cursor { |
| 8 |
position: fixed; |
| 9 |
top: 0; |
| 10 |
left: 0; |
| 11 |
width: var(--ka-cursor-size, 14px); |
| 12 |
height: var(--ka-cursor-size, 14px); |
| 13 |
pointer-events: none; |
| 14 |
z-index: 999999; |
| 15 |
background: transparent !important; |
| 16 |
border: none !important; |
| 17 |
outline: none !important; |
| 18 |
box-shadow: none; |
| 19 |
-webkit-tap-highlight-color: transparent; |
| 20 |
transform: translate3d(var(--ka-cursor-x, -9999px), var(--ka-cursor-y, -9999px), 0) scale(var(--ka-cursor-scale, 1)); |
| 21 |
opacity: var(--ka-cursor-opacity, 1); |
| 22 |
mix-blend-mode: var(--ka-cursor-mix-blend, normal); |
| 23 |
transition: transform 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94), |
| 24 |
opacity 0.2s ease; |
| 25 |
will-change: transform; |
| 26 |
} |
| 27 |
|
| 28 |
.ka-custom-cursor, |
| 29 |
.ka-custom-cursor *, |
| 30 |
.ka-custom-cursor::before, |
| 31 |
.ka-custom-cursor::after { |
| 32 |
outline: none !important; |
| 33 |
} |
| 34 |
|
| 35 |
/* Hidden state */ |
| 36 |
.ka-custom-cursor--hidden { |
| 37 |
opacity: 0 !important; |
| 38 |
pointer-events: none; |
| 39 |
} |
| 40 |
|
| 41 |
/* Inner and outer cursor elements */ |
| 42 |
.ka-custom-cursor__inner, |
| 43 |
.ka-custom-cursor__outer { |
| 44 |
position: absolute; |
| 45 |
inset: 0; |
| 46 |
border-radius: 50%; |
| 47 |
pointer-events: none; |
| 48 |
} |
| 49 |
|
| 50 |
/* Inner cursor (filled circle) */ |
| 51 |
.ka-custom-cursor__inner { |
| 52 |
background: var(--ka-cursor-fill, #111); |
| 53 |
filter: blur(var(--ka-cursor-blur, 0px)); |
| 54 |
transition: background 0.15s ease, |
| 55 |
filter 0.2s ease, |
| 56 |
transform 0.15s ease, |
| 57 |
box-shadow 0.15s ease, |
| 58 |
border-radius 0.15s ease; |
| 59 |
} |
| 60 |
|
| 61 |
/* Outer cursor (ring) */ |
| 62 |
.ka-custom-cursor__outer { |
| 63 |
border: var(--ka-cursor-border-width, 2px) solid var(--ka-cursor-border-color, #111); |
| 64 |
opacity: 0.9; |
| 65 |
transition: border-color 0.15s ease, |
| 66 |
border-width 0.15s ease, |
| 67 |
transform 0.15s ease, |
| 68 |
opacity 0.15s ease; |
| 69 |
} |
| 70 |
|
| 71 |
/* ========== Basic Types ========== */ |
| 72 |
|
| 73 |
/* Preset: Dot only (hide outer ring) */ |
| 74 |
.ka-custom-cursor--type-dot .ka-custom-cursor__outer { |
| 75 |
display: none; |
| 76 |
} |
| 77 |
|
| 78 |
/* Preset: Ring only (hide inner dot) */ |
| 79 |
.ka-custom-cursor--type-ring .ka-custom-cursor__inner { |
| 80 |
display: none; |
| 81 |
} |
| 82 |
|
| 83 |
/* Preset: Outline */ |
| 84 |
.ka-custom-cursor--type-outline .ka-custom-cursor__inner { |
| 85 |
background: transparent; |
| 86 |
border: var(--ka-cursor-border-width, 2px) solid var(--ka-cursor-fill, #111); |
| 87 |
} |
| 88 |
.ka-custom-cursor--type-outline .ka-custom-cursor__outer { |
| 89 |
display: none; |
| 90 |
} |
| 91 |
|
| 92 |
/* Preset: Crosshair */ |
| 93 |
.ka-custom-cursor--type-crosshair .ka-custom-cursor__inner { |
| 94 |
width: 4px !important; |
| 95 |
height: 4px !important; |
| 96 |
position: absolute; |
| 97 |
top: 50%; |
| 98 |
left: 50%; |
| 99 |
transform: translate(-50%, -50%); |
| 100 |
} |
| 101 |
.ka-custom-cursor--type-crosshair .ka-custom-cursor__outer { |
| 102 |
display: none; |
| 103 |
} |
| 104 |
.ka-custom-cursor--type-crosshair::before, |
| 105 |
.ka-custom-cursor--type-crosshair::after { |
| 106 |
content: ''; |
| 107 |
position: absolute; |
| 108 |
background: var(--ka-cursor-fill, #111); |
| 109 |
} |
| 110 |
.ka-custom-cursor--type-crosshair::before { |
| 111 |
width: 100%; |
| 112 |
height: 2px; |
| 113 |
top: 50%; |
| 114 |
left: 0; |
| 115 |
transform: translateY(-50%); |
| 116 |
} |
| 117 |
.ka-custom-cursor--type-crosshair::after { |
| 118 |
width: 2px; |
| 119 |
height: 100%; |
| 120 |
left: 50%; |
| 121 |
top: 0; |
| 122 |
transform: translateX(-50%); |
| 123 |
} |
| 124 |
|
| 125 |
/* Preset: Arrow */ |
| 126 |
.ka-custom-cursor--type-arrow .ka-custom-cursor__inner { |
| 127 |
background: transparent; |
| 128 |
width: 0 !important; |
| 129 |
height: 0 !important; |
| 130 |
border-style: solid; |
| 131 |
border-width: calc(var(--ka-cursor-size, 14px) * 0.8) calc(var(--ka-cursor-size, 14px) * 0.5) 0 calc(var(--ka-cursor-size, 14px) * 0.5); |
| 132 |
border-color: var(--ka-cursor-fill, #111) transparent transparent transparent; |
| 133 |
border-radius: 0; |
| 134 |
transform: rotate(-45deg); |
| 135 |
} |
| 136 |
.ka-custom-cursor--type-arrow .ka-custom-cursor__outer { |
| 137 |
display: none; |
| 138 |
} |
| 139 |
|
| 140 |
/* ========== Effect Types ========== */ |
| 141 |
|
| 142 |
/* Preset: Glow effect */ |
| 143 |
.ka-custom-cursor--type-glow .ka-custom-cursor__inner { |
| 144 |
box-shadow: 0 0 calc(var(--ka-cursor-size, 14px) * 0.8) calc(var(--ka-cursor-size, 14px) * 0.3) var(--ka-cursor-fill, #111); |
| 145 |
} |
| 146 |
.ka-custom-cursor--type-glow .ka-custom-cursor__outer { |
| 147 |
display: none; |
| 148 |
} |
| 149 |
|
| 150 |
/* Preset: Soft Glow */ |
| 151 |
.ka-custom-cursor--type-soft-glow .ka-custom-cursor__inner { |
| 152 |
filter: blur(calc(var(--ka-cursor-size, 14px) * 0.15)); |
| 153 |
box-shadow: 0 0 calc(var(--ka-cursor-size, 14px) * 1.2) calc(var(--ka-cursor-size, 14px) * 0.5) var(--ka-cursor-fill, #111); |
| 154 |
} |
| 155 |
.ka-custom-cursor--type-soft-glow .ka-custom-cursor__outer { |
| 156 |
display: none; |
| 157 |
} |
| 158 |
|
| 159 |
/* Preset: Neon */ |
| 160 |
.ka-custom-cursor--type-neon .ka-custom-cursor__inner { |
| 161 |
background: #fff; |
| 162 |
box-shadow: |
| 163 |
0 0 calc(var(--ka-cursor-size, 14px) * 0.3) var(--ka-cursor-fill, #111), |
| 164 |
0 0 calc(var(--ka-cursor-size, 14px) * 0.6) var(--ka-cursor-fill, #111), |
| 165 |
0 0 calc(var(--ka-cursor-size, 14px) * 1) var(--ka-cursor-fill, #111), |
| 166 |
0 0 calc(var(--ka-cursor-size, 14px) * 1.5) var(--ka-cursor-fill, #111); |
| 167 |
} |
| 168 |
.ka-custom-cursor--type-neon .ka-custom-cursor__outer { |
| 169 |
display: none; |
| 170 |
} |
| 171 |
|
| 172 |
/* Preset: Blend mode (difference) */ |
| 173 |
.ka-custom-cursor--type-blend { |
| 174 |
mix-blend-mode: difference; |
| 175 |
} |
| 176 |
.ka-custom-cursor--type-blend .ka-custom-cursor__inner { |
| 177 |
background: #fff; |
| 178 |
width: calc(var(--ka-cursor-size, 14px) * 1.5); |
| 179 |
height: calc(var(--ka-cursor-size, 14px) * 1.5); |
| 180 |
} |
| 181 |
.ka-custom-cursor--type-blend .ka-custom-cursor__outer { |
| 182 |
display: none; |
| 183 |
} |
| 184 |
|
| 185 |
/* Preset: Blob with smooth transitions */ |
| 186 |
.ka-custom-cursor--type-blob .ka-custom-cursor__inner { |
| 187 |
border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; |
| 188 |
width: calc(var(--ka-cursor-size, 14px) * 1.3); |
| 189 |
height: calc(var(--ka-cursor-size, 14px) * 1.3); |
| 190 |
animation: ka-cursor-blob-morph 4s ease-in-out infinite; |
| 191 |
} |
| 192 |
.ka-custom-cursor--type-blob .ka-custom-cursor__outer { |
| 193 |
display: none; |
| 194 |
} |
| 195 |
|
| 196 |
@keyframes ka-cursor-blob-morph { |
| 197 |
0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; } |
| 198 |
25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; } |
| 199 |
50% { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; } |
| 200 |
75% { border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%; } |
| 201 |
} |
| 202 |
|
| 203 |
/* Preset: Dual cursor */ |
| 204 |
.ka-custom-cursor--type-dual .ka-custom-cursor__outer { |
| 205 |
transform: scale(1.3); |
| 206 |
opacity: 0.55; |
| 207 |
transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); |
| 208 |
} |
| 209 |
.ka-custom-cursor--type-dual::after { |
| 210 |
content: ''; |
| 211 |
position: absolute; |
| 212 |
inset: -12px; |
| 213 |
border: 1px solid var(--ka-cursor-border-color, #111); |
| 214 |
border-radius: 50%; |
| 215 |
opacity: 0.25; |
| 216 |
} |
| 217 |
|
| 218 |
/* Preset: Gradient */ |
| 219 |
.ka-custom-cursor--type-gradient .ka-custom-cursor__inner { |
| 220 |
background: linear-gradient(135deg, var(--ka-cursor-fill, #111) 0%, var(--ka-cursor-border-color, #333) 100%); |
| 221 |
width: calc(var(--ka-cursor-size, 14px) * 1.2); |
| 222 |
height: calc(var(--ka-cursor-size, 14px) * 1.2); |
| 223 |
} |
| 224 |
.ka-custom-cursor--type-gradient .ka-custom-cursor__outer { |
| 225 |
display: none; |
| 226 |
} |
| 227 |
|
| 228 |
/* Preset: Image cursor */ |
| 229 |
.ka-custom-cursor--type-image .ka-custom-cursor__inner { |
| 230 |
background: var(--ka-cursor-image, none) no-repeat center center; |
| 231 |
background-size: contain; |
| 232 |
border-radius: 0; |
| 233 |
} |
| 234 |
.ka-custom-cursor--type-image .ka-custom-cursor__outer { |
| 235 |
display: none; |
| 236 |
} |
| 237 |
|
| 238 |
/* Preset: Magnetic cursor */ |
| 239 |
.ka-custom-cursor--type-magnetic .ka-custom-cursor__outer { |
| 240 |
transition: transform 0.25s ease; |
| 241 |
} |
| 242 |
|
| 243 |
/* Click ripple animation */ |
| 244 |
.ka-custom-cursor--ripple .ka-custom-cursor__inner { |
| 245 |
animation: ka-custom-cursor-ripple 0.35s ease-out; |
| 246 |
} |
| 247 |
|
| 248 |
@keyframes ka-custom-cursor-ripple { |
| 249 |
0% { |
| 250 |
transform: scale(1); |
| 251 |
opacity: 1; |
| 252 |
} |
| 253 |
80% { |
| 254 |
transform: scale(1.35); |
| 255 |
opacity: 0.25; |
| 256 |
} |
| 257 |
100% { |
| 258 |
transform: scale(1.6); |
| 259 |
opacity: 0; |
| 260 |
} |
| 261 |
} |
| 262 |
|
| 263 |
/* Click ripple (spread, not clipped by cursor) */ |
| 264 |
.ka-custom-cursor__click-ripple { |
| 265 |
position: fixed; |
| 266 |
z-index: 999998; |
| 267 |
width: 60px; |
| 268 |
height: 60px; |
| 269 |
border-radius: 999px; |
| 270 |
left: 0; |
| 271 |
top: 0; |
| 272 |
transform: scale(0); |
| 273 |
background: var(--ka-cursor-fill, #111); |
| 274 |
opacity: 0.4; |
| 275 |
pointer-events: none; |
| 276 |
animation: ka-custom-cursor-click-ripple 0.6s ease-out forwards; |
| 277 |
will-change: transform, opacity; |
| 278 |
mix-blend-mode: var(--ka-cursor-mix-blend, normal); |
| 279 |
} |
| 280 |
|
| 281 |
@keyframes ka-custom-cursor-click-ripple { |
| 282 |
0% { |
| 283 |
transform: scale(0); |
| 284 |
opacity: 0.5; |
| 285 |
} |
| 286 |
100% { |
| 287 |
transform: scale(2.5); |
| 288 |
opacity: 0; |
| 289 |
} |
| 290 |
} |
| 291 |
|
| 292 |
/* Cursor label */ |
| 293 |
.ka-custom-cursor__label { |
| 294 |
position: absolute; |
| 295 |
top: 50%; |
| 296 |
left: 50%; |
| 297 |
transform: translate(-50%, -50%); |
| 298 |
padding: 4px 10px; |
| 299 |
border-radius: 999px; |
| 300 |
background: rgba(0, 0, 0, 0.75); |
| 301 |
color: #fff; |
| 302 |
font-size: 11px; |
| 303 |
font-weight: 500; |
| 304 |
letter-spacing: 0.02em; |
| 305 |
line-height: 1.2; |
| 306 |
white-space: nowrap; |
| 307 |
opacity: 0; |
| 308 |
transition: opacity 0.15s ease; |
| 309 |
pointer-events: none; |
| 310 |
} |
| 311 |
|
| 312 |
.ka-custom-cursor__label.is-visible { |
| 313 |
opacity: 1; |
| 314 |
} |
| 315 |
|
| 316 |
/* Tail container */ |
| 317 |
.ka-custom-cursor__tail { |
| 318 |
position: fixed; |
| 319 |
inset: 0; |
| 320 |
pointer-events: none; |
| 321 |
z-index: 999998; |
| 322 |
} |
| 323 |
|
| 324 |
/* Tail dots */ |
| 325 |
.ka-custom-cursor__tail-dot { |
| 326 |
position: absolute; |
| 327 |
width: 8px; |
| 328 |
height: 8px; |
| 329 |
border-radius: 50%; |
| 330 |
margin-top: -4px; |
| 331 |
margin-left: -4px; |
| 332 |
background: var(--ka-cursor-fill, #111); |
| 333 |
transform: translate3d(-9999px, -9999px, 0); |
| 334 |
opacity: 0; |
| 335 |
transition: opacity 0.2s ease; |
| 336 |
will-change: transform, opacity; |
| 337 |
} |
| 338 |
|
| 339 |
/* Hide default cursor when custom cursor is enabled and hide_original_cursor is true */ |
| 340 |
body.ka-custom-cursor-enabled.ka-cursor-hide-original, |
| 341 |
body.ka-custom-cursor-enabled.ka-cursor-hide-original * { |
| 342 |
cursor: none !important; |
| 343 |
} |
| 344 |
|
| 345 |
/* Restore default cursor for inputs and text areas when hiding original */ |
| 346 |
body.ka-custom-cursor-enabled.ka-cursor-hide-original input, |
| 347 |
body.ka-custom-cursor-enabled.ka-cursor-hide-original textarea, |
| 348 |
body.ka-custom-cursor-enabled.ka-cursor-hide-original select, |
| 349 |
body.ka-custom-cursor-enabled.ka-cursor-hide-original [contenteditable="true"] { |
| 350 |
cursor: text !important; |
| 351 |
} |
| 352 |
|
| 353 |
body.ka-custom-cursor-enabled.ka-cursor-hide-original input[type="submit"], |
| 354 |
body.ka-custom-cursor-enabled.ka-cursor-hide-original input[type="button"], |
| 355 |
body.ka-custom-cursor-enabled.ka-cursor-hide-original input[type="reset"], |
| 356 |
body.ka-custom-cursor-enabled.ka-cursor-hide-original button { |
| 357 |
cursor: none !important; |
| 358 |
} |
| 359 |
|
| 360 |
/* When not hiding original cursor, custom cursor just follows alongside */ |
| 361 |
body.ka-custom-cursor-enabled:not(.ka-cursor-hide-original) { |
| 362 |
/* Keep default cursor visible, custom cursor follows it */ |
| 363 |
} |
| 364 |
|
| 365 |
/* State-based cursor styling */ |
| 366 |
.ka-custom-cursor[data-ka-state="hover"] .ka-custom-cursor__outer { |
| 367 |
transform: scale(1.1); |
| 368 |
} |
| 369 |
|
| 370 |
.ka-custom-cursor[data-ka-state="drag"] .ka-custom-cursor__inner { |
| 371 |
transform: scale(0.8); |
| 372 |
} |
| 373 |
|
| 374 |
.ka-custom-cursor[data-ka-state="zoom"] .ka-custom-cursor__inner::after { |
| 375 |
content: ''; |
| 376 |
position: absolute; |
| 377 |
inset: 25%; |
| 378 |
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") no-repeat center center; |
| 379 |
background-size: contain; |
| 380 |
opacity: 0.9; |
| 381 |
} |
| 382 |
|
| 383 |
/* Disable custom cursor on mobile/touch devices */ |
| 384 |
@media (max-width: 768px), (hover: none), (pointer: coarse) { |
| 385 |
body.ka-custom-cursor-enabled, |
| 386 |
body.ka-custom-cursor-enabled * { |
| 387 |
cursor: auto !important; |
| 388 |
} |
| 389 |
|
| 390 |
.ka-custom-cursor { |
| 391 |
display: none !important; |
| 392 |
} |
| 393 |
} |
| 394 |
|
| 395 |
/* Reduce motion for accessibility */ |
| 396 |
@media (prefers-reduced-motion: reduce) { |
| 397 |
.ka-custom-cursor, |
| 398 |
.ka-custom-cursor__inner, |
| 399 |
.ka-custom-cursor__outer, |
| 400 |
.ka-custom-cursor__label, |
| 401 |
.ka-custom-cursor__tail-dot { |
| 402 |
transition: none !important; |
| 403 |
animation: none !important; |
| 404 |
} |
| 405 |
} |
| 406 |
|