1
0
Fork 0
mirror of synced 2024-07-16 19:56:10 +12:00
budibase/packages/builder/src/PackageRoot.svelte

173 lines
3.4 KiB
Svelte
Raw Normal View History

2019-07-13 21:35:57 +12:00
<script>
import IconButton from "components/common/IconButton.svelte"
import { store } from "builderStore"
import UserInterfaceRoot from "components/userInterface/UserInterfaceRoot.svelte"
2020-02-03 22:50:30 +13:00
import BackendRoot from "./BackendRoot.svelte"
import { fade } from "svelte/transition"
import { SettingsIcon, PreviewIcon } from "components/common/Icons/"
2020-03-11 05:06:30 +13:00
const TABS = {
BACKEND: "backend",
FRONTEND: "frontend",
}
2020-03-28 05:58:32 +13:00
let selectedTab = TABS.BACKEND
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
2020-02-03 22:50:30 +13:00
<div class="top-nav">
<div class="topleftnav">
2020-03-28 05:58:32 +13:00
<button class="home-logo">
<img src="/_builder/assets/budibase-emblem-white.svg" />
</button>
<!-- <IconButton icon="home"
color="var(--slate)"
hoverColor="var(--secondary75)"/> -->
<span
2020-03-11 05:06:30 +13:00
class:active={selectedTab === TABS.BACKEND}
class="topnavitem"
2020-03-28 05:58:32 +13:00
on:click={() => (selectedTab = TABS.BACKEND)}>
Backend
</span>
<span
2020-03-11 05:06:30 +13:00
class:active={selectedTab === TABS.FRONTEND}
class="topnavitem"
2020-03-28 05:58:32 +13:00
on:click={() => (selectedTab = TABS.FRONTEND)}>
Frontend
</span>
</div>
<div class="toprightnav">
<span
2020-03-11 05:06:30 +13:00
class:active={selectedTab === TABS.FRONTEND}
class="topnavitemright"
2020-03-11 05:06:30 +13:00
on:click={() => selectedTab === TABS.FRONTEND}>
2020-03-28 05:58:32 +13:00
<SettingsIcon />
</span>
<span
2020-03-11 05:06:30 +13:00
class:active={selectedTab === TABS.FRONTEND}
class="topnavitemright"
2020-03-11 05:06:30 +13:00
on:click={() => selectedTab === TABS.FRONTEND}>
2020-03-28 05:58:32 +13:00
<PreviewIcon />
</span>
</div>
2020-02-03 22:50:30 +13:00
</div>
<div class="content">
2020-03-11 05:06:30 +13:00
{#if selectedTab === TABS.BACKEND}
2020-02-03 22:50:30 +13:00
<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>
2020-02-03 22:50:30 +13:00
.root {
height: 100%;
width: 100%;
2019-08-30 19:25:00 +12:00
display: flex;
flex-direction: column;
2020-02-03 22:50:30 +13:00
}
2020-02-03 22:50:30 +13:00
.top-nav {
2019-08-30 19:25:00 +12:00
flex: 0 0 auto;
height: 48px;
background: #0d203b;
2020-03-08 02:04:23 +13:00
padding: 0px 20px 0 20px;
display: flex;
2020-02-25 10:31:35 +13:00
box-sizing: border-box;
justify-content: space-between;
align-items: center;
2020-02-03 22:50:30 +13:00
}
2019-07-13 21:35:57 +12:00
2020-02-03 22:50:30 +13:00
.content {
2019-08-30 19:25:00 +12:00
flex: 1 1 auto;
width: 100%;
height: 100px;
2020-02-25 10:31:35 +13:00
overflow: hidden;
2020-02-03 22:50:30 +13:00
}
2019-08-20 18:24:02 +12:00
2020-02-03 22:50:30 +13:00
.content > div {
height: 100%;
width: 100%;
}
2019-08-20 18:24:02 +12:00
.toprightnav {
display: flex;
}
.topleftnav {
display: flex;
align-items: center;
}
2020-02-03 22:50:30 +13:00
.topnavitem {
2019-08-20 18:24:02 +12:00
cursor: pointer;
color: rgb(255, 255, 255, 0.6);
margin: 0px 10px;
padding-top: 4px;
font-weight: 500;
font-size: 1rem;
height: 100%;
align-items: center;
box-sizing: border-box;
2020-02-03 22:50:30 +13:00
}
2019-07-13 21:35:57 +12:00
2020-02-03 22:50:30 +13:00
.topnavitem:hover {
color: rgb(255, 255, 255, 0.8);
font-weight: 500;
2020-02-03 22:50:30 +13:00
}
2020-02-03 22:50:30 +13:00
.active {
color: white;
font-weight: 600;
}
.topnavitemright {
cursor: pointer;
color: rgb(255, 255, 255, 0.6);
margin: 0px 5px;
padding-top: 4px;
font-weight: 500;
font-size: 1rem;
height: 100%;
display: flex;
2020-03-28 05:58:32 +13:00
flex: 1;
align-items: center;
box-sizing: border-box;
}
.topnavitemright:hover {
color: rgb(255, 255, 255, 0.8);
font-weight: 500;
2020-02-03 22:50:30 +13:00
}
2019-08-30 19:25:00 +12:00
2020-02-03 22:50:30 +13:00
.home-logo {
border-style: none;
2020-02-03 22:50:30 +13:00
background-color: rgba(0, 0, 0, 0);
cursor: pointer;
outline: none;
height: 40px;
2020-02-21 06:11:41 +13:00
padding: 8px 10px 8px 0;
2020-02-03 22:50:30 +13:00
}
2020-02-03 22:50:30 +13:00
.home-logo:hover {
color: var(--hovercolor);
2020-02-03 22:50:30 +13:00
}
2020-02-03 22:50:30 +13:00
.home-logo:active {
outline: none;
}
2020-02-03 22:50:30 +13:00
.home-logo img {
height: 100%;
2020-02-03 22:50:30 +13:00
}
</style>