Files
classroomio/src/routes/index.svelte
T

140 lines
3.9 KiB
Svelte
Raw Normal View History

2021-07-28 22:29:23 +03:00
<script>
2021-07-31 23:21:39 +03:00
import FlowStreamReference32 from 'carbon-icons-svelte/lib/FlowStreamReference32';
import ChartClusterBar32 from 'carbon-icons-svelte/lib/ChartClusterBar32';
import MachineLearningModel32 from 'carbon-icons-svelte/lib/MachineLearningModel32';
2021-07-31 23:06:14 +03:00
import { BarLoader } from 'svelte-loading-spinners';
import TextField from '../components/Form/TextField.svelte';
import PrimaryButton from '../components/PrimaryButton/index.svelte';
import { VARIANTS } from '../components/PrimaryButton/constants';
import { getSupabase } from '../utils/functions/supabase';
2021-08-18 20:23:56 +03:00
import { validateEmail } from '../utils/functions/validateEmail';
2021-07-28 22:29:23 +03:00
2021-07-31 23:06:14 +03:00
let email;
let isAdding = false;
let success = false;
const supabase = getSupabase();
const animate = 'transition delay-75 duration-300 ease-in-out';
const areas = [
2021-07-28 22:29:23 +03:00
{
2021-07-31 23:06:14 +03:00
title: 'Access',
description:
'Quickly find any material you need to get your job done. ClassroomIO offers the All-in-on-platform',
2021-07-28 22:29:23 +03:00
},
{
2021-07-31 23:06:14 +03:00
title: 'Analytics',
description:
'Avoid assumptions, better understand the needs of your classrooms and give students a personlized experience',
2021-07-28 22:29:23 +03:00
},
{
2021-07-31 23:06:14 +03:00
title: 'Automation',
description:
'Lesson reminders, deadline reminders and many other automated alerts to help everyone in the learning process be proactive',
2021-07-28 22:29:23 +03:00
},
];
2021-07-31 23:06:14 +03:00
async function handleSubmit() {
2021-08-18 20:23:56 +03:00
if (!email || !validateEmail(email)) return;
2021-07-31 23:06:14 +03:00
isAdding = true;
2021-07-28 22:29:23 +03:00
2021-07-31 23:06:14 +03:00
await supabase
.from('waitinglist')
.insert([{ email }], { returning: 'minimal' });
success = true;
setTimeout(() => {
isAdding = false;
success = false;
email = null;
}, 5000);
}
2021-07-28 22:29:23 +03:00
</script>
2021-07-31 23:21:39 +03:00
<svelte:head>
<title>ClassroomIO - The classroom software</title>
</svelte:head>
2021-08-18 19:47:02 +03:00
<div class="root w-screen flex items-center justify-center flex-col m-2 sm:m-0">
2021-10-11 11:38:48 +03:00
<!--
2021-07-31 23:06:14 +03:00
<img
2021-10-11 11:38:48 +03:00
src="/logo-192.png"
2021-07-31 23:06:14 +03:00
alt="ClassroomIO logo"
class="rounded inline-block mx-auto w-20 h-20 sm:w-auto sm:h-auto"
data-atf="1"
/>
2021-10-11 11:38:48 +03:00
-->
2021-07-31 23:06:14 +03:00
<div>
<h3 class="text-4xl text-center">
Classroom<span class="text-blue-700">IO</span>
</h3>
<p class="text-lg text-center">
2021-07-31 23:21:39 +03:00
The operating system for classroooms of the future 🚀🚀🚀.
2021-07-31 23:06:14 +03:00
</p>
2021-10-11 11:38:48 +03:00
2021-07-28 22:29:23 +03:00
</div>
2021-07-31 23:06:14 +03:00
<form on:submit|preventDefault={handleSubmit} class="my-4">
<div class="flex items-center flex-col sm:flex-row">
{#if success}
<p>You have been added successfully. Thanks for joining.</p>
{:else}
<TextField
bind:value={email}
type="email"
placeholder="Enter your email.."
className="mr-3 my-2"
inputClassName="rounded-md"
isRequired={true}
isDisabled={isAdding}
/>
<PrimaryButton
type="submit"
variant={isAdding ? VARIANTS.OUTLINED : VARIANTS.CONTAINED}
className="py-2 w-full justify-center sm:w-auto {isAdding &&
'py-4 border-blue-700'}"
isDisabled={isAdding}
2021-07-28 22:29:23 +03:00
>
2021-07-31 23:06:14 +03:00
{#if isAdding}
<BarLoader size="30" color="#1d4ed8" unit="px" duration="1s" />
{:else}
Join waiting list
{/if}
</PrimaryButton>
{/if}
2021-07-28 22:29:23 +03:00
</div>
2021-07-31 23:06:14 +03:00
</form>
2021-07-28 22:29:23 +03:00
2021-07-31 23:06:14 +03:00
<div class="flex flex-col md:flex-row">
2021-07-31 23:21:39 +03:00
{#each areas as area, index}
2021-07-31 23:06:14 +03:00
<div
class="box m-3 bg-white rounded-md py-4 px-12 active shadow-xl border-2 hover:border-blue-700 {animate}"
>
2021-07-31 23:21:39 +03:00
<h3 class="text-3xl">
{#if index === 0}
<FlowStreamReference32 class="carbon-icon" />
{:else if index === 1}
<ChartClusterBar32 class="carbon-icon" />
{:else if index === 2}
<MachineLearningModel32 class="carbon-icon" />
{/if}
{area.title}
</h3>
2021-07-31 23:06:14 +03:00
<p>{area.description}</p>
2021-07-28 22:29:23 +03:00
</div>
2021-07-31 23:06:14 +03:00
{/each}
2021-07-28 22:29:23 +03:00
</div>
</div>
<style>
2021-07-31 23:06:14 +03:00
.box {
max-width: 350px;
2021-07-28 22:29:23 +03:00
}
2021-08-18 19:47:02 +03:00
@media (min-width: 640px) {
.root {
height: 93vh;
}
}
2021-07-28 22:29:23 +03:00
</style>