From e6029157aa9099e0b8333ee843e5bd564c3d8803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Sat, 9 Aug 2025 12:07:26 -0500 Subject: [PATCH] feat: allow scrolling on hero section --- .../components/TankSandbox/Title/index.tsx | 22 +++++++++++++++---- .../Tankopedia/HeroSection/index.tsx | 8 +++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx index 44d1b3bca..f6daad894 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx @@ -1,5 +1,5 @@ import { TankType } from '@blitzkit/core'; -import { Box, Heading } from '@radix-ui/themes'; +import { Flex, Heading } from '@radix-ui/themes'; import { Var } from '../../../../../../core/radix/var'; import { useLocale } from '../../../../../../hooks/useLocale'; import { Duel } from '../../../../../../stores/duel'; @@ -87,13 +87,27 @@ export function Title({ foreground }: TitleProps) { ? '2rem' : `min(65vh, ${125 / name.length}vw)` : `min(48vh, ${75 / name.length}vw)`; + const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation(); return ( - { + event.preventDefault(); + + mutateTankopediaEphemeral((draft) => { + draft.disturbed = true; + }); + }} + direction="column" position="absolute" + align="center" + justify="center" top={disturbed ? '6rem' : '50%'} left="50%" + width="100%" + height={disturbed ? fontSize : '100%'} style={{ + pointerEvents: disturbed ? 'none' : undefined, transitionDuration: '1s', transform: 'translate(-50%, -50%)', }} @@ -109,7 +123,7 @@ export function Title({ foreground }: TitleProps) { opacity: foreground && disturbed ? 0 : 1, letterSpacing: disturbed || !revealed ? 0 : '-0.03em', transition: ` - letter-spacing 1.5s ${disturbed ? '' : 'cubic-bezier(.81,-2,.68,1)'}, + letter-spacing 1.5s ${disturbed ? '' : 'cubic-bezier(0.81, -2, 0.68, 1)'}, font-size 1s, -webkit-text-stroke 2s, opacity 1s @@ -121,6 +135,6 @@ export function Title({ foreground }: TitleProps) { {!revealed && } - + ); } diff --git a/packages/website/src/components/Tankopedia/HeroSection/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/index.tsx index c4d478067..a91d6b893 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/index.tsx @@ -112,8 +112,6 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) { top={isFullScreen ? '0' : undefined} left={isFullScreen ? '0' : undefined} > - - <Box className="tank-sandbox-container" flexGrow="1" @@ -122,6 +120,8 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) { position="relative" > <Box position="absolute" width="100%" height="100%" overflow="hidden"> + <Title /> + <Box width="100%" height="100%" @@ -147,6 +147,8 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) { </Box> </Box> + <Title foreground /> + <Options skeleton={skeleton} canvas={canvas} @@ -154,8 +156,6 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) { /> </Box> </Box> - - <Title foreground /> </Flex> </Flex> );