identification

main
Yanick Champoux 2020-07-29 14:05:55 -04:00
parent 0a1c7b94e6
commit 7ad0491b70
6 changed files with 212 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<div>{cost}</div>
<script>
export let cost = 0;
</script>
<style>
div:after { content: '\00A4'; margin-left: 0.5em; }
</style>

View File

@ -0,0 +1,14 @@
<div>{mass}</div>
<script>
export let mass = 0;
</script>
<style>
div:after {
content: url(mass.svg);
width: 0.75em;
display: inline-block;
margin-left: 0.5em;
}
</style>

View File

@ -0,0 +1,44 @@
<h1>ship name: <div class="fill"></div> </h1>
<div class="details">
<h2>{ship_class}-class, {ship_type}</h2>
<div class="reqs">
<Cost {cost} />
&nbsp;
<Mass {mass} />
</div>
</div>
<script>
import Cost from '~C/Cost';
import Mass from '~C/Mass';
export let ship_class;
export let ship_type;
export let cost, mass = ( 0, 0 );
</script>
<style>
h1 {
width: 100%;
display: flex;
font-size: var(--font-scale-8);
}
h2 {
font-size: var(--font-scale-7);
flex: 1;
}
.fill {
margin-left: 0.5em;
display: inline-block;
flex: 1;
border-bottom: 1px solid black;
}
.details {
display: flex;
align-items: baseline;
}
.reqs {
display: flex;
}
</style>

View File

@ -0,0 +1,18 @@
<div>
<Identification {...ship.general} />
</div>
<script>
import Identification from './Identification';
export let ship;
</script>
<style>
div {
width: 4.25in;
height: 5.5in;
border: 1px solid black;
padding: 1em;
}
</style>

View File

@ -0,0 +1,114 @@
export default {
"ftl": {
"mass": 0,
"cost": 0,
"type": "none"
},
"engine": {
"mass": 40,
"cost": 80,
"rating": 6,
"advanced": false
},
"general": {
"ship_class": "Deviant",
"name": "",
"ship_type": "Battleship",
"mass": 132,
"used_mass": 131,
"cost": 415
},
"weaponry": {
"firecons": {
"nbr": 5,
"mass": 5,
"cost": 20
},
"weapons": [
{
"weapon_type": "submunition",
"arcs": [
"F"
],
"mass": 1,
"cost": 3,
"id": 1
},
{
"weapon_type": "beam",
"weapon_class": "2",
"arcs": [
"A",
"AS",
"FS"
],
"mass": 2,
"cost": 6,
"id": 2
},
{
"weapon_type": "pds",
"mass": 1,
"cost": 3,
"id": 3
}
],
"adfc": {
"rating": 0,
"cost": 0,
"mass": 0
}
},
"structure": {
"mass": 0,
"cost": 0,
"hull": {
"rating": 22,
"advanced": false,
"cost": 44,
"mass": 22
},
"screens": {
"standard": 5,
"advanced": 0,
"cost": 105,
"mass": 35
},
"armour": [
{
"layer": 1,
"rating": 7,
"cost": 14,
"mass": 14
},
{
"layer": 2,
"rating": 2,
"cost": 8,
"mass": 4
},
{
"layer": 3,
"rating": 0,
"cost": 0,
"mass": 0
}
]
},
"cargo": {
"space": 7,
"cost": 0,
"mass": 7
},
"streamlining": {
"type": "none",
"cost": 0,
"mass": 0
},
"carrier": {
"bays": 0,
"cost": 0,
"mass": 0,
"squadrons": []
}
}

View File

@ -0,0 +1,13 @@
import Print from './index.svelte';
import sample from './sample';
export default {
title: "printouts"
};
export const basic = () => ({
Component: Print,
props: {
ship: sample
}
});