Files
classroomio/apps/dashboard/src/routes/+page.svelte
T

110 lines
3.5 KiB
Svelte
Raw Normal View History

2021-07-28 22:29:23 +03:00
<script>
import FlowStreamReferenceIcon from 'carbon-icons-svelte/lib/FlowStreamReference.svelte';
import ChartClusterBarIcon from 'carbon-icons-svelte/lib/ChartClusterBar.svelte';
import MachineLearningModelIcon from 'carbon-icons-svelte/lib/MachineLearningModel.svelte';
import TextField from '$lib/components/Form/TextField.svelte';
import PrimaryButton from '$lib/components/PrimaryButton/index.svelte';
import { getSupabase } from '$lib/utils/functions/supabase';
import { validateEmail } from '$lib/utils/functions/validateEmail';
2021-07-28 22:29:23 +03:00
2023-11-07 08:51:49 +00:00
let email = '';
2021-07-31 23:06:14 +03:00
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
await supabase.from('waitinglist').insert([{ email }]);
2021-07-31 23:06:14 +03:00
success = true;
setTimeout(() => {
isAdding = false;
success = false;
2023-11-07 08:51:49 +00:00
email = '';
2021-07-31 23:06:14 +03:00
}, 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>
2024-01-20 10:17:16 +01:00
<div class="md:h-[93vh] w-screen flex items-center justify-center flex-col m-2 sm:m-0 font-sans">
<!--
<img
src="/logo-192.png"
alt="ClassroomIO logo"
class="rounded inline-block mx-auto w-20 h-20 sm:w-auto sm:h-auto"
data-atf="1"
/>
-->
2021-12-30 22:30:30 +02:00
<div>
<h3 class="dark:text-white text-4xl text-center">
2023-08-20 19:08:48 +00:00
Classroom<span class="text-primary-700">IO</span>
2021-07-31 23:06:14 +03:00
</h3>
<p class="dark:text-white 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-07-28 22:29:23 +03:00
</div>
2024-01-20 10:17:16 +01:00
<form on:submit|preventDefault={handleSubmit} class="my-4 hidden">
2021-07-31 23:06:14 +03:00
<div class="flex items-center flex-col sm:flex-row">
{#if success}
<p class="dark:text-white">You have been added successfully. Thanks for joining.</p>
2021-07-31 23:06:14 +03:00
{:else}
<TextField
bind:value={email}
type="email"
placeholder="Enter your email.."
className="mr-3 my-2"
isRequired={true}
isDisabled={isAdding}
/>
<PrimaryButton type="submit" isLoading={isAdding}>Join waiting list</PrimaryButton>
2021-07-31 23:06:14 +03:00
{/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
2024-01-20 10:17:16 +01:00
<div class="flex flex-col md:flex-row mt-4">
2021-07-31 23:21:39 +03:00
{#each areas as area, index}
2021-07-31 23:06:14 +03:00
<div
2024-01-20 10:17:16 +01:00
class="max-w-[350px] m-3 bg-white dark:bg-black rounded-md py-3 px-12 active shadow-xl border-2 hover:border-primary-700 {animate}"
2021-07-31 23:06:14 +03:00
>
<h3 class="dark:text-white text-3xl">
2021-07-31 23:21:39 +03:00
{#if index === 0}
<FlowStreamReferenceIcon size={32} class="carbon-icon dark:text-white" />
2021-07-31 23:21:39 +03:00
{:else if index === 1}
<ChartClusterBarIcon size={32} class="carbon-icon dark:text-white" />
2021-07-31 23:21:39 +03:00
{:else if index === 2}
<MachineLearningModelIcon size={32} class="carbon-icon dark:text-white" />
2021-07-31 23:21:39 +03:00
{/if}
{area.title}
</h3>
<p class="dark:text-white">{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>