2023-03-20 19:14:35 +01:00
|
|
|
<div class="container h-full mx-auto flex justify-center items-center flex-col">
|
|
|
|
<h1 class="my-3">Blackbird Chess</h1>
|
|
|
|
|
2023-08-16 20:42:54 +02:00
|
|
|
{#if typeof globalvars.user == 'undefined' }
|
|
|
|
{#each alertsvar as alert, i}
|
|
|
|
<aside class="alert variant-filled-{alert.class} mb-3">
|
|
|
|
<!-- Icon -->
|
|
|
|
<div><i class="text-2xl icon icon-exclamation-triangle"></i></div>
|
|
|
|
<!-- Message -->
|
|
|
|
<p class="alert-message">{alert.text}</p>
|
|
|
|
<!-- Actions -->
|
|
|
|
<div class="alert-actions">
|
|
|
|
<i on:click={closeWarning} data-index={i} class="icon icon-close"></i>
|
|
|
|
</div>
|
|
|
|
</aside>
|
|
|
|
{/each}
|
|
|
|
{/if}
|
|
|
|
<div class="card p-4 w-50 text-token space-y-4">
|
|
|
|
<slot />
|
|
|
|
</div>
|
2023-03-20 19:14:35 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<script lang="js">
|
2023-08-16 20:42:54 +02:00
|
|
|
import {alerts, globals} from "$lib/stores.js";
|
2023-03-20 19:14:35 +01:00
|
|
|
|
|
|
|
let alertsvar;
|
2023-08-16 20:42:54 +02:00
|
|
|
let globalvars;
|
|
|
|
|
2023-03-20 19:14:35 +01:00
|
|
|
function closeWarning(e) {
|
|
|
|
let index = e.target.dataset.index;
|
|
|
|
alerts.update(function (data) {
|
|
|
|
data.splice(index, 1)
|
|
|
|
return data;
|
|
|
|
})
|
|
|
|
}
|
|
|
|
alerts.subscribe((value) => {
|
|
|
|
alertsvar = value;
|
|
|
|
});
|
2023-08-16 20:42:54 +02:00
|
|
|
|
|
|
|
globals.subscribe(value => {
|
|
|
|
globalvars = value;
|
|
|
|
});
|
2023-03-20 19:14:35 +01:00
|
|
|
</script>
|