toy and items layout

This commit is contained in:
tresabhi committed 2026-05-29 13:44:11 -05:00
1 parent d9b22431fa
commit 665d5c0f2d
8 files changed
+366 -155

No files matched your search

+2 -2
View File
@@ -13,7 +13,7 @@
"@types/bun": "^1.3.1",
"@types/lodash-es": "^4.17.12",
"@types/lz4js": "^0.2.1",
"@types/three": "^0.180.0",
"@types/three": "^0.184.1",
"adm-zip": "^0.5.16",
"crc": "^4.3.2",
"dotenv": "^17.2.2",
@@ -22,7 +22,7 @@
"lz4js": "^0.2.0",
"pickleparser": "^0.2.1",
"protobufjs": "^7.5.4",
"three": "^0.180.0",
"three": "^0.184.0",
"ts-proto": "^2.7.7",
"yaml": "^2.8.1"
}
+20 -20
View File
@@ -9,45 +9,45 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/node": "^9.4.4",
"@astrojs/react": "^4.4.0",
"@astrojs/check": "^0.9.9",
"@astrojs/node": "^9.5.5",
"@astrojs/react": "^4.4.2",
"@astrolib/seo": "^1.0.0-beta.8",
"@blitzkit/closed": "workspace:*",
"@blitzkit/core": "workspace:*",
"@blitzkit/game": "workspace:*",
"@blitzkit/i18n": "workspace:*",
"@bufbuild/protobuf": "^2.10.2",
"@bufbuild/protobuf": "^2.12.0",
"@fontsource-variable/jetbrains-mono": "^5.2.8",
"@fontsource-variable/roboto-flex": "^5.2.8",
"@fontsource-variable/roboto-mono": "^5.2.8",
"@fontsource-variable/roboto-mono": "^5.2.9",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-icons": "^1.3.2",
"@react-three/drei": "^10.7.7",
"@react-three/fiber": "^9.6.1",
"@types/lodash-es": "^4.17.12",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"@types/react": "^19.2.15",
"@types/react-dom": "^19.2.3",
"@types/three": "^0.184.1",
"@vite-pwa/astro": "^1.1.0",
"@vite-pwa/astro": "^1.2.0",
"@wooorm/starry-night": "^3.9.0",
"astro": "^5.14.4",
"astro-favicons": "^3.1.5",
"autoprefixer": "^10.4.23",
"cssnano": "^7.1.2",
"astro": "^5.18.2",
"astro-favicons": "^3.1.6",
"autoprefixer": "^10.5.0",
"cssnano": "^7.1.9",
"fuzzysort": "^3.1.0",
"googleapis": "^171.1.0",
"googleapis": "^171.4.0",
"hast-util-to-jsx-runtime": "^2.3.6",
"immer": "^10.1.3",
"lodash-es": "^4.17.21",
"postcss": "^8.5.6",
"immer": "^10.2.0",
"lodash-es": "^4.18.1",
"postcss": "^8.5.15",
"postcss-load-config": "^6.0.1",
"postcss-nested": "^7.0.2",
"postcss-preset-env": "^11.1.1",
"postcss-preset-env": "^11.3.0",
"quicklime": "^1.2.0",
"react": "^19.2.6",
"react-dom": "^19.2.6",
"react-error-boundary": "^6.1.1",
"react-error-boundary": "^6.1.2",
"react-markdown": "^10.1.0",
"react-promise-suspense": "^0.3.4",
"sharp": "^0.34.5",
@@ -55,7 +55,7 @@
"three-stdlib": "^2.36.1",
"typescript": "^5.9.3",
"varuna": "workspace:*",
"vite": "^7.1.9",
"yaml": "^2.8.1"
"vite": "^7.3.3",
"yaml": "^2.9.0"
}
}
@@ -41,8 +41,30 @@
}
.content {
display: flex;
flex-direction: column;
--cell-width: 5rem;
--toy-span: 3;
display: grid;
grid-auto-rows: var(--cell-width);
grid-template-columns: repeat(auto-fill, minmax(var(--cell-width), 1fr));
grid-auto-flow: row dense;
gap: var(--space-4);
.item {
background-color: red;
grid-row: span 1;
grid-column: span var(--toy-span);
}
.toy {
grid-row: span var(--toy-span);
grid-column: span var(--toy-span);
background-color: var(--gray-3);
border: var(--gray-5) solid var(--space-1);
border-radius: var(--space-3);
}
}
}
}
@@ -50,9 +50,9 @@ interface ToyProps {
}
function Toy({ toy }: ToyProps) {
return <span>{toy}</span>;
return <span className={styles.toy}></span>;
}
function Item({ name }: CharacteristicRenderConfig) {
return <span>{name}</span>;
return <span className={styles.item}></span>;
}
@@ -8,5 +8,9 @@
left: 0;
width: 100%;
height: 100%;
.canvas {
background-color: black;
}
}
}
@@ -1,5 +1,6 @@
import { OrbitControls } from "@react-three/drei";
import { Canvas, useLoader } from "@react-three/fiber";
import { FogExp2 } from "three";
import { GLTFLoader } from "three-stdlib";
import styles from "./index.module.css";
@@ -8,7 +9,7 @@ export function TankopediaSandbox() {
<div className={styles.wrapper}>
<div className={styles.sandbox}>
<Canvas
// scene={{ fog: new Fog("black", 15, 40) }}
scene={{ fog: new FogExp2("black", 0.05) }}
shadows
className={styles.canvas}
frameloop="demand"
@@ -23,6 +24,11 @@ export function TankopediaSandbox() {
function Content() {
const gltf = useLoader(GLTFLoader, "/amogos.glb");
gltf.scene.traverse(child =>
{
child.castShadow = true;
})
return (
<>
<group scale={4}>
@@ -88,6 +88,7 @@ export const characteristicsOrder: CharacteristicsGroup[] = [
{
group: "firepower",
order: [
{ toy: "reload" },
{
name: "gun_type",
render({ output }) {
@@ -97,39 +98,36 @@ export const characteristicsOrder: CharacteristicsGroup[] = [
{ name: "dpm", decimals: 0, units: "hp_min" },
{ name: "reload", decimals: 2, units: "s" },
{ name: "reloads", decimals: 2, units: "s" },
{ name: "damage", units: "hp" },
{ name: "module_damage", units: "hp" },
{ name: "penetration", units: "mm" },
{ name: "clip_size" },
{ name: "intra_clip", decimals: 2, units: "s" },
{ toy: "reload" },
{ toy: "ricochet" },
{ name: "penetration", units: "mm" },
{ name: "caliber", units: "mm" },
{ name: "normalization", units: "deg" },
{ name: "ricochet", units: "deg" },
{ toy: "ricochet" },
{ name: "shell_velocity", units: "m_s" },
{ name: "shell_range", units: "m" },
{ name: "shell_capacity" },
{ name: "aim_time", decimals: 1, units: "s" },
{ toy: "aim_time" },
{ name: "aim_time", decimals: 1, units: "s" },
{ name: "dispersion", decimals: 3, units: "m" },
{ toy: "flexibility" },
{ name: "gun_depression", decimals: 0, units: "deg" },
{ name: "gun_elevation", decimals: 0, units: "deg" },
{ toy: "flexibility" },
],
},
{
group: "maneuverability",
order: [
{ toy: "traverse" },
{ name: "speed_forward", units: "km_h" },
{ name: "speed_backward", units: "km_h" },
@@ -140,8 +138,6 @@ export const characteristicsOrder: CharacteristicsGroup[] = [
{ name: "power_to_weight", decimals: 1, units: "bhp_t" },
{ name: "hull_traverse_speed", units: "deg_s" },
{ name: "turret_traverse_speed", units: "deg_s" },
{ toy: "traverse" },
],
},
{
@@ -149,10 +145,9 @@ export const characteristicsOrder: CharacteristicsGroup[] = [
order: [
{ name: "health", units: "hp" },
{ name: "fire_chance", units: "%" },
{ name: "view_range", units: "m" },
{ toy: "view_range" },
{ name: "view_range", units: "m" },
{ name: "camouflage", decimals: 0, units: "%" },
{ name: "height", units: "m" },