2023-04-02 02:59:20 +02:00
|
|
|
<script lang="ts">
|
2023-05-07 23:19:30 +02:00
|
|
|
import {createEventDispatcher} from "svelte";
|
|
|
|
import {XCircleIcon} from "@rgossiaux/svelte-heroicons/solid";
|
2023-04-06 01:33:08 +02:00
|
|
|
|
2023-05-07 23:19:30 +02:00
|
|
|
/**
|
|
|
|
* The slotted element will be shown on top, with a lower-opacity border
|
|
|
|
*/
|
|
|
|
const dispatch = createEventDispatcher<{ close }>();
|
2023-04-02 02:59:20 +02:00
|
|
|
</script>
|
|
|
|
|
2023-05-07 23:19:30 +02:00
|
|
|
<div class="absolute top-0 right-0 w-screen h-screen p-4 md:p-6" style="background-color: #00000088">
|
|
|
|
<div class="content normal-background">
|
|
|
|
<div class="rounded-xl">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
<slot name="close-button">
|
|
|
|
<!-- The close button is placed _after_ the default slot in order to always paint it on top -->
|
|
|
|
<div class="w-8 h-8 absolute right-10 top-10 cursor-pointer" on:click={() => dispatch("close")}>
|
|
|
|
<XCircleIcon/>
|
|
|
|
</div>
|
|
|
|
</slot>
|
|
|
|
</div>
|
2023-04-02 02:59:20 +02:00
|
|
|
</div>
|
2023-05-07 23:19:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.content {
|
|
|
|
height: calc( 100vh - 2rem );
|
|
|
|
border-radius: 0.5rem;
|
|
|
|
overflow-x: auto;
|
|
|
|
box-shadow: 0 0 1rem #00000088;
|
|
|
|
}
|
|
|
|
</style>
|