2021-04-09 12:02:53 +02:00
|
|
|
<script>
|
2021-05-04 12:04:42 +02:00
|
|
|
import "@spectrum-css/toast/dist/index-vars.css"
|
|
|
|
import Portal from "svelte-portal"
|
|
|
|
import { flip } from "svelte/animate"
|
|
|
|
import { notifications } from "../Stores/notifications"
|
2021-07-30 14:58:34 +02:00
|
|
|
import Notification from "./Notification.svelte"
|
|
|
|
import { fly } from "svelte/transition"
|
2021-04-09 12:02:53 +02:00
|
|
|
</script>
|
2021-05-04 12:04:42 +02:00
|
|
|
|
|
|
|
<Portal target=".modal-container">
|
2021-04-09 12:02:53 +02:00
|
|
|
<div class="notifications">
|
2021-05-04 12:04:42 +02:00
|
|
|
{#each $notifications as { type, icon, message, id } (id)}
|
2021-07-30 14:58:34 +02:00
|
|
|
<div animate:flip transition:fly={{ y: -30 }}>
|
|
|
|
<Notification {type} {icon} {message} />
|
2021-04-09 12:02:53 +02:00
|
|
|
</div>
|
|
|
|
{/each}
|
|
|
|
</div>
|
2021-05-04 12:04:42 +02:00
|
|
|
</Portal>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.notifications {
|
|
|
|
position: fixed;
|
2021-07-30 14:58:34 +02:00
|
|
|
top: 20px;
|
2021-05-04 12:04:42 +02:00
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
margin: 0 auto;
|
|
|
|
padding: 0;
|
|
|
|
z-index: 9999;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: center;
|
|
|
|
pointer-events: none;
|
2021-07-30 14:58:34 +02:00
|
|
|
gap: 10px;
|
2021-05-04 12:04:42 +02:00
|
|
|
}
|
|
|
|
</style>
|