This commit is contained in:
Yanick Champoux 2020-07-29 16:09:05 -04:00
parent 02fd6dd1c5
commit 0f4e243be8
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,34 @@
<div class="layers">
{#each armour as layer (layer)}
<div class="layer">
{#each _.range(layer.rating) as i (i) }
<div class="cell">
</div>
{/each}
</div>
{/each}
</div>
<script>
import _ from 'lodash';
export let armour = [];
$: console.log(armour);
</script>
<style>
.cell {
display: inline-block;
margin-right: 0.5em;
width: 1em;
height: 1em;
border: 1px solid black;
border-radius: 0.5em;
}
.layers {
display: flex;
flex-direction: column-reverse;
}
</style>

View File

@ -1,5 +1,7 @@
<div> <div>
<Identification {...ship.general} /> <Identification {...ship.general} />
<Armour armour={ship.structure.armour} />
<Integrity <Integrity
rating={ship.structure.hull.rating} rating={ship.structure.hull.rating}
advanced={ship.structure.hull.advanced} advanced={ship.structure.hull.advanced}
@ -10,6 +12,7 @@
<script> <script>
import Identification from './Identification'; import Identification from './Identification';
import Integrity from './Hull/Integrity'; import Integrity from './Hull/Integrity';
import Armour from './Hull/Armour';
export let ship; export let ship;
</script> </script>