-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathApp.svelte
More file actions
34 lines (32 loc) · 703 Bytes
/
App.svelte
File metadata and controls
34 lines (32 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script lang="ts">
import { createBlendy, type Blendy } from '../../src'
import { onMount } from 'svelte'
import './style.css'
import Modal from './Modal.svelte'
let blendy: Blendy | null = null
let showModal = false
onMount(() => {
blendy = createBlendy()
})
</script>
<div>
{#if showModal}
<div class="modal-container">
<Modal
onclose={() => {
blendy?.untoggle('example', () => {
showModal = false
})
}}
></Modal>
</div>
{/if}
<button
class="button"
data-blendy-from="example"
onclick={() => {
showModal = true
blendy?.toggle('example')
}}><span>Open</span></button
>
</div>