Compare commits

..
1 Commits
Author SHA1 Message Date
iamBadgers 9d17f5f07b initial cyberware page 2026-11-09 21:57:06 -08:00
3 changed files with 333 additions and 6 deletions

No files matched your search

+1 -4
View File
@@ -7,10 +7,7 @@ const baseUrl =
const wandr = await fetch(
`${baseUrl}/characters/collateral/weaponsandarmor.json`,
).then((r) => {
console.log(r);
return r.json();
});
).then((r) => r.json());
type DisplayArmor = {
displayheadarmor: string;
+137 -2
View File
@@ -1,3 +1,4 @@
import { useState, useEffect } from "react";
import type { Route } from "./+types/home";
export function meta({}: Route.MetaArgs) {
@@ -7,6 +8,140 @@ export function meta({}: Route.MetaArgs) {
];
}
export default function StatsAndSkills() {
return <div>POTATO </div>;
const baseUrl =
typeof window !== "undefined"
? window.location.origin
: process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env
const c = await fetch(`${baseUrl}/characters/collateral/cyberware.json`).then(
(r) => r.json(),
);
type CyberBodyData = {
neural: FoundationData;
audio: FoundationData;
lefteye: FoundationData;
righteye: FoundationData;
leftarm: FoundationData;
rightarm: FoundationData;
leftleg: FoundationData;
rightleg: FoundationData;
internal: CyberData[];
external: CyberData[];
borgware: CyberData[];
};
type FoundationData = {
name: string;
slots: number;
upgraded: boolean;
hl: number;
contents: CyberData[];
};
type CyberData = {
name: string;
description: string;
hl: number;
};
function FoundationHeader(): ReactElement {
return (
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
);
}
function FoundationRow({
cyber,
}: {
cyber: CyberData | undefined;
}): ReactElement {
if (!cyber) {
return (
<tr>
<td>--</td>
<td>--</td>
</tr>
);
}
const upgrade = !cyber.upgraded ? (
<></>
) : (
<tr>
<td colspan="2">
{cyber.upgraded.name}: {cyber.upgraded.description}
</td>
</tr>
);
return (
<>
<tr>
<td>{cyber.name}</td>
<td>{cyber.description}</td>
</tr>
</>
);
}
function Foundation({
foundation,
}: {
foundation: FoundationData;
}): ReactElement {
const rows: ReactElement[] = Array(foundation.slots);
for (let i = 0; i < foundation.slots; i++) {
rows[i] = <FoundationRow key={i} cyber={foundation.contents[i]} />;
}
return (
<>
<div>{foundation.name}</div>
<table className="cyber-table">
<FoundationHeader />
<tbody>{rows}</tbody>
</table>
</>
);
}
const rowStyle = {
display: "flex",
flexDirection: "column",
width: "25%",
};
export default function Cyberware() {
const [cyber, setCyber] = useState(c);
return (
<div style={{ display: "flex", flexDirection: "row" }}>
<div style={rowStyle}>
<Foundation foundation={cyber.lefteye} />
<Foundation foundation={cyber.leftarm} />
<Foundation foundation={cyber.leftleg} />
</div>
<div style={rowStyle}>
<Foundation foundation={cyber.neural} />
<Foundation foundation={cyber.audio} />
</div>
<div style={rowStyle}>
<Foundation foundation={cyber.righteye} />
<Foundation foundation={cyber.rightarm} />
<Foundation foundation={cyber.rightleg} />
</div>
<div style={rowStyle}>
<Foundation foundation={cyber.internal} />
<Foundation foundation={cyber.external} />
<Foundation foundation={cyber.borgware} />
</div>
</div>
);
}
+195
View File
@@ -0,0 +1,195 @@
{
"neural": {
"name": "Neural Link",
"installed": true,
"slots": 5,
"upgraded": false,
"hl": 2,
"contents": [
{
"name": "Interfacec Plugs",
"description": "Plugs in your brain.",
"hl": 2
},
{
"name": "Interfacec Plugs",
"description": "Plugs in your brain.",
"hl": 2
},
{
"name": "Subdermal Grip Res.",
"description": "Subdermal Grip requires 1 neural slot.",
"hl": 0
}
]
},
"audio": {
"name": "Audio Suite",
"installed": false,
"slots": 3,
"upgraded": false,
"hl": 2,
"contents": []
},
"lefteye": {
"name": "Left Meat Eye",
"installed": true,
"slots": 3,
"upgraded": false,
"hl": 2,
"contents": []
},
"righteye": {
"name": "Right Meat Eye",
"installed": true,
"slots": 3,
"upgraded": false,
"hl": 2,
"contents": []
},
"leftarm": {
"name": "Left Cyber Arm",
"installed": true,
"slots": 5,
"upgraded": {
"name": "slot+",
"description": "Add an extra option slot."
},
"hl": 2,
"contents": [
{
"name": "PopUp Dragon (Open Bay)",
"description": "SQ Flamethrower with S.Choke.",
"hl": 2
},
{
"name": "PopUp Dragon (Open Bay)",
"description": "Second Slot.",
"hl": 0
},
{
"name": "Tech Scanner",
"description": "+2 to tech skills.",
"hl": 2
},
{
"name": "Tech Scanner",
"description": "Second Slot.",
"hl": 2
},
{
"name": "Tech Tool",
"description": "Never loose your tools.",
"hl": 2
}
]
},
"rightarm": {
"name": "Right Cyber Arm",
"installed": true,
"slots": 5,
"upgraded": {
"name": "slot+",
"description": "Add an extra option slot."
},
"hl": 2,
"contents": [
{
"name": "PopUp HSMG+",
"description": "EQ sub-caliber chaingun. S.Link | D.Mag",
"hl": 2
},
{
"name": "PopUp HSMG+",
"description": "Second Slot.",
"hl": 0,
"upgraded": {
"name": "Open Bay Mounting",
"description": "Swap mounted weapons."
}
},
{
"name": "PopUp HSMG+",
"description": "EQ sub-caliber chaingun. S.Link | D.Mag",
"hl": 2
},
{
"name": "PopUp HSMG+",
"description": "Second Slot.",
"hl": 0
},
{
"name": "Subdermal Grip",
"description": "Gun Connection via Skin.",
"hl": 2
}
]
},
"rightleg": {
"name": "Right Cyber Leg",
"installed": true,
"slots": 3,
"upgraded": {
"name": "Burden Managment",
"description": "Reduce MOVE Armor Penalty by 2."
},
"hl": 1,
"contents": [
{
"name": "Bilatteral Coprocessor",
"description": "Havles HL contributions.",
"hl": 0
}
]
},
"leftleg": {
"name": "Left Cyber Leg",
"installed": true,
"slots": 3,
"upgraded": {
"name": "Burden Managment",
"description": "Reduce MOVE Armor Penalty by 2."
},
"hl": 1,
"contents": [
{
"name": "Bilatteral Coprocessor",
"description": "Havles HL contributions.",
"hl": 0
}
]
},
"internal": {
"name": "Internal",
"installed": true,
"slots": 7,
"upgraded": {
"name": "Burden Managment",
"description": "Reduce MOVE Armor Penalty by 2."
},
"hl": 1,
"contents": []
},
"external": {
"name": "External",
"installed": true,
"slots": 7,
"upgraded": {
"name": "Burden Managment",
"description": "Reduce MOVE Armor Penalty by 2."
},
"hl": 1,
"contents": []
},
"borgware": {
"name": "Borgware",
"installed": true,
"slots": 7,
"upgraded": {
"name": "Burden Managment",
"description": "Reduce MOVE Armor Penalty by 2."
},
"hl": 1,
"contents": []
}
}