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

52 lines
1.0 KiB
Svelte
Raw Normal View History

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