feat: reenable mixer

This commit is contained in:
TrèsAbhi committed 2025-09-13 23:42:26 -05:00
1 parent 96a8f225fc
commit f5aa2ff9de
12 files changed
+72 -37

No files matched your search

@@ -0,0 +1,13 @@
import { Progress } from "@radix-ui/themes";
import { Html } from "@react-three/drei";
import { useStableProgress } from "../../../hooks/useStableProgress";
export function MixerFallback() {
const progress = useStableProgress();
return (
<Html center>
<Progress value={progress} style={{ width: "10rem" }} />
</Html>
);
}
@@ -2,22 +2,31 @@ import { OrbitControls } from "@react-three/drei";
import { Canvas } from "@react-three/fiber";
import { Suspense } from "react";
import { Lighting } from "../Tankopedia/HeroSection/components/TankSandbox/components/Lighting";
import { SceneProps } from "../Tankopedia/HeroSection/components/TankSandbox/components/SceneProps";
import { MixerFallback } from "./components/MixerFallback";
import { Model } from "./components/Model";
export function MixerScene() {
return (
<Canvas
shadows="soft"
style={{ background: "black" }}
camera={{
fov: 45,
position: [5, 5, -5],
position: [-4, 4, -7],
}}
>
<OrbitControls />
<OrbitControls
maxDistance={20}
minDistance={5}
enableDamping={false}
target={[0, 0.5, 0]}
/>
<Lighting />
<SceneProps />
<Suspense fallback={null}>
<Suspense fallback={<MixerFallback />}>
<Model />
</Suspense>
</Canvas>
+8 -11
View File
@@ -17,8 +17,8 @@ export interface Props {
}
const { integrated = false } = Astro.props;
const toolsFiltered = Object.entries(tools).filter(
([, tool]) => !tool.href && !tool.disabled
const toolsFiltered = Object.values(tools).filter(
(tool) => !tool.href && !tool.disabled
);
const { locale } = Astro.params;
const branchName = resolveBranchName(locale);
@@ -78,11 +78,7 @@ const strings = getStrings(locale);
});
</script>
{
!integrated && (
<Box className="padder" height={{ initial: "3.5rem", sm: "3rem" }} />
)
}
<Box className="padder" height={{ initial: "3.5rem", sm: "3rem" }} />
<Flex
direction="column"
@@ -138,11 +134,12 @@ const strings = getStrings(locale);
className="tools"
>
{
toolsFiltered.map(([id, tool]) => {
toolsFiltered.map((tool) => {
const selected = Astro.url.pathname.includes(`/${tool.id}`);
const toolStrings =
strings.website.tools[
(tool.strings ?? id) as keyof typeof strings.website.tools
(tool.strings ??
tool.id) as keyof typeof strings.website.tools
];
return (
@@ -203,10 +200,10 @@ const strings = getStrings(locale);
display={{ initial: "flex", sm: "none" }}
>
{
toolsFiltered.map(([id, tool]) => {
toolsFiltered.map(( tool) => {
const toolStrings =
strings.website.tools[
(tool.strings ?? id) as keyof typeof strings.website.tools
(tool.strings ?? tool.id) as keyof typeof strings.website.tools
];
return (
@@ -1,13 +1,12 @@
import { Box, Progress } from '@radix-ui/themes';
import { useProgress } from '@react-three/drei';
import { Box, Progress } from "@radix-ui/themes";
import { useStableProgress } from "../../../../../../../hooks/useStableProgress";
interface Props {
fontSize?: string;
}
export function Tracker({ fontSize }: Props) {
const { loaded, total } = useProgress();
const progress = total === 0 ? 0 : (loaded / total) * 100;
const progress = useStableProgress();
return (
<Box
@@ -266,7 +266,6 @@ export function Controls({
ref={orbitControls}
enabled={Tankopedia.state.controlsEnabled}
enableDamping={false}
autoRotateSpeed={1 / 4}
/>
);
}