mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: allow scrolling on hero section
This commit is contained in:
1 parent
ba656eb603
commit
e6029157aa
2 files changed
+22
-8
No files matched your search
+18
-4
@@ -1,5 +1,5 @@
|
|||||||
import { TankType } from '@blitzkit/core';
|
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 { Var } from '../../../../../../core/radix/var';
|
||||||
import { useLocale } from '../../../../../../hooks/useLocale';
|
import { useLocale } from '../../../../../../hooks/useLocale';
|
||||||
import { Duel } from '../../../../../../stores/duel';
|
import { Duel } from '../../../../../../stores/duel';
|
||||||
@@ -87,13 +87,27 @@ export function Title({ foreground }: TitleProps) {
|
|||||||
? '2rem'
|
? '2rem'
|
||||||
: `min(65vh, ${125 / name.length}vw)`
|
: `min(65vh, ${125 / name.length}vw)`
|
||||||
: `min(48vh, ${75 / name.length}vw)`;
|
: `min(48vh, ${75 / name.length}vw)`;
|
||||||
|
const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Flex
|
||||||
|
onPointerDown={(event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
mutateTankopediaEphemeral((draft) => {
|
||||||
|
draft.disturbed = true;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
direction="column"
|
||||||
position="absolute"
|
position="absolute"
|
||||||
|
align="center"
|
||||||
|
justify="center"
|
||||||
top={disturbed ? '6rem' : '50%'}
|
top={disturbed ? '6rem' : '50%'}
|
||||||
left="50%"
|
left="50%"
|
||||||
|
width="100%"
|
||||||
|
height={disturbed ? fontSize : '100%'}
|
||||||
style={{
|
style={{
|
||||||
|
pointerEvents: disturbed ? 'none' : undefined,
|
||||||
transitionDuration: '1s',
|
transitionDuration: '1s',
|
||||||
transform: 'translate(-50%, -50%)',
|
transform: 'translate(-50%, -50%)',
|
||||||
}}
|
}}
|
||||||
@@ -109,7 +123,7 @@ export function Title({ foreground }: TitleProps) {
|
|||||||
opacity: foreground && disturbed ? 0 : 1,
|
opacity: foreground && disturbed ? 0 : 1,
|
||||||
letterSpacing: disturbed || !revealed ? 0 : '-0.03em',
|
letterSpacing: disturbed || !revealed ? 0 : '-0.03em',
|
||||||
transition: `
|
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,
|
font-size 1s,
|
||||||
-webkit-text-stroke 2s,
|
-webkit-text-stroke 2s,
|
||||||
opacity 1s
|
opacity 1s
|
||||||
@@ -121,6 +135,6 @@ export function Title({ foreground }: TitleProps) {
|
|||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
{!revealed && <Tracker fontSize={fontSize} />}
|
{!revealed && <Tracker fontSize={fontSize} />}
|
||||||
</Box>
|
</Flex>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -112,8 +112,6 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
top={isFullScreen ? '0' : undefined}
|
top={isFullScreen ? '0' : undefined}
|
||||||
left={isFullScreen ? '0' : undefined}
|
left={isFullScreen ? '0' : undefined}
|
||||||
>
|
>
|
||||||
<Title />
|
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
className="tank-sandbox-container"
|
className="tank-sandbox-container"
|
||||||
flexGrow="1"
|
flexGrow="1"
|
||||||
@@ -122,6 +120,8 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
position="relative"
|
position="relative"
|
||||||
>
|
>
|
||||||
<Box position="absolute" width="100%" height="100%" overflow="hidden">
|
<Box position="absolute" width="100%" height="100%" overflow="hidden">
|
||||||
|
<Title />
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
width="100%"
|
width="100%"
|
||||||
height="100%"
|
height="100%"
|
||||||
@@ -147,6 +147,8 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
|
<Title foreground />
|
||||||
|
|
||||||
<Options
|
<Options
|
||||||
skeleton={skeleton}
|
skeleton={skeleton}
|
||||||
canvas={canvas}
|
canvas={canvas}
|
||||||
@@ -154,8 +156,6 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Title foreground />
|
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user