mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-06 00:03:50 +01:00
feat: fullscreen
This commit is contained in:
1 parent
f9c182e68c
commit
d2e7a477bb
2 files changed
+44
-20
No files matched your search
+41
-11
@@ -90,6 +90,7 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
const mutateTankopediaPersistent = TankopediaPersistent.useMutation();
|
const mutateTankopediaPersistent = TankopediaPersistent.useMutation();
|
||||||
const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation();
|
const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation();
|
||||||
const { strings, unwrap } = useLocale();
|
const { strings, unwrap } = useLocale();
|
||||||
|
const revealed = TankopediaEphemeral.use((state) => state.revealed);
|
||||||
const disturbed = TankopediaEphemeral.use((state) => state.disturbed);
|
const disturbed = TankopediaEphemeral.use((state) => state.disturbed);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -324,7 +325,7 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
direction="column"
|
direction="column"
|
||||||
align="center"
|
align="center"
|
||||||
position="absolute"
|
position="absolute"
|
||||||
bottom={disturbed ? '4' : '-100%'}
|
bottom={revealed ? '4' : '-100%'}
|
||||||
left="50%"
|
left="50%"
|
||||||
style={{ transform: 'translateX(-50%)', transitionDuration: '200ms' }}
|
style={{ transform: 'translateX(-50%)', transitionDuration: '200ms' }}
|
||||||
>
|
>
|
||||||
@@ -401,7 +402,7 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
|
|
||||||
<Flex gap="3" align="center" mt="2">
|
<Flex gap="3" align="center" mt="2">
|
||||||
<SegmentedControl.Root
|
<SegmentedControl.Root
|
||||||
value={`${display}`}
|
value={`${disturbed ? display : -1}`}
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
mutateTankopediaEphemeral((draft) => {
|
mutateTankopediaEphemeral((draft) => {
|
||||||
draft.disturbed = true;
|
draft.disturbed = true;
|
||||||
@@ -455,6 +456,8 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
</SegmentedControl.Item> */}
|
</SegmentedControl.Item> */}
|
||||||
</SegmentedControl.Root>
|
</SegmentedControl.Root>
|
||||||
|
|
||||||
|
{disturbed && (
|
||||||
|
<>
|
||||||
<DropdownMenu.Root>
|
<DropdownMenu.Root>
|
||||||
<DropdownMenu.Trigger>
|
<DropdownMenu.Trigger>
|
||||||
<IconButton variant="ghost" color="gray">
|
<IconButton variant="ghost" color="gray">
|
||||||
@@ -463,15 +466,21 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
</DropdownMenu.Trigger>
|
</DropdownMenu.Trigger>
|
||||||
|
|
||||||
<DropdownMenu.Content>
|
<DropdownMenu.Content>
|
||||||
<DropdownMenu.Item onClick={() => poseEvent.emit(Pose.HullDown)}>
|
<DropdownMenu.Item
|
||||||
|
onClick={() => poseEvent.emit(Pose.HullDown)}
|
||||||
|
>
|
||||||
{strings.website.tools.tankopedia.sandbox.poses.hull_down}
|
{strings.website.tools.tankopedia.sandbox.poses.hull_down}
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
|
|
||||||
<DropdownMenu.Item onClick={() => poseEvent.emit(Pose.FaceHug)}>
|
<DropdownMenu.Item
|
||||||
|
onClick={() => poseEvent.emit(Pose.FaceHug)}
|
||||||
|
>
|
||||||
{strings.website.tools.tankopedia.sandbox.poses.face_hug}
|
{strings.website.tools.tankopedia.sandbox.poses.face_hug}
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
|
|
||||||
<DropdownMenu.Item onClick={() => poseEvent.emit(Pose.Default)}>
|
<DropdownMenu.Item
|
||||||
|
onClick={() => poseEvent.emit(Pose.Default)}
|
||||||
|
>
|
||||||
{strings.website.tools.tankopedia.sandbox.poses.default}
|
{strings.website.tools.tankopedia.sandbox.poses.default}
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
</DropdownMenu.Content>
|
</DropdownMenu.Content>
|
||||||
@@ -488,7 +497,10 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
{display === TankopediaDisplay.DynamicArmor && (
|
{display === TankopediaDisplay.DynamicArmor && (
|
||||||
<>
|
<>
|
||||||
<DropdownMenu.Label>
|
<DropdownMenu.Label>
|
||||||
{strings.website.tools.tankopedia.sandbox.settings.armor}
|
{
|
||||||
|
strings.website.tools.tankopedia.sandbox.settings
|
||||||
|
.armor
|
||||||
|
}
|
||||||
</DropdownMenu.Label>
|
</DropdownMenu.Label>
|
||||||
|
|
||||||
<DropdownMenu.CheckboxItem
|
<DropdownMenu.CheckboxItem
|
||||||
@@ -527,7 +539,10 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{strings.website.tools.tankopedia.sandbox.settings.opaque}
|
{
|
||||||
|
strings.website.tools.tankopedia.sandbox.settings
|
||||||
|
.opaque
|
||||||
|
}
|
||||||
</DropdownMenu.CheckboxItem>
|
</DropdownMenu.CheckboxItem>
|
||||||
|
|
||||||
{developerMode && (
|
{developerMode && (
|
||||||
@@ -549,7 +564,10 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<DropdownMenu.Label>
|
<DropdownMenu.Label>
|
||||||
{strings.website.tools.tankopedia.sandbox.settings.environment}
|
{
|
||||||
|
strings.website.tools.tankopedia.sandbox.settings
|
||||||
|
.environment
|
||||||
|
}
|
||||||
</DropdownMenu.Label>
|
</DropdownMenu.Label>
|
||||||
|
|
||||||
<DropdownMenu.CheckboxItem
|
<DropdownMenu.CheckboxItem
|
||||||
@@ -560,7 +578,10 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{strings.website.tools.tankopedia.sandbox.settings.show_grid}
|
{
|
||||||
|
strings.website.tools.tankopedia.sandbox.settings
|
||||||
|
.show_grid
|
||||||
|
}
|
||||||
</DropdownMenu.CheckboxItem>
|
</DropdownMenu.CheckboxItem>
|
||||||
</DropdownMenu.Content>
|
</DropdownMenu.Content>
|
||||||
</DropdownMenu.Root>
|
</DropdownMenu.Root>
|
||||||
@@ -615,7 +636,10 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CopyIcon />
|
<CopyIcon />
|
||||||
{strings.website.tools.tankopedia.sandbox.screenshot.copy}
|
{
|
||||||
|
strings.website.tools.tankopedia.sandbox.screenshot
|
||||||
|
.copy
|
||||||
|
}
|
||||||
</Button>
|
</Button>
|
||||||
</Popover.Close>
|
</Popover.Close>
|
||||||
</Flex>
|
</Flex>
|
||||||
@@ -632,9 +656,15 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
} else document.body.requestFullscreen();
|
} else document.body.requestFullscreen();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isFullScreen ? <ExitFullScreenIcon /> : <EnterFullScreenIcon />}
|
{isFullScreen ? (
|
||||||
|
<ExitFullScreenIcon />
|
||||||
|
) : (
|
||||||
|
<EnterFullScreenIcon />
|
||||||
|
)}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import type { MaybeSkeletonComponentProps } from '../../../types/maybeSkeletonCo
|
|||||||
import type { ThicknessRange } from '../../Armor/components/StaticArmor';
|
import type { ThicknessRange } from '../../Armor/components/StaticArmor';
|
||||||
import { classIcons } from '../../ClassIcon';
|
import { classIcons } from '../../ClassIcon';
|
||||||
import { Options } from './components/Options';
|
import { Options } from './components/Options';
|
||||||
import { ScrollHint } from './components/ScrollHint';
|
|
||||||
import { TankSandbox } from './components/TankSandbox';
|
import { TankSandbox } from './components/TankSandbox';
|
||||||
import { NATION_COLORS, Title } from './components/TankSandbox/Title';
|
import { NATION_COLORS, Title } from './components/TankSandbox/Title';
|
||||||
|
|
||||||
@@ -119,13 +118,14 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ScrollHint />
|
{/* <ScrollHint /> */}
|
||||||
|
|
||||||
<Flex
|
<Flex
|
||||||
direction={{ initial: 'column-reverse', md: 'row' }}
|
direction={{ initial: 'column-reverse', md: 'row' }}
|
||||||
style={{
|
style={{
|
||||||
zIndex: isFullScreen ? 2 : undefined,
|
zIndex: isFullScreen ? 2 : undefined,
|
||||||
transitionDuration: '1s',
|
transitionDuration: '1s',
|
||||||
|
background: isFullScreen ? 'black' : undefined,
|
||||||
}}
|
}}
|
||||||
height={disturbed && !isFullScreen ? 'calc(100vh - 6rem)' : '100vh'}
|
height={disturbed && !isFullScreen ? 'calc(100vh - 6rem)' : '100vh'}
|
||||||
maxHeight={isFullScreen ? undefined : '60rem'}
|
maxHeight={isFullScreen ? undefined : '60rem'}
|
||||||
@@ -182,13 +182,7 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
|
|
||||||
{!disturbed && (
|
{!disturbed && (
|
||||||
<Box
|
<Box
|
||||||
onPointerDown={(event) => {
|
onClick={(event) => {
|
||||||
event.stopPropagation();
|
|
||||||
mutateTankopediaEphemeral((draft) => {
|
|
||||||
draft.disturbed = true;
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
onWheel={(event) => {
|
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
mutateTankopediaEphemeral((draft) => {
|
mutateTankopediaEphemeral((draft) => {
|
||||||
draft.disturbed = true;
|
draft.disturbed = true;
|
||||||
|
|||||||
Reference in new issue
Block a user