2020-03-31 11:50:13 +02:00
|
|
|
<script>
|
2020-05-26 10:38:43 +02:00
|
|
|
import { getContext } from "svelte"
|
2020-05-07 11:53:34 +02:00
|
|
|
import { store } from "builderStore"
|
2020-04-02 15:16:46 +02:00
|
|
|
import AppList from "components/start/AppList.svelte"
|
2020-03-31 11:50:13 +02:00
|
|
|
import { onMount } from "svelte"
|
2020-05-25 17:57:17 +02:00
|
|
|
import ActionButton from "components/common/ActionButton.svelte"
|
2020-04-02 15:16:46 +02:00
|
|
|
import IconButton from "components/common/IconButton.svelte"
|
2020-06-03 18:05:36 +02:00
|
|
|
import { get } from "builderStore/api"
|
2020-04-02 15:16:46 +02:00
|
|
|
import Spinner from "components/common/Spinner.svelte"
|
2020-05-26 16:25:37 +02:00
|
|
|
import CreateAppModal from "components/start/CreateAppModal.svelte"
|
2020-03-31 11:50:13 +02:00
|
|
|
|
|
|
|
let promise = getApps()
|
|
|
|
|
|
|
|
async function getApps() {
|
2020-06-03 18:05:36 +02:00
|
|
|
const res = await get("/api/applications")
|
2020-03-31 11:50:13 +02:00
|
|
|
const json = await res.json()
|
|
|
|
|
|
|
|
if (res.ok) {
|
|
|
|
return json
|
|
|
|
} else {
|
|
|
|
throw new Error(json)
|
|
|
|
}
|
|
|
|
}
|
2020-05-25 17:57:17 +02:00
|
|
|
|
2020-05-26 10:38:43 +02:00
|
|
|
// Handle create app modal
|
|
|
|
const { open } = getContext("simple-modal")
|
2020-05-26 16:25:37 +02:00
|
|
|
|
2020-05-26 10:38:43 +02:00
|
|
|
const showCreateAppModal = () => {
|
|
|
|
open(
|
2020-05-26 16:25:37 +02:00
|
|
|
CreateAppModal,
|
2020-05-26 10:38:43 +02:00
|
|
|
{
|
|
|
|
message: "What is your name?",
|
|
|
|
hasForm: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
closeButton: false,
|
|
|
|
closeOnEsc: false,
|
|
|
|
closeOnOuterClick: false,
|
2020-05-26 16:25:37 +02:00
|
|
|
styleContent: { padding: 0 },
|
2020-05-27 12:54:53 +02:00
|
|
|
closeOnOuterClick: true,
|
2020-05-26 10:38:43 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
</script>
|
2020-05-25 17:57:17 +02:00
|
|
|
|
2020-05-26 10:38:43 +02:00
|
|
|
<div class="welcome">Welcome to Budibase</div>
|
|
|
|
<div class="banner">
|
|
|
|
<div class="banner-content">
|
|
|
|
<div class="banner-header">
|
|
|
|
Every accomplishment starts with a decision to try.
|
2020-05-25 17:57:17 +02:00
|
|
|
</div>
|
2020-05-26 16:25:37 +02:00
|
|
|
<button class="banner-button" type="button" on:click={showCreateAppModal}>
|
2020-05-26 10:38:43 +02:00
|
|
|
<i class="ri-add-circle-fill" />
|
|
|
|
Create New Web App
|
|
|
|
</button>
|
2020-05-25 17:57:17 +02:00
|
|
|
</div>
|
2020-05-26 10:38:43 +02:00
|
|
|
<div class="banner-image">
|
|
|
|
<img src="/_builder/assets/banner-image.png" alt="Bannerimage" />
|
2020-05-25 21:26:48 +02:00
|
|
|
</div>
|
2020-05-25 17:57:17 +02:00
|
|
|
</div>
|
2020-05-26 10:38:43 +02:00
|
|
|
{#await promise}
|
|
|
|
<div class="spinner-container">
|
|
|
|
<Spinner />
|
|
|
|
</div>
|
|
|
|
{:then result}
|
|
|
|
<AppList apps={result} />
|
|
|
|
{:catch err}
|
|
|
|
<h1 style="color:red">{err}</h1>
|
|
|
|
{/await}
|
2020-03-31 11:50:13 +02:00
|
|
|
|
|
|
|
<style>
|
2020-05-25 17:57:17 +02:00
|
|
|
.welcome {
|
|
|
|
margin: 60px 80px 0px 80px;
|
|
|
|
font-size: 42px;
|
|
|
|
color: var(--ink);
|
|
|
|
font-weight: 900;
|
|
|
|
}
|
|
|
|
|
|
|
|
.banner {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 1fr 1fr;
|
|
|
|
margin: 20px 80px 40px 80px;
|
2020-05-25 21:26:48 +02:00
|
|
|
background-image: linear-gradient(-45deg, #7f9ceb, #1d2f77);
|
2020-05-25 17:57:17 +02:00
|
|
|
border-radius: 10px;
|
|
|
|
max-height: 280px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.banner-content {
|
2020-05-25 21:26:48 +02:00
|
|
|
padding: 60px;
|
2020-05-25 17:57:17 +02:00
|
|
|
}
|
2020-05-25 21:26:48 +02:00
|
|
|
|
|
|
|
@media only screen and (min-width: 1800px) {
|
|
|
|
.banner-content {
|
|
|
|
padding: 80px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-25 17:57:17 +02:00
|
|
|
.banner-header {
|
2020-05-25 21:26:48 +02:00
|
|
|
font-size: 24px;
|
2020-05-25 17:57:17 +02:00
|
|
|
color: var(--white);
|
|
|
|
font-weight: 500;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
}
|
|
|
|
|
2020-05-25 21:26:48 +02:00
|
|
|
@media only screen and (min-width: 1800px) {
|
|
|
|
.banner-header {
|
|
|
|
font-size: 36px;
|
|
|
|
color: var(--white);
|
|
|
|
font-weight: 500;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-25 17:57:17 +02:00
|
|
|
.banner-image {
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.banner-image img {
|
|
|
|
max-height: 400px;
|
2020-03-31 11:50:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.spinner-container {
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
2020-05-25 17:57:17 +02:00
|
|
|
|
|
|
|
.banner-button {
|
|
|
|
background-color: var(--white);
|
|
|
|
color: var(--ink);
|
|
|
|
padding: 12px 20px;
|
|
|
|
border-radius: 5px;
|
|
|
|
border: 0px transparent solid;
|
|
|
|
font-size: 16px;
|
|
|
|
font-weight: 400;
|
|
|
|
cursor: pointer;
|
|
|
|
transition: all 0.2s;
|
|
|
|
box-sizing: border-box;
|
|
|
|
align-items: center;
|
|
|
|
display: flex;
|
|
|
|
}
|
2020-05-25 21:26:48 +02:00
|
|
|
|
2020-05-25 17:57:17 +02:00
|
|
|
.ri-add-circle-fill {
|
|
|
|
margin-right: 4px;
|
|
|
|
font-size: 24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.banner-button:hover {
|
|
|
|
background-color: var(--grey);
|
|
|
|
}
|
2020-03-31 11:50:13 +02:00
|
|
|
</style>
|