|
1 | 1 | <script lang="ts"> |
2 | | - import Container from '$lib/components/Container.svelte'; |
| 2 | + import { metaApi } from '$lib/api'; |
| 3 | + import { handleApiError } from '$lib/errorhandling/apiErrorHandling'; |
| 4 | + import { onMount } from 'svelte'; |
| 5 | +
|
| 6 | + let deviceCount = $state(0); |
| 7 | +
|
| 8 | + onMount(async () => { |
| 9 | + try { |
| 10 | + const { data } = await metaApi.publicGetOnlineDevicesStatistics(); |
| 11 | + deviceCount = data.devicesOnline; |
| 12 | + } catch (err) { |
| 13 | + handleApiError(err); |
| 14 | + } |
| 15 | + }); |
3 | 16 | </script> |
4 | 17 |
|
5 | | -<Container> |
6 | | - <div class="flex flex-col"> |
7 | | - <h1 class="text-5xl leading-none font-bold text-gray-800 dark:text-white"> |
8 | | - Welcome to <span class="text-blue-600">OpenShock</span> |
9 | | - </h1> |
10 | | - <p class="text-2xl font-light text-gray-600">[Put a slogan here]</p> |
11 | | - <div class="mt-8 flex flex-row items-center justify-start space-x-4"> |
12 | | - <a href="signup" class="rounded bg-blue-600 px-4 py-2 font-bold text-white hover:bg-blue-700"> |
13 | | - Get Started |
14 | | - </a> |
15 | | - <a |
16 | | - href="https://wiki.openshock.org/" |
17 | | - class="rounded bg-gray-200 px-4 py-2 font-bold text-gray-700 hover:bg-gray-300" |
18 | | - > |
19 | | - Documentation |
20 | | - </a> |
21 | | - </div> |
| 18 | +<section |
| 19 | + class="flex flex-col items-center justify-center h-full text-white text-center space-y-6 px-6" |
| 20 | +> |
| 21 | + <span class="flex"> |
| 22 | + <img class="h-20 pr-4" src="/IconSpinning.svg" alt="logo" /> |
| 23 | + <img class="h-20" src="/LogoBakedFont.svg" alt="logo" /> |
| 24 | + </span> |
| 25 | + <p class="text-lg md:text-2xl opacity-75"> |
| 26 | + The go-to platform for safe, reliable, real low-latency remote shocking.<br /> |
| 27 | + <span class="font-semibold">{deviceCount}</span> people online right now. |
| 28 | + </p> |
| 29 | + <div class="flex space-x-4 pt-8 text-sm opacity-75"> |
| 30 | + <a href="https://openshock.org" target="_blank" rel="noopener" class="hover:underline"> |
| 31 | + Learn More |
| 32 | + </a> |
| 33 | + <span>·</span> |
| 34 | + <a href="https://wiki.openshock.org" target="_blank" rel="noopener" class="hover:underline"> |
| 35 | + Wiki |
| 36 | + </a> |
22 | 37 | </div> |
23 | | - <div class="placeholder h-3/4 w-1/2 rounded-none"></div> |
24 | | -</Container> |
| 38 | +</section> |
0 commit comments