1
0
Fork 0
mirror of synced 2024-08-23 22:11:39 +12:00
budibase/packages/builder/src/PackageRoot.svelte

89 lines
1.6 KiB
Svelte
Raw Normal View History

2019-07-13 21:35:57 +12:00
<script>
2019-08-20 18:24:02 +12: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 21:35:57 +12:00
2019-08-20 18:24:02 +12:00
</script>
2019-07-13 21:35:57 +12:00
2019-08-20 18:24:02 +12:00
<div class="root">
2019-07-13 21:35:57 +12:00
2019-08-20 18:24:02 +12:00
<div class="top-nav">
2019-08-30 19:25:00 +12:00
<IconButton icon="home"
color="var(--slate)"
hoverColor="var(--secondary75)"/>
2019-08-20 18:24:02 +12:00
<span class:active={$store.isBackend}
2019-08-30 19:25:00 +12:00
class="topnavitem"
2019-08-20 18:24:02 +12:00
on:click={store.showBackend}>
Backend
</span>
<span class:active={!$store.isBackend}
2019-08-30 19:25:00 +12:00
class="topnavitem"
2019-08-20 18:24:02 +12:00
on:click={store.showFrontend}>
Frontend
</span>
</div>
2019-07-13 21:35:57 +12:00
2019-08-20 18:24:02 +12: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-09-23 11:56:39 +12:00
2019-07-13 21:35:57 +12:00
</div>
2019-08-20 18:24:02 +12:00
<style>
.root {
height:100%;
width:100%;
2019-08-30 19:25:00 +12:00
display: flex;
flex-direction: column;
2019-08-20 18:24:02 +12:00
}
2019-07-13 21:35:57 +12:00
2019-08-20 18:24:02 +12:00
.top-nav {
2019-08-30 19:25:00 +12:00
flex: 0 0 auto;
height:25px;
2019-08-20 18:24:02 +12:00
background: white;
border-style:solid;
border-width: 0px 0px 1px 0px;
border-color: var(--lightslate);
padding: 5px;
2019-08-30 19:25:00 +12:00
width: 100%;
2019-08-20 18:24:02 +12:00
}
2019-07-13 21:35:57 +12:00
2019-08-20 18:24:02 +12:00
.content {
2019-08-30 19:25:00 +12:00
flex: 1 1 auto;
width: 100%;
height: 100px;
2019-08-20 18:24:02 +12:00
}
.content > div {
height:100%;
width:100%;
}
2019-08-30 19:25:00 +12:00
.topnavitem {
2019-08-20 18:24:02 +12:00
cursor: pointer;
color: var(--slate);
padding: 0px 15px;
}
2019-07-13 21:35:57 +12:00
2019-08-30 19:25:00 +12:00
.topnavitem:hover {
2019-08-20 18:24:02 +12:00
color: var(--secondary75);
}
2019-07-13 21:35:57 +12:00
2019-08-30 19:25:00 +12:00
.active {
color: var(--secondary100);
}
2019-07-13 21:35:57 +12:00
</style>