aotds-docks/src/routes/(editor)/export/print/PrintShip/index.svelte

109 lines
2.3 KiB
Svelte
Raw Normal View History

2023-05-08 19:20:17 +00:00
<div class="disclaimer">
Printing this page will only prints the ship sheet.
</div>
2023-04-25 18:50:15 +00:00
<div class="print-output">
2023-04-26 13:53:22 +00:00
<Identification {...identification} />
2023-04-25 18:50:15 +00:00
2023-05-08 19:20:17 +00:00
<Beams {beams} />
2023-04-28 15:18:31 +00:00
<Weapons {weapons} />
2023-04-27 16:17:08 +00:00
<div class="grid">
<div class="s6">
<Armor layers={structure?.armor?.layers} />
<Hull
2023-04-30 16:08:42 +00:00
shipMass={identification.reqs?.mass}
2023-04-27 16:17:08 +00:00
advanced={false}
rating={structure.hull?.rating}
/>
</div>
<div class="s6">
2023-05-08 19:20:17 +00:00
<div>
{#each pds as p (p.id)}
<PDS {...pds} />
{/each}
</div>
2023-04-28 15:18:31 +00:00
<Firecons {...firecons} />
2023-05-08 19:20:17 +00:00
<Screens {...screens} />
2023-04-27 16:17:08 +00:00
</div>
</div>
2023-04-26 13:35:46 +00:00
2023-04-26 13:53:22 +00:00
<MainSystems {...propulsion} />
2023-04-30 16:08:42 +00:00
<Cargo {...cargo} />
2023-04-25 18:50:15 +00:00
</div>
<script>
2023-05-08 19:20:17 +00:00
import u from "@yanick/updeep-remeda";
2023-04-26 13:53:22 +00:00
import Identification from "./Identification.svelte";
import MainSystems from "./MainSystems/index.svelte";
2023-04-26 20:11:49 +00:00
import Hull from "./Hull/index.svelte";
2023-04-27 16:17:08 +00:00
import Armor from "./Armor/index.svelte";
import Screens from "./Screens/index.svelte";
2023-04-28 15:18:31 +00:00
import Firecons from "./Firecons/index.svelte";
import Weapons from "./Weapons/index.svelte";
2023-04-30 16:08:42 +00:00
import Cargo from "./Cargo.svelte";
2023-05-08 19:20:17 +00:00
import PDS from "./Weapons/PDS.svelte";
import Beams from "./Weapons/Beams.svelte";
2023-04-25 18:50:15 +00:00
export let identification = {};
export let propulsion = {};
2023-04-26 20:11:49 +00:00
export let structure = {};
2023-04-28 15:18:31 +00:00
export let weaponry = {};
2023-04-27 16:17:08 +00:00
2023-04-30 16:08:42 +00:00
$: cargo = structure.cargo ?? {};
2023-04-27 16:17:08 +00:00
$: screens = structure?.screens ?? {};
2023-04-28 15:18:31 +00:00
$: firecons = weaponry?.firecons ?? {};
$: weapons = weaponry?.weapons ?? [];
2023-05-08 19:20:17 +00:00
$: weapons = u.reject(
weapons,
u.matches({ specs: { type: (t) => ["pds", "beam"].includes(t) } })
);
$: pds = (weaponry?.weapons ?? []).filter(
u.matches({ specs: { type: "pds" } })
);
$: beams = (weaponry?.weapons ?? []).filter(
u.matches({ specs: { type: "beam" } })
);
2023-04-25 18:50:15 +00:00
</script>
<style>
.print-output {
2023-05-08 19:20:17 +00:00
width: 5.5in;
height: 8.5in;
2023-04-25 18:50:15 +00:00
border: 1px solid black;
padding: 1em;
margin: 0px auto;
}
2023-04-26 13:53:22 +00:00
@media print {
:global(body > *) {
visibility: hidden;
}
2023-04-25 18:50:15 +00:00
2023-04-26 13:53:22 +00:00
.print-output {
visibility: visible;
2023-05-08 19:20:17 +00:00
width: inherit;
height: inherit;
2023-04-26 13:53:22 +00:00
}
}
2023-04-27 16:17:08 +00:00
.s6 {
display: flex;
flex-direction: column;
align-items: center;
}
2023-04-28 15:18:31 +00:00
.s6 :global(> div) {
margin-bottom: 1em;
}
2023-05-08 19:20:17 +00:00
.disclaimer {
text-align: center;
margin-bottom: 1rem;
}
2023-04-25 18:50:15 +00:00
</style>