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