mirror of
				https://github.com/Djeeberjr/fw-anwesenheit.git
				synced 2025-11-03 23:24:10 +00:00 
			
		
		
		
	added Modal component
This commit is contained in:
		
							parent
							
								
									a25d26473a
								
							
						
					
					
						commit
						fb3c43b53c
					
				
							
								
								
									
										33
									
								
								web/src/lib/Modal.svelte
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								web/src/lib/Modal.svelte
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,33 @@
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
  import type { Snippet } from 'svelte';
 | 
			
		||||
  let { children }: { children: Snippet } = $props();
 | 
			
		||||
 | 
			
		||||
  let dialog:  HTMLDialogElement; 
 | 
			
		||||
 | 
			
		||||
  export function open(){
 | 
			
		||||
    dialog.showModal()
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  export function close(){
 | 
			
		||||
    dialog.close();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<dialog
 | 
			
		||||
  bind:this={dialog}
 | 
			
		||||
  closedby="any"
 | 
			
		||||
  class="bg-gradient-to-br from-blue-100 to-indigo-200 p-5 center-dialog rounded-2xl backdrop:bg-black/50 backdrop:backdrop-blur-xs"
 | 
			
		||||
>
 | 
			
		||||
  {@render children?.()}
 | 
			
		||||
</dialog>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
  .center-dialog {
 | 
			
		||||
    position: fixed;
 | 
			
		||||
    top: 50%;
 | 
			
		||||
    left: 50%;
 | 
			
		||||
    transform: translate(-50%, -50%);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user