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

124 lines
2.3 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">
<button class="home-logo"><img src="/assets/budibase-logo-only.png"/></button>
<!-- <IconButton icon="home"
2019-08-30 19:25:00 +12:00
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-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: 48px;
2019-08-20 18:24:02 +12:00
background: white;
padding: 0px 15px;
2019-08-30 19:25:00 +12:00
width: 100%;
display: flex;
align-items: center;
border-bottom: 1px solid #ddd;
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(--secondary50);
margin: 0px 15px;
padding-top: 4px;
font-weight: 600;
font-size: 1rem;
height: 100%;
display: flex;
align-items: center;
box-sizing: border-box;
2019-08-20 18:24:02 +12:00
}
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);
font-weight: 600;
2019-08-20 18:24:02 +12:00
}
2019-07-13 21:35:57 +12:00
2019-08-30 19:25:00 +12:00
.active {
color: var(--primary100);
font-weight: 600;
border-bottom: 2px solid var(--primary100);
border-top: 2px solid transparent;
2019-08-30 19:25:00 +12:00
}
.home-logo {
border-style: none;
background-color: rgba(0,0,0,0);
cursor: pointer;
outline: none;
height: 40px;
padding: 8px 10px;
}
.home-logo:hover {
color: var(--hovercolor);
}
.home-logo:active {
outline:none;
}
.home-logo img {
height: 100%;
}
2019-08-30 19:25:00 +12:00
</style>