server/frontend/ui/src/lib/components/HeaderClock.svelte

54 lines
1.5 KiB
Svelte
Raw Normal View History

<script>
import {
ButtonGroup,
Icon,
} from 'sveltestrap';
import Clock from './Clock.svelte';
import { challengeInfo } from '$lib/stores/challengeinfo.js';
import { settings } from '$lib/stores/settings.js';
</script>
2023-05-12 12:53:15 +00:00
{#if $settings && $settings.end}
{#if $settings.end - $settings.start > 0}
<Clock
class="display-2 text-end text-md-center"
/>
{:else}
<div class="d-flex h-100 justify-content-center align-items-center">
<ButtonGroup size="lg">
2022-06-12 10:15:52 +00:00
<a
2022-06-12 10:15:52 +00:00
href="{$challengeInfo.main_link}"
class="btn btn-light"
2022-06-12 10:15:52 +00:00
class:disabled={$challengeInfo.main_link === ''}
>
<Icon name="ui-checks-grid" />
Accueil
</a>
<a
2021-09-01 09:20:41 +00:00
href="rank"
class="btn btn-light"
>
<Icon name="sort-down" />
Classement
</a>
<a
2022-05-01 20:33:59 +00:00
href="{$challengeInfo.videoslink}"
class="btn btn-light"
2022-05-01 20:33:59 +00:00
class:disabled={$challengeInfo.videoslink === ''}
>
<Icon name="laptop-fill" />
Vidéos
</a>
</ButtonGroup>
</div>
{/if}
{:else}
<div class="d-flex h-100 justify-content-center align-items-center">
<h1 class="display-3 m-0">
2023-05-12 12:53:15 +00:00
{$challengeInfo.title}
</h1>
</div>
{/if}