Add in some formatting for weparm tabs

This commit is contained in:
iamBadgers committed 2026-10-24 15:04:55 -07:00
1 parent 9b27c948ce
commit 0ed097e9e7
5 files changed
+92 -66

No files matched your search

+1 -1
View File
@@ -37,5 +37,5 @@
margin-left: 50px; margin-left: 50px;
margin-right: 50px; margin-right: 50px;
overflow-y: auto; overflow-y: auto;
height: 85vh height: 75vh
} }
+74 -16
View File
@@ -1,4 +1,4 @@
import { useState, useEffect } from 'react' import type { ReactElement } from 'react'
const baseUrl = typeof window !== 'undefined' const baseUrl = typeof window !== 'undefined'
? window.location.origin ? window.location.origin
@@ -10,41 +10,99 @@ const wandr = await fetch(`${baseUrl}/characters/collateral/weaponsandarmor.json
return r.json() return r.json()
}); });
type DisplayArmor = {
displayheadarmor: string;
displayheadarmorsp: number;
dislpayheadarmorpenalty: number;
displaybodyarmor: number;
displaybodyarmorsp: number;
displaybodyarmorpenalty: number;
}
type DisplayWeapon = {
name: string;
features: Array<string>;
magazine: number;
damage: string;
rof: number;
}
function Armor({ armor }) { function Armor({ armor }: { armor: DisplayArmor }): ReactElement {
return ( return (
<table className="cyber-table"> <table className="cyber-table" style={{ fontSize: "10px" }}>
<tbody> <tbody>
<tr style={{lineHeight: 1}}> <tr style={{ lineHeight: 1 }}>
<td>Head Armor: {armor.displayheadarmor}</td> <td><b>Head: {armor.displayheadarmor}</b></td>
<td>SP: {armor.displayheadarmorsp}</td> <td>SP: {armor.displayheadarmorsp}</td>
<td>Penalty: {armor.dislpayheadarmorpenalty}</td> <td>AP: {armor.dislpayheadarmorpenalty}</td>
</tr> </tr>
<tr style={{lineHeight: 1}}> <tr style={{ lineHeight: 1 }}>
<td>Body Armor: {armor.displaybodyarmor}</td> <td><b>Body: {armor.displaybodyarmor}</b></td>
<td>SP: {armor.displaybodyarmorsp}</td> <td>SP: {armor.displaybodyarmorsp}</td>
<td>Penalty: {armor.displaybodyarmorpenalty}</td> <td>AP: {armor.displaybodyarmorpenalty}</td>
</tr> </tr>
<tr style={{lineHeight: 1}}> <tr style={{ lineHeight: 1 }}>
<td>Shield:</td> <td><b>Shield:</b></td>
<td>HP:</td> <td>HP:</td>
<td>Penalty:</td> <td>AP:</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
) )
} }
function Weapons({ weapons }) { function Weapons({ weapons }: { weapons: Array<DisplayWeapon> }): ReactElement {
const rows: ReactElement[] = weapons.map((weapon, index) => {
return (
<tr key={index}>
<td><b>{weapon.name}</b></td>
<td>MAG: {weapon.magazine}</td>
<td>SMG: {weapon.damage}</td>
<td>ROF: {weapon.rof}</td>
<td>{weapon.features.join(' | ')}</td>
</tr>
)
});
return (
<table className="cyber-table" style={{ fontSize: "10px" }}>
<tbody>
{rows}
</tbody>
</table>
)
}
const card = {
lineHeight: "1",
paddingTop: "20px",
paddingLeft: "15px",
paddingRight: "15px",
paddingBottom: "10px",
fontWeight: "10px"
}
const header = {
marginBottom: "5px",
paddingBottom: "15px"
} }
export function WeaponsAndArmor() { export function WeaponsAndArmor() {
return ( return (
<div> <div style={{ display: "flex", flexDirection: "row", height: "230px" }}>
<Armor armor={wandr}/> <div className="cyber-card" style={card}>
<Weapons weapons={wandr.displayweapons} /> <div className="cyber-card__header" style={header}>
<div>Armor</div>
</div>
<Armor armor={wandr} />
</div>
<span className="cyber-flex"></span>
<div className="cyber-card" style={card}>
<div className="cyber-card__header" style={header}>
<div>Weapons</div>
</div>
<Weapons weapons={wandr.displayweapons} />
</div>
</div> </div>
) )
} }
+4 -6
View File
@@ -10,8 +10,6 @@ import { Social } from "../skills/social"
import { Technique } from "../skills/technique" import { Technique } from "../skills/technique"
import { Details } from "../details/details" import { Details } from "../details/details"
import { Stats } from "../details/stats" import { Stats } from "../details/stats"
import { Humanity } from "../details/humanity"
import { Health } from "../details/health"
import { WeaponsAndArmor } from "../details/weaponsandarmor" import { WeaponsAndArmor } from "../details/weaponsandarmor"
export function meta({ }: Route.MetaArgs) { export function meta({ }: Route.MetaArgs) {
@@ -35,13 +33,13 @@ export default function Home() {
<li><span className="cyber-nav__link">Loadouts</span></li> <li><span className="cyber-nav__link">Loadouts</span></li>
</ul> </ul>
</nav> </nav>
</div> </div>
<div className="stats-and-skills"> <div className="stats-and-skills">
<div className="stats-sand-skills-details-box"> <div className="stats-sand-skills-details-box">
<div style={{display: "flex", flexDirection: "row"}}> <div style={{ display: "flex", flexDirection: "row" }}>
<div className="stats-and-skills-details"><Details /></div> <div className="stats-and-skills-details"><Details /></div>
<div className="stats-and-skills-stats" style={{marginLeft: "20px"}}><Stats /></div> <div className="stats-and-skills-stats" style={{ marginLeft: "20px" }}><Stats /></div>
</div> </div>
</div> </div>
+11 -41
View File
@@ -17,8 +17,8 @@
"devDependencies": { "devDependencies": {
"@react-router/dev": "^8.4.0", "@react-router/dev": "^8.4.0",
"@types/node": "^22", "@types/node": "^22",
"@types/react": "^19.2.18", "@types/react": "^19.3.0",
"@types/react-dom": "^19.2.7", "@types/react-dom": "^19.3.0",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"vite": "^8.0.3" "vite": "^8.0.3"
} }
@@ -596,9 +596,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -616,9 +613,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -636,9 +630,6 @@
"ppc64" "ppc64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -656,9 +647,6 @@
"s390x" "s390x"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -676,9 +664,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -696,9 +681,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
@@ -870,18 +852,18 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/body-parser": { "node_modules/body-parser": {
"version": "2.3.0", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.4.0.tgz",
"integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", "integrity": "sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"bytes": "^3.1.2", "bytes": "^3.1.2",
"content-type": "^2.0.0", "content-type": "^2.1.0",
"debug": "^4.4.3", "debug": "^4.4.3",
"http-errors": "^2.0.1", "http-errors": "^2.0.1",
"iconv-lite": "^0.7.2", "iconv-lite": "^0.7.3",
"on-finished": "^2.4.1", "on-finished": "^2.4.1",
"qs": "^6.15.2", "qs": "^6.16.1",
"raw-body": "^3.0.2", "raw-body": "^3.0.2",
"type-is": "^2.1.0" "type-is": "^2.1.0"
}, },
@@ -1938,9 +1920,9 @@
} }
}, },
"node_modules/qs": { "node_modules/qs": {
"version": "6.16.0", "version": "6.16.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.1.tgz",
"integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==", "integrity": "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"dependencies": { "dependencies": {
"es-define-property": "^1.0.1", "es-define-property": "^1.0.1",
@@ -2654,9 +2636,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2678,9 +2657,6 @@
"arm64" "arm64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2702,9 +2678,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"glibc"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [
@@ -2726,9 +2699,6 @@
"x64" "x64"
], ],
"dev": true, "dev": true,
"libc": [
"musl"
],
"license": "MPL-2.0", "license": "MPL-2.0",
"optional": true, "optional": true,
"os": [ "os": [
+2 -2
View File
@@ -20,8 +20,8 @@
"devDependencies": { "devDependencies": {
"@react-router/dev": "^8.4.0", "@react-router/dev": "^8.4.0",
"@types/node": "^22", "@types/node": "^22",
"@types/react": "^19.2.18", "@types/react": "^19.3.0",
"@types/react-dom": "^19.2.7", "@types/react-dom": "^19.3.0",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"vite": "^8.0.3" "vite": "^8.0.3"
} }