add notes

This commit is contained in:
Yanick Champoux 2020-07-28 17:20:30 -04:00
parent 95fc9737e7
commit df5ca2d577
2 changed files with 100 additions and 1 deletions

View File

@ -1,7 +1,15 @@
<Header /> <Header />
{#if show_notes}
<Notes show={show_notes} on:close={toggle_notes} />
{/if}
<main> <main>
<nav> <nav>
<input class="reset button small red" type="button" value="reset" on:click={reset} /> <input class="reset button small red" type="button" value="reset" on:click={reset} />
<div class="spacer" />
<input type="button" class="button small" value="notes" on:click={toggle_notes} />
</nav> </nav>
<ShipSpecs /> <ShipSpecs />
@ -41,7 +49,13 @@
<Carrier {...$ship.carrier} /> <Carrier {...$ship.carrier} />
</main> </main>
<footer>
Written by <a href="https://twitter.com/yenzie">Yanick Champoux</a>.
Code available on <a
href="https://github.com/yanick/aotds-shipyard">Github</a>
</footer>
<script> <script>
import { setContext } from "svelte"; import { setContext } from "svelte";
@ -50,6 +64,7 @@
import shipStore from "~/stores/ship"; import shipStore from "~/stores/ship";
import ShipSpecs from './ShipSpecs/index.svelte'; import ShipSpecs from './ShipSpecs/index.svelte';
import Notes from './Notes';
import ShipItem from "./ShipItem/index.svelte"; import ShipItem from "./ShipItem/index.svelte";
import Field from "./Field/index.svelte"; import Field from "./Field/index.svelte";
import Hull from "./Hull"; import Hull from "./Hull";
@ -92,6 +107,9 @@
const ship_dispatch = ({ detail }) => ship.dispatch(detail); const ship_dispatch = ({ detail }) => ship.dispatch(detail);
setContext("ship_change", ship.dispatch); setContext("ship_change", ship.dispatch);
let show_notes = true;
const toggle_notes = () => show_notes = !show_notes;
</script> </script>
<style> <style>
@ -103,11 +121,28 @@
margin-right: auto; margin-right: auto;
} }
main :global(> *) { nav {
grid-column: 1 / span 3 !important;
display: flex;
margin: 1em 0;
}
nav .spacer {
flex: 1;
}
:global(main > *) {
grid-column: 1; grid-column: 1;
} }
input.reset { input.reset {
grid-column: 2; grid-column: 2;
} }
footer {
width: var(--main-width);
margin: 0 auto;
text-align: right;
}
</style> </style>

View File

@ -0,0 +1,64 @@
<aside transition:fly={{x: -800, opacity: 1}}>
<div>
<input type="button" class="button small red" value="close"
on:click={close}/>
</div>
<h3>welcome to the shipyard</h3>
<p>
This app is a ship builder for the game
<a href="https://shop.groundzerogames.co.uk/rules.html">Full Thrust</a>
.
</p>
<p>
The app, beside any exception mentioned here, is trying to follow the
<a href="http://members.ozemail.com.au/~laranzu/fullthrust/rules/">
Cross Dimensions rules
</a>
as closely as possible.
</p>
<p>
Written by
<a href="https://twitter.com/yenzie">Yanick Champoux</a>
. Code available on
<a href="https://github.com/yanick/aotds-shipyard">Github</a>
</p>
</aside>
<script>
import { fly } from 'svelte/transition';
import {createEventDispatcher} from 'svelte';
const dispatch = createEventDispatcher();
const close = () => dispatch('close');
</script>
<style>
aside {
background-color: rgb(254, 218, 184);
position: absolute;
height: 20em;
max-width: 50%;
z-index: 200;
padding: 1em;
border: 3px solid var(--indigo-dye);
border-radius: 1em;
left: 0px;
border-left: 0px;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
top: 6em;
font-size: var(--font-scale-11);
}
h3 {
text-align: center;
margin: 0px;
}
div {
text-align: right;
}
</style>