Skip to content

Commit 5a29f2b

Browse files
committed
Fix styles
1 parent 8978300 commit 5a29f2b

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

src/components/index-page/what-is-graphql/wires.tsx

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,19 +482,38 @@ export function Wires({ className }: { className?: string }) {
482482

483483
const ref = useRef<SVGSVGElement>(null)
484484

485+
// set to true by manual interaction: we skip the next animation end
486+
// if the animation finishes right after the user's click
487+
const shouldAvoidDoubleSpin = useRef(false)
488+
485489
useEffect(() => {
486490
const animate = document.querySelector(
487491
"#paint_sr_pri_highlight_linear_671_9150 animate",
488492
)
489493

494+
const onAnimationRepeat = () => {
495+
if (shouldAvoidDoubleSpin.current) return
496+
inc()
497+
}
498+
490499
if (animate && animate instanceof SVGAnimateElement) {
491-
animate.addEventListener("repeatEvent", inc)
500+
animate.addEventListener("repeatEvent", onAnimationRepeat)
492501
}
493502

494-
return () => animate?.removeEventListener("repeatEvent", inc)
503+
return () => animate?.removeEventListener("repeatEvent", onAnimationRepeat)
495504
}, [])
496505

497-
const onBackgroundClick = useMemo(() => throttle(inc, 150), [])
506+
const onBackgroundClick = useMemo(
507+
() =>
508+
throttle(() => {
509+
inc()
510+
shouldAvoidDoubleSpin.current = true
511+
setTimeout(() => {
512+
shouldAvoidDoubleSpin.current = false
513+
}, 750)
514+
}, 500),
515+
[],
516+
)
498517

499518
return (
500519
<div className={clsx(className, "relative isolate", styles.wires)}>
@@ -547,7 +566,7 @@ export function Wires({ className }: { className?: string }) {
547566
step === 2
548567
? "[transform:rotateX(0deg)_translateY(0px)_translateZ(150px)]"
549568
: step === 1
550-
? "duration-0 [transform:rotateX(90deg)_translateY(60px)_translateZ(150px)]"
569+
? "!duration-0 [transform:rotateX(90deg)_translateY(60px)_translateZ(150px)]"
551570
: "[transform:rotateX(-90deg)_translateY(-60px)_translateZ(150px)]",
552571
)}
553572
>

src/nextra-theme-docs.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2977,6 +2977,12 @@ div:hover > .\[div\:hover\>\&\]\:_opacity-100 {
29772977

29782978
kbd._border._gap-1 {
29792979
border-bottom-width: 2px;
2980-
border-color: hsl(var(--color-neu-300));
29812980
gap: 0.125rem;
2981+
border-color: hsl(var(--color-neu-300));
2982+
color: hsl(var(--color-neu-700));
2983+
2984+
.dark & {
2985+
border-color: hsl(var(--color-neu-100) / 0.8);
2986+
color: hsl(var(--color-neu-500));
2987+
}
29822988
}

0 commit comments

Comments
 (0)