From fcf30b7ef37bab10568570703dc655225813f249 Mon Sep 17 00:00:00 2001 From: Guilherme Rodz Date: Tue, 7 Jan 2025 11:26:02 -0300 Subject: [PATCH] chore(website): improve showcase ux --- .../(local-pages)/example-playground/code.tsx | 6 ++-- .../(pages)/(home)/_components/confetti.tsx | 19 ++++++++++- .../(pages)/(home)/_components/showcase.tsx | 9 ++++-- apps/website/tailwind.config.ts | 32 +++++++++++-------- 4 files changed, 45 insertions(+), 21 deletions(-) diff --git a/apps/website/src/app/(local-pages)/example-playground/code.tsx b/apps/website/src/app/(local-pages)/example-playground/code.tsx index 158560c..97fe4c4 100644 --- a/apps/website/src/app/(local-pages)/example-playground/code.tsx +++ b/apps/website/src/app/(local-pages)/example-playground/code.tsx @@ -98,16 +98,16 @@ ${tsx} export function ExampleCode() { return ( -
+
-
+
{/* Anchor */} -
+
) } diff --git a/apps/website/src/app/(pages)/(home)/_components/confetti.tsx b/apps/website/src/app/(pages)/(home)/_components/confetti.tsx index e2173c6..f84b93c 100644 --- a/apps/website/src/app/(pages)/(home)/_components/confetti.tsx +++ b/apps/website/src/app/(pages)/(home)/_components/confetti.tsx @@ -1,10 +1,27 @@ import VFX from 'react-canvas-confetti/dist/presets/explosion' -export function Confetti() { +export function Confetti({ + pageCoords = { x: window.innerWidth / 2, y: window.innerHeight / 2 }, +}: { + pageCoords?: { + x: number + y: number + } +}) { return ( ) } diff --git a/apps/website/src/app/(pages)/(home)/_components/showcase.tsx b/apps/website/src/app/(pages)/(home)/_components/showcase.tsx index ac3ba79..c31c096 100644 --- a/apps/website/src/app/(pages)/(home)/_components/showcase.tsx +++ b/apps/website/src/app/(pages)/(home)/_components/showcase.tsx @@ -64,7 +64,7 @@ export function Showcase({ className, ...props }: { className?: string }) { } const anchor = document.querySelector( - '.code-example-anchor', + '#code-example-anchor', ) window.scrollTo({ @@ -87,7 +87,10 @@ export function Showcase({ className, ...props }: { className?: string }) { )} {hasGuessed && (
- +
)} @@ -152,7 +155,7 @@ function Slot(props: {