Skip to content

Commit 2c31af7

Browse files
committed
add Curtain
1 parent 10f0bc5 commit 2c31af7

File tree

1 file changed

+16
-0
lines changed
  • src/components/index-page/what-is-graphql

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ export function Wires({ className }: { className?: string }) {
544544
aria-label={step === 2 ? "Show query again" : "Next step"}
545545
className="absolute inset-0 outline-none"
546546
/>
547+
547548
<div
548549
aria-hidden={step === 2}
549550
className={clsx(
@@ -565,6 +566,7 @@ export function Wires({ className }: { className?: string }) {
565566
<div
566567
aria-hidden={step !== 2}
567568
className={clsx(
569+
"[&_pre]:[anchor-name:--response-pre]",
568570
"pointer-events-none absolute inset-0 transition duration-[600ms]",
569571
styles.highlightsResponse,
570572
step === 2
@@ -576,6 +578,7 @@ export function Wires({ className }: { className?: string }) {
576578
>
577579
<ResponseMdx components={components} />
578580
</div>
581+
<Curtain />
579582
</div>
580583
)
581584
}
@@ -586,3 +589,16 @@ function moveHighlightedToTop(index: number | undefined, nodes: ReactNode[]) {
586589
newNodes.push(nodes[index] as ReactNode)
587590
return newNodes
588591
}
592+
593+
function Curtain() {
594+
return (
595+
<div
596+
// we obscure part of the rotation with gradient so it's not garish
597+
className="pointer-events-none absolute bottom-0 left-[anchor(left)] right-[anchor(right)] z-[2] h-[calc((100%-anchor-size(height))/2)] -translate-x-1/2 [position-anchor:--response-pre] max-md:hidden"
598+
style={{
599+
background:
600+
"linear-gradient(to bottom, hsl(var(--color-neu-0)/0), hsl(var(--color-neu-0)) 50%)",
601+
}}
602+
/>
603+
)
604+
}

0 commit comments

Comments
 (0)