chartmaker-fe/src/App.svelte

66 lines
1.1 KiB
Svelte
Raw Normal View History

2022-03-04 11:41:53 +01:00
<script>
import { currentChartID } from './stores';
import ChartEdit from './ChartEdit.svelte';
import ChartCreation from './ChartCreation.svelte';
2022-03-04 14:00:38 +01:00
import IoMdHeart from 'svelte-icons/io/IoMdHeart.svelte';
import { H1 } from 'attractions';
import { onMount } from 'svelte';
onMount(async () => {
if (window.location.hash.length > 1) {
const code = window.location.hash.slice(1);
currentChartID.set(code);
}
});
2022-03-04 11:41:53 +01:00
</script>
2022-03-04 14:00:38 +01:00
<style>
.icon {
width: 0.8em;
height: 0.8em;
display: inline-block;
}
footer {
width: 100%;
font-size: 1em;
text-align: center;
color: #888;
position: absolute;
2022-03-04 16:28:50 +01:00
bottom: 0;
2022-03-04 14:00:38 +01:00
left: 0;
}
header {
margin-top: 0.5em;
margin-bottom: 0;
text-align: center;
}
main {
min-height: 100%;
2022-03-04 14:05:03 +01:00
position: absolute;
width: 100%;
}
content {
2022-03-04 14:00:38 +01:00
margin-bottom: 1.2em;
}
</style>
2022-03-04 11:41:53 +01:00
<main>
2022-03-04 14:05:03 +01:00
<content>
<header>
<H1>chartmaker</H1>
</header>
2022-03-04 14:05:03 +01:00
{#if $currentChartID}
<ChartEdit/>
{:else}
<ChartCreation/>
{/if}
2022-03-04 14:05:03 +01:00
<footer>
made with <div class="icon"><IoMdHeart/></div> by oatmealine. <a target="_blank" href="https://git.oat.zone/oat/project-databased-fe">source</a>
</footer>
</content>
2022-03-04 14:00:38 +01:00
</main>