diff --git a/app/details/details.tsx b/app/details/details.tsx index b4cc28c..8ce29ab 100644 --- a/app/details/details.tsx +++ b/app/details/details.tsx @@ -1,29 +1,30 @@ import { Health } from "./health"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); -const dt = await - fetch(`${baseUrl}/characters/collateral/details.json`) - .then(r => r.json()); - -function RockerRole({rank}) { +const dt = await fetch(`${baseUrl}/characters/collateral/details.json`).then( + (r) => r.json(), +); +function RockerRole({ rank }) { const topDiv = { display: "flex", flexDirection: "column", marginTop: "10px", paddingTop: "10px", - borderTop: "1px solid var(--color-border-default)" - } + borderTop: "1px solid var(--color-border-default)", + }; if (rank > 0) { return ( @@ -34,18 +35,17 @@ function RockerRole({rank}) { ); } - return (
); + return
; } -function TechRole({rank, fabrication, upgrade, field}) { - +function TechRole({ rank, fabrication, upgrade, field }) { const topDiv = { display: "flex", flexDirection: "column", marginTop: "10px", paddingTop: "10px", - borderTop: "1px solid var(--color-border-default)" - } + borderTop: "1px solid var(--color-border-default)", + }; if (rank > 0) { return ( @@ -59,30 +59,38 @@ function TechRole({rank, fabrication, upgrade, field}) {
); } - return (
); + return
; } export function Details() { return ( -
+
- - + +

- + -
+
-
- ) +
+ ); } diff --git a/app/details/health.tsx b/app/details/health.tsx index 897d98a..423f4d8 100644 --- a/app/details/health.tsx +++ b/app/details/health.tsx @@ -1,27 +1,30 @@ -import { useState, useEffect } from 'react' +import { useState, useEffect } from "react"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173'; // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); export function Health() { - const [stats, setStats] = useState(st); - const [skills, setSkills] = useState(sk) + const [skills, setSkills] = useState(sk); return (
-
- Health: {stats.hp} / {stats.maxhp} +
+ + Health: {stats.hp} / {stats.maxhp} + Seriously Wounded: {stats.seriouslywounded}
- ) + ); } diff --git a/app/details/humanity.tsx b/app/details/humanity.tsx index f840bad..f505db1 100644 --- a/app/details/humanity.tsx +++ b/app/details/humanity.tsx @@ -5,5 +5,5 @@ export function Humanity() { 30 44
- ) + ); } diff --git a/app/details/stats.tsx b/app/details/stats.tsx index f682da9..c97b125 100644 --- a/app/details/stats.tsx +++ b/app/details/stats.tsx @@ -1,20 +1,21 @@ -import { useState, useEffect } from 'react' +import { useState, useEffect } from "react"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173'; // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); export function Stats() { - const [stats, setStats] = useState(st); - const [skills, setSkills] = useState(sk) + const [skills, setSkills] = useState(sk); return (
@@ -52,7 +53,9 @@ export function Stats() { LUCK - {stats.luck}/{stats.luck} + + {stats.luck}/{stats.luck} + MOVE @@ -64,11 +67,13 @@ export function Stats() { EMP - {stats.emp}/{stats.emp} + + {stats.emp}/{stats.emp} + -
+
); } @@ -131,5 +136,4 @@ const resources = [ ), }, - ]; diff --git a/app/details/weaponsandarmor.tsx b/app/details/weaponsandarmor.tsx index 3bac661..7cee2e7 100644 --- a/app/details/weaponsandarmor.tsx +++ b/app/details/weaponsandarmor.tsx @@ -1,14 +1,16 @@ -import type { ReactElement } from 'react' +import type { ReactElement } from "react"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const wandr = await fetch(`${baseUrl}/characters/collateral/weaponsandarmor.json`) - .then(r => { - console.log(r) - return r.json() - }); +const wandr = await fetch( + `${baseUrl}/characters/collateral/weaponsandarmor.json`, +).then((r) => { + console.log(r); + return r.json(); +}); type DisplayArmor = { displayheadarmor: string; @@ -17,7 +19,7 @@ type DisplayArmor = { displaybodyarmor: number; displaybodyarmorsp: number; displaybodyarmorpenalty: number; -} +}; type DisplayWeapon = { name: string; @@ -25,52 +27,58 @@ type DisplayWeapon = { magazine: number; damage: string; rof: number; -} +}; function Armor({ armor }: { armor: DisplayArmor }): ReactElement { return ( - + - + - +
Head: {armor.displayheadarmor} + Head: {armor.displayheadarmor} + SP: {armor.displayheadarmorsp} AP: {armor.dislpayheadarmorpenalty}
Body: {armor.displaybodyarmor} + Body: {armor.displaybodyarmor} + SP: {armor.displaybodyarmorsp} AP: {armor.displaybodyarmorpenalty}
Shield: + Shield: + HP: AP:
- ) + ); } function Weapons({ weapons }: { weapons: Array }): ReactElement { const rows: ReactElement[] = weapons.map((weapon, index) => { return ( - {weapon.name} + + {weapon.name} + MAG: {weapon.magazine} SMG: {weapon.damage} ROF: {weapon.rof} - {weapon.features.join(' | ')} + {weapon.features.join(" | ")} - ) + ); }); return ( - - {rows} - + {rows}
- ) + ); } const card = { @@ -79,17 +87,24 @@ const card = { paddingLeft: "15px", paddingRight: "15px", paddingBottom: "10px", - fontWeight: "10px" -} + fontWeight: "10px", +}; const header = { marginBottom: "5px", - paddingBottom: "15px" -} + paddingBottom: "15px", +}; export function WeaponsAndArmor() { return ( -
+
Armor
@@ -103,5 +118,5 @@ export function WeaponsAndArmor() {
- ) + ); } diff --git a/app/root.tsx b/app/root.tsx index b849a4f..e73ad99 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -38,6 +38,32 @@ export function Layout({ children }: { children: React.ReactNode }) { + {children} diff --git a/app/routes.ts b/app/routes.ts index 102b402..faea451 100644 --- a/app/routes.ts +++ b/app/routes.ts @@ -1,3 +1,6 @@ -import { type RouteConfig, index } from "@react-router/dev/routes"; +import { type RouteConfig, index, route } from "@react-router/dev/routes"; -export default [index("routes/home.tsx")] satisfies RouteConfig; +export default [ + index("routes/statsandskills.tsx"), + route("gear", "routes/gear.tsx"), +] satisfies RouteConfig; diff --git a/app/routes/gear.tsx b/app/routes/gear.tsx new file mode 100644 index 0000000..792c8ec --- /dev/null +++ b/app/routes/gear.tsx @@ -0,0 +1,135 @@ +import { useState, useEffect } from "react"; +import type { Route } from "./+types/home"; + +export function meta({}: Route.MetaArgs) { + return [ + { title: "Collateral - Gear" }, + { name: "description", content: "Gear" }, + ]; +} + +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env + +const g = await fetch(`${baseUrl}/characters/collateral/gear.json`).then((r) => + r.json(), +); + +type AmmunitionData = { + caliber: string; + type: string; + count: number; +}; + +type GearData = { + name: string; + description: string; + count: number; + contents: GearData[]; +}; + +function AmmunitionRow({ ammo }: { ammo: AmunitionData }) { + return ( + + {ammo.caliber} + {ammo.type} + {ammo.count}x + + ); +} + +function AmmunitionHeader() { + return ( + + + Caliber + Type + Count + + + ); +} + +function Ammunition({ ammo }: { ammo: AmmunitionData[] }) { + const ammoRows: ReactElement[] = ammo.map((entry, index) => ( + + )); + + return ( + + + {ammoRows} +
+ ); +} + +function InventoryHeader(): ReactElement { + return ( + + + Name + Description + Count + + + ); +} + +function InventoryWithDepth(name: string, depth: number): string { + if (depth === 0) { + return name; + } + + return "|" + "-".repeat(depth - 1) + "> " + name; +} + +function InventoryRow({ + gear, + depth, +}: { + gear: GearData; + depth: number; +}): ReactElement { + const contents = gear.contents + ? gear.contents.map((entry, index) => ( + + )) + : []; + + return ( + <> + + {InventoryWithDepth(gear.name, depth)} + {InventoryWithDepth(gear.description, depth)} + {gear.count}x + + {contents} + + ); +} + +function Inventory({ gear }: { gear: GearData[] }) { + const inventoryRows = gear.map((entry, index) => ( + + )); + + return ( + + + {inventoryRows} +
+ ); +} + +export default function Gear() { + const [gear] = useState(g); + + return ( +
+ + +
+ ); +} diff --git a/app/routes/home.tsx b/app/routes/home.tsx deleted file mode 100644 index aefd731..0000000 --- a/app/routes/home.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import type { Route } from "./+types/home"; -import { Awareness } from "../skills/awareness"; -import { Body } from "../skills/body"; -import { Control } from "../skills/control"; -import { EducationTop, EducationBottom } from "../skills/education" -import { Fighting } from "../skills/fighting" -import { Performance } from "../skills/performance" -import { RangedTop, RangedBottom } from "../skills/ranged" -import { Social } from "../skills/social" -import { Technique } from "../skills/technique" -import { Details } from "../details/details" -import { Stats } from "../details/stats" -import { WeaponsAndArmor } from "../details/weaponsandarmor" - -export function meta({ }: Route.MetaArgs) { - return [ - { title: "New React Router App" }, - { name: "description", content: "Welcome to React Router!" }, - ]; -} - -function SkillTable() { - return ( -
-
- - - - -
-
- - - - -
-
- - - -
-
- ) -} - -export default function Home() { - return ( -
- - - -
-
- -
-
-
- -
- -
-
-
-
-
-
-
- ); - -} - diff --git a/app/routes/loadouts.tsx b/app/routes/loadouts.tsx new file mode 100644 index 0000000..e69de29 diff --git a/app/routes/statsandskills.tsx b/app/routes/statsandskills.tsx new file mode 100644 index 0000000..2990516 --- /dev/null +++ b/app/routes/statsandskills.tsx @@ -0,0 +1,80 @@ +import type { Route } from "./+types/home"; +import { Awareness } from "../skills/awareness"; +import { Body } from "../skills/body"; +import { Control } from "../skills/control"; +import { EducationTop, EducationBottom } from "../skills/education"; +import { Fighting } from "../skills/fighting"; +import { Performance } from "../skills/performance"; +import { RangedTop, RangedBottom } from "../skills/ranged"; +import { Social } from "../skills/social"; +import { Technique } from "../skills/technique"; +import { Details } from "../details/details"; +import { Stats } from "../details/stats"; +import { WeaponsAndArmor } from "../details/weaponsandarmor"; + +export function meta({}: Route.MetaArgs) { + return [ + { title: "Collateral - Stats and Skills" }, + { name: "description", content: "Stats and Skills" }, + ]; +} + +function SkillTable() { + return ( +
+
+ + + + +
+
+ + + + +
+
+ + + +
+
+ ); +} + +export default function StatsAndSkills() { + return ( +
+
+
+
+
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
+
+
+ ); +} diff --git a/app/skills/awareness.tsx b/app/skills/awareness.tsx index f020b5c..7d5b3e4 100644 --- a/app/skills/awareness.tsx +++ b/app/skills/awareness.tsx @@ -1,34 +1,55 @@ -import { useState, useEffect } from 'react' -import { SkillHeader, SkillRow } from './skill' +import { useState, useEffect } from "react"; +import { SkillHeader, SkillRow } from "./skill"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); export function Awareness() { - - const [stats, setStats] = useState(st) - const [skills, setSkills] = useState(sk) + const [stats, setStats] = useState(st); + const [skills, setSkills] = useState(sk); return (
- + - - - - - + + + + +
- ) + ); } diff --git a/app/skills/body.tsx b/app/skills/body.tsx index e91d7b7..a506609 100644 --- a/app/skills/body.tsx +++ b/app/skills/body.tsx @@ -1,35 +1,60 @@ -import { useState, useEffect } from 'react' -import { SkillHeader, SkillRow } from './skill' +import { useState, useEffect } from "react"; +import { SkillHeader, SkillRow } from "./skill"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); export function Body() { - - const [stats, setStats] = useState(st) - const [skills, setSkills] = useState(sk) + const [stats, setStats] = useState(st); + const [skills, setSkills] = useState(sk); return (
- - - - - - + + + + + +
- ) + ); } diff --git a/app/skills/control.tsx b/app/skills/control.tsx index f598eda..7c3751c 100644 --- a/app/skills/control.tsx +++ b/app/skills/control.tsx @@ -1,33 +1,50 @@ -import { useState, useEffect } from 'react' -import { SkillHeader, SkillRow } from './skill' +import { useState, useEffect } from "react"; +import { SkillHeader, SkillRow } from "./skill"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); export function Control() { - - const [stats, setStats] = useState(st) - const [skills, setSkills] = useState(sk) + const [stats, setStats] = useState(st); + const [skills, setSkills] = useState(sk); return (
- - - - + + + +
- ) + ); } diff --git a/app/skills/education.tsx b/app/skills/education.tsx index 1c285a6..4528849 100644 --- a/app/skills/education.tsx +++ b/app/skills/education.tsx @@ -1,54 +1,128 @@ -import { useState, useEffect } from 'react' -import { SkillHeader, SkillRow } from './skill' +import { useState, useEffect } from "react"; +import { SkillHeader, SkillRow } from "./skill"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); function EducationTopSkills({ stats, skills }) { - return (<> - - - - - - - - - - - ) + return ( + <> + + + + + + + + + + + + ); } function EducationBottomSkills({ stats, skills }) { - return (<> - - - - - - - - - - - - - - - ) + return ( + <> + + + + + + + + + + + + + + + + ); } export function EducationTop() { - const [stats] = useState(st) - const [skills] = useState(sk) + const [stats] = useState(st); + const [skills] = useState(sk); return (
@@ -59,12 +133,12 @@ export function EducationTop() {
- ) + ); } export function EducationBottom() { - const [stats] = useState(st) - const [skills] = useState(sk) + const [stats] = useState(st); + const [skills] = useState(sk); return (
@@ -75,13 +149,12 @@ export function EducationBottom() {
- ) + ); } export function Education() { - - const [stats] = useState(st) - const [skills] = useState(sk) + const [stats] = useState(st); + const [skills] = useState(sk); return (
@@ -93,5 +166,5 @@ export function Education() {
- ) + ); } diff --git a/app/skills/fighting.tsx b/app/skills/fighting.tsx index 72483b1..4b115a8 100644 --- a/app/skills/fighting.tsx +++ b/app/skills/fighting.tsx @@ -1,33 +1,46 @@ -import { useState, useEffect } from 'react' -import { SkillHeader, SkillRow } from './skill' +import { useState, useEffect } from "react"; +import { SkillHeader, SkillRow } from "./skill"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); export function Fighting() { - - const [stats, setStats] = useState(st) - const [skills, setSkills] = useState(sk) + const [stats, setStats] = useState(st); + const [skills, setSkills] = useState(sk); return (
- - + + - +
- ) + ); } diff --git a/app/skills/performance.tsx b/app/skills/performance.tsx index 7bec2f5..f3c820d 100644 --- a/app/skills/performance.tsx +++ b/app/skills/performance.tsx @@ -1,33 +1,38 @@ -import { useState, useEffect } from 'react' -import { SkillHeader, SkillRow } from './skill' +import { useState, useEffect } from "react"; +import { SkillHeader, SkillRow } from "./skill"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); export function Performance() { - - const [stats, setStats] = useState(st) - const [skills, setSkills] = useState(sk) + const [stats, setStats] = useState(st); + const [skills, setSkills] = useState(sk); return (
- +
- ) + ); } diff --git a/app/skills/ranged.tsx b/app/skills/ranged.tsx index 87c2da7..e461eb2 100644 --- a/app/skills/ranged.tsx +++ b/app/skills/ranged.tsx @@ -1,36 +1,60 @@ -import { useState, useEffect } from 'react' -import { SkillHeader, SkillRow } from './skill' -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env +import { useState, useEffect } from "react"; +import { SkillHeader, SkillRow } from "./skill"; +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); function RangedTopSkills({ stats, skills }) { -return ( + return ( <> - - - - ) + + + + + ); } function RangedBottomSkills({ stats, skills }) { return ( <> - - - ) + + + + ); } export function RangedTop() { - const [stats] = useState(st) - const [skills] = useState(sk) + const [stats] = useState(st); + const [skills] = useState(sk); return (
@@ -41,12 +65,12 @@ export function RangedTop() {
- ) + ); } export function RangedBottom() { - const [stats] = useState(st) - const [skills] = useState(sk) + const [stats] = useState(st); + const [skills] = useState(sk); return (
@@ -57,13 +81,12 @@ export function RangedBottom() {
- ) + ); } export function Ranged() { - - const [stats, setStats] = useState(st) - const [skills, setSkills] = useState(sk) + const [stats, setStats] = useState(st); + const [skills, setSkills] = useState(sk); return (
@@ -75,5 +98,5 @@ export function Ranged() {
- ) + ); } diff --git a/app/skills/skill.tsx b/app/skills/skill.tsx index ae021d1..f11370e 100644 --- a/app/skills/skill.tsx +++ b/app/skills/skill.tsx @@ -1,8 +1,8 @@ function BaseVal({ skillRank, stat }) { if (skillRank === "---") { - return --- + return ---; } else { - return ({skillRank + stat}) + return {skillRank + stat}; } } @@ -17,7 +17,7 @@ export function SkillRow({ skillName, skillRank, stat }) { ); } -export function SkillHeader({skillGroup}) { +export function SkillHeader({ skillGroup }) { return ( @@ -27,5 +27,5 @@ export function SkillHeader({skillGroup}) { BASE - ) + ); } diff --git a/app/skills/social.tsx b/app/skills/social.tsx index 4577b2b..131b75b 100644 --- a/app/skills/social.tsx +++ b/app/skills/social.tsx @@ -1,38 +1,75 @@ -import { useState, useEffect } from 'react' -import { SkillHeader, SkillRow } from './skill' +import { useState, useEffect } from "react"; +import { SkillHeader, SkillRow } from "./skill"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); export function Social() { - - const [stats, setStats] = useState(st) - const [skills, setSkills] = useState(sk) + const [stats, setStats] = useState(st); + const [skills, setSkills] = useState(sk); return (
- - - - - - - - - + + + + + + + + +
- ) + ); } diff --git a/app/skills/technique.tsx b/app/skills/technique.tsx index 824a0dc..d902062 100644 --- a/app/skills/technique.tsx +++ b/app/skills/technique.tsx @@ -1,44 +1,105 @@ -import { useState, useEffect } from 'react' -import { SkillHeader, SkillRow } from './skill' +import { useState, useEffect } from "react"; +import { SkillHeader, SkillRow } from "./skill"; -const baseUrl = typeof window !== 'undefined' - ? window.location.origin - : process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env +const baseUrl = + typeof window !== "undefined" + ? window.location.origin + : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env -const st = await fetch(`${baseUrl}/characters/collateral/stats.json`) - .then(r => r.json()); +const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then( + (r) => r.json(), +); -const sk = await - fetch(`${baseUrl}/characters/collateral/skills.json`) - .then(r => r.json()); +const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then( + (r) => r.json(), +); export function Technique() { - - const [stats, setStats] = useState(st) - const [skills, setSkills] = useState(sk) + const [stats, setStats] = useState(st); + const [skills, setSkills] = useState(sk); return (
- + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + +
- ) + ); } diff --git a/public/characters/collateral/gear.json b/public/characters/collateral/gear.json new file mode 100644 index 0000000..1c3b79e --- /dev/null +++ b/public/characters/collateral/gear.json @@ -0,0 +1,68 @@ +{ + "cash": 100, + "ammo": [ + { + "type": "Tracer", + "caliber": "HP", + "count": "210" + }, + { + "type": "Armor Piercing", + "caliber": "Grenade", + "count": "3" + }, + { + "type": "Chalk", + "caliber": "Grenade", + "count": "5" + }, + { + "type": "Targeting", + "caliber": "Grenade", + "count": "1" + }, + { + "type": "Smoke", + "caliber": "Grenade", + "count": "2" + } + ], + "gear": [ + { + "name": "Kit Bags", + "description": "A set of kit bags worn around the waist.", + "count": 1, + "contents": [ + { + "name": "Kaisarin EOD Bag", + "description": "+2 to Demolitions Checks.", + "count": 1 + }, + { + "name": "Tech Bag", + "description": "Tools of the trade.", + "count": 1, + "contents": [ + { + "name": "Tech Tool", + "description": "Every kit needs one.", + "count": 1 + } + ] + }, + { + "name": "Smart Artists Kit", + "description": "+2 to Paint / Draw / Sculpt Checks.", + "count": 1, + "contents": [ + { + "name": "Smart-Linked Rattle Can", + "description": "'Cause sometimes a bad idea just works.", + "count": 1 + } + ] + } + ] + } + ] +} diff --git a/public/characters/collateral/weaponsandarmor.json b/public/characters/collateral/weaponsandarmor.json index a7fedd5..64cdec5 100644 --- a/public/characters/collateral/weaponsandarmor.json +++ b/public/characters/collateral/weaponsandarmor.json @@ -32,4 +32,3 @@ } ] } -