get ammo and gear tables working
This commit is contained in:
1 parent
49dec31761
commit
9298ebcd3e
23 files changed
+928
-391
No files matched your search
+36
-28
@@ -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}) {
|
||||
</main>
|
||||
);
|
||||
}
|
||||
return (<main />);
|
||||
return <main />;
|
||||
}
|
||||
|
||||
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}) {
|
||||
</main>
|
||||
);
|
||||
}
|
||||
return (<main />);
|
||||
return <main />;
|
||||
}
|
||||
|
||||
export function Details() {
|
||||
return (
|
||||
<main style={{display: "flex", flexDirection:"column"}}>
|
||||
<main style={{ display: "flex", flexDirection: "column" }}>
|
||||
<div className="cyber-card">
|
||||
<div className="cyber-card__body flex flex-col">
|
||||
<div className="flex">
|
||||
<img style={{ width: "100%" }} src={`${baseUrl}/characters/collateral/portrait.jpg`}></img>
|
||||
<TechRole rank={dt.role_one_rank} fabrication={dt.fabrication_exp} upgrade={dt.upgrade_exp} field={dt.field_exp}/>
|
||||
<img
|
||||
style={{ width: "100%" }}
|
||||
src={`${baseUrl}/characters/collateral/portrait.jpg`}
|
||||
></img>
|
||||
<TechRole
|
||||
rank={dt.role_one_rank}
|
||||
fabrication={dt.fabrication_exp}
|
||||
upgrade={dt.upgrade_exp}
|
||||
field={dt.field_exp}
|
||||
/>
|
||||
<RockerRole rank={dt.role_two_rank} />
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span style={{flexGrow:"1"}}/>
|
||||
<span style={{ flexGrow: "1" }} />
|
||||
|
||||
<div className="cyber-card" style={{marginTop: "20px", flexGrow:1}}>
|
||||
<div className="cyber-card" style={{ marginTop: "20px", flexGrow: 1 }}>
|
||||
<div className="cyber-card__body">
|
||||
<Health />
|
||||
</div>
|
||||
</div>
|
||||
</main >
|
||||
)
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user