Add in some formatting for weparm tabs
This commit is contained in:
1 parent
9b27c948ce
commit
0ed097e9e7
5 files changed
+89
-63
No files matched your search
+1
-1
@@ -37,5 +37,5 @@
|
||||
margin-left: 50px;
|
||||
margin-right: 50px;
|
||||
overflow-y: auto;
|
||||
height: 85vh
|
||||
height: 75vh
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import type { ReactElement } from 'react'
|
||||
|
||||
const baseUrl = typeof window !== 'undefined'
|
||||
? window.location.origin
|
||||
@@ -10,41 +10,99 @@ const wandr = await fetch(`${baseUrl}/characters/collateral/weaponsandarmor.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 (
|
||||
<table className="cyber-table">
|
||||
<table className="cyber-table" style={{ fontSize: "10px" }}>
|
||||
<tbody>
|
||||
<tr style={{lineHeight: 1}}>
|
||||
<td>Head Armor: {armor.displayheadarmor}</td>
|
||||
<tr style={{ lineHeight: 1 }}>
|
||||
<td><b>Head: {armor.displayheadarmor}</b></td>
|
||||
<td>SP: {armor.displayheadarmorsp}</td>
|
||||
<td>Penalty: {armor.dislpayheadarmorpenalty}</td>
|
||||
<td>AP: {armor.dislpayheadarmorpenalty}</td>
|
||||
</tr>
|
||||
<tr style={{lineHeight: 1}}>
|
||||
<td>Body Armor: {armor.displaybodyarmor}</td>
|
||||
<tr style={{ lineHeight: 1 }}>
|
||||
<td><b>Body: {armor.displaybodyarmor}</b></td>
|
||||
<td>SP: {armor.displaybodyarmorsp}</td>
|
||||
<td>Penalty: {armor.displaybodyarmorpenalty}</td>
|
||||
<td>AP: {armor.displaybodyarmorpenalty}</td>
|
||||
</tr>
|
||||
<tr style={{lineHeight: 1}}>
|
||||
<td>Shield:</td>
|
||||
<tr style={{ lineHeight: 1 }}>
|
||||
<td><b>Shield:</b></td>
|
||||
<td>HP:</td>
|
||||
<td>Penalty:</td>
|
||||
<td>AP:</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</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() {
|
||||
return (
|
||||
<div>
|
||||
<Armor armor={wandr}/>
|
||||
<div style={{ display: "flex", flexDirection: "row", height: "230px" }}>
|
||||
<div className="cyber-card" style={card}>
|
||||
<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>
|
||||
)
|
||||
}
|
||||
+2
-4
@@ -10,8 +10,6 @@ import { Social } from "../skills/social"
|
||||
import { Technique } from "../skills/technique"
|
||||
import { Details } from "../details/details"
|
||||
import { Stats } from "../details/stats"
|
||||
import { Humanity } from "../details/humanity"
|
||||
import { Health } from "../details/health"
|
||||
import { WeaponsAndArmor } from "../details/weaponsandarmor"
|
||||
|
||||
export function meta({ }: Route.MetaArgs) {
|
||||
@@ -39,9 +37,9 @@ export default function Home() {
|
||||
|
||||
<div className="stats-and-skills">
|
||||
<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-stats" style={{marginLeft: "20px"}}><Stats /></div>
|
||||
<div className="stats-and-skills-stats" style={{ marginLeft: "20px" }}><Stats /></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Generated
+11
-41
@@ -17,8 +17,8 @@
|
||||
"devDependencies": {
|
||||
"@react-router/dev": "^8.4.0",
|
||||
"@types/node": "^22",
|
||||
"@types/react": "^19.2.18",
|
||||
"@types/react-dom": "^19.2.7",
|
||||
"@types/react": "^19.3.0",
|
||||
"@types/react-dom": "^19.3.0",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^8.0.3"
|
||||
}
|
||||
@@ -596,9 +596,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -616,9 +613,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -636,9 +630,6 @@
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -656,9 +647,6 @@
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -676,9 +664,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -696,9 +681,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -870,18 +852,18 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
|
||||
"integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==",
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.4.0.tgz",
|
||||
"integrity": "sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "^3.1.2",
|
||||
"content-type": "^2.0.0",
|
||||
"content-type": "^2.1.0",
|
||||
"debug": "^4.4.3",
|
||||
"http-errors": "^2.0.1",
|
||||
"iconv-lite": "^0.7.2",
|
||||
"iconv-lite": "^0.7.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"qs": "^6.15.2",
|
||||
"qs": "^6.16.1",
|
||||
"raw-body": "^3.0.2",
|
||||
"type-is": "^2.1.0"
|
||||
},
|
||||
@@ -1938,9 +1920,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.16.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz",
|
||||
"integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==",
|
||||
"version": "6.16.1",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.16.1.tgz",
|
||||
"integrity": "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"es-define-property": "^1.0.1",
|
||||
@@ -2654,9 +2636,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2678,9 +2657,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2702,9 +2678,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"glibc"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -2726,9 +2699,6 @@
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"libc": [
|
||||
"musl"
|
||||
],
|
||||
"license": "MPL-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@
|
||||
"devDependencies": {
|
||||
"@react-router/dev": "^8.4.0",
|
||||
"@types/node": "^22",
|
||||
"@types/react": "^19.2.18",
|
||||
"@types/react-dom": "^19.2.7",
|
||||
"@types/react": "^19.3.0",
|
||||
"@types/react-dom": "^19.3.0",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^8.0.3"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user