aotds-docks/src/lib/components/App.svelte

54 lines
1.1 KiB
Svelte
Raw Normal View History

2022-04-02 23:31:25 +00:00
<svelte:head>
<meta name="viewport" content="width=960" />
</svelte:head>
2022-03-22 14:45:33 +00:00
<main>
2021-05-17 14:07:01 +00:00
<Ribbon />
2022-03-22 14:45:33 +00:00
<Header on:changeTab={({ detail }) => activeTab = detail}/>
<div class:hide={activeTab !== 'editor'}>
<ShipEdit />
</div>
<div class:hide={activeTab !== 'json'}>
<JsonOutput />
</div>
2022-03-22 21:38:54 +00:00
<div class:hide={activeTab !== 'print'}>
2022-03-26 18:37:34 +00:00
<PrintOutput ship={$state}/>
2022-03-22 21:38:54 +00:00
</div>
2021-05-17 14:07:01 +00:00
2022-03-22 14:45:33 +00:00
</main>
2022-03-15 14:59:33 +00:00
2020-07-28 15:48:15 +00:00
<script>
2022-03-26 18:37:34 +00:00
import { getContext } from 'svelte';
2022-03-20 21:55:51 +00:00
import { Modal, Card, Nav } from "svelte-chota";
2022-03-20 21:48:45 +00:00
2022-03-20 21:55:51 +00:00
import Ribbon from "./Ribbon.svelte";
import Header from "./Header.svelte";
import ShipEdit from "./ShipEdit/index.svelte";
import About from "./About.svelte";
2022-03-22 14:45:33 +00:00
import JsonOutput from './Output/Json.svelte';
2022-03-22 21:38:54 +00:00
import PrintOutput from './Output/Print/index.svelte';
2022-03-22 14:45:33 +00:00
let activeTab = 'editor';
$: console.log(activeTab);
2022-03-26 18:37:34 +00:00
const {state} = getContext('ship');
2020-07-28 15:48:15 +00:00
</script>
<style>
2022-03-20 21:55:51 +00:00
.nav {
2022-03-20 21:48:45 +00:00
width: var(--main-width);
margin-left: auto;
margin-right: auto;
2022-03-20 21:55:51 +00:00
}
2022-03-22 14:45:33 +00:00
.hide {
display: none;
}
main {
width: var(--main-width);
margin-right: auto;
margin-left: auto;
}
2020-07-28 15:48:15 +00:00
</style>