Files
classroomio/apps/dashboard/src/lib/features/ui/backdrop.svelte
T

35 lines
780 B
Svelte
Raw Normal View History

2023-10-30 04:52:00 +00:00
<script lang="ts">
2025-11-01 15:49:29 +01:00
interface Props {
disableCenteredContent?: boolean;
className?: string;
children?: import('svelte').Snippet;
}
let { disableCenteredContent = false, className = '', children }: Props = $props();
2023-10-30 04:52:00 +00:00
</script>
2025-11-01 15:49:29 +01:00
<div class="root {!className.includes('opacity') && 'opacity-100'} {!disableCenteredContent && 'center'} {className}">
{@render children?.()}
2021-09-11 19:27:11 +03:00
</div>
<style>
.root {
top: 0;
left: 0;
right: 0;
bottom: 0;
position: fixed;
2021-12-30 22:30:30 +02:00
background-color: rgba(0, 0, 0, 0.3);
2021-09-11 19:27:11 +03:00
-webkit-tap-highlight-color: transparent;
color: #fff;
z-index: 1201;
transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}
2023-10-30 04:52:00 +00:00
.center {
display: flex;
align-items: center;
justify-content: center;
}
2021-09-11 19:27:11 +03:00
</style>