budibase/packages/builder/src/PackageRoot.svelte

83 lines
1.5 KiB
Svelte
Raw Normal View History

2019-07-13 11:35:57 +02:00
<script>
2019-08-20 08:24:02 +02:00
import IconButton from "./common/IconButton.svelte";
import { store } from "./builderStore";
import UserInterfaceRoot from "./userInterface/UserInterfaceRoot.svelte";
import BackendRoot from "./BackendRoot.svelte";
import { fade } from "svelte/transition";
2019-07-13 11:35:57 +02:00
2019-08-20 08:24:02 +02:00
</script>
2019-07-13 11:35:57 +02:00
2019-08-20 08:24:02 +02:00
<div class="root">
2019-07-13 11:35:57 +02:00
2019-08-20 08:24:02 +02:00
<div class="top-nav">
<IconButton icon="home"/>
<span class:active={$store.isBackend}
on:click={store.showBackend}>
Backend
</span>
<span class:active={!$store.isBackend}
on:click={store.showFrontend}>
Frontend
</span>
</div>
2019-07-13 11:35:57 +02:00
2019-08-20 08:24:02 +02:00
<div class="content">
{#if $store.isBackend}
<div in:fade out:fade>
<BackendRoot />
</div>
{:else}
<div in:fade out:fade>
<UserInterfaceRoot />
</div>
{/if}
</div>
2019-07-13 11:35:57 +02:00
</div>
2019-08-20 08:24:02 +02:00
<style>
.root {
height:100%;
width:100%;
}
2019-07-13 11:35:57 +02:00
2019-08-20 08:24:02 +02:00
.top-nav {
position:fixed;
height:40px;
margin: 0px;
background: white;
border-style:solid;
border-width: 0px 0px 1px 0px;
border-color: var(--lightslate);
padding: 5px;
}
2019-07-13 11:35:57 +02:00
2019-08-20 08:24:02 +02:00
.content {
position:fixed;
height:calc(100% - 40px);
top:40px;
margin: 0px;
}
.content > div {
height:100%;
width:100%;
}
.active {
color: var(--secondary100);
}
.top-nav > span {
cursor: pointer;
color: var(--slate);
padding: 0px 15px;
}
2019-07-13 11:35:57 +02:00
2019-08-20 08:24:02 +02:00
.top-nav > span:hover {
color: var(--secondary75);
}
2019-07-13 11:35:57 +02:00
</style>