-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
92 lines (90 loc) · 3.88 KB
/
index.html
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test - @fylgja/alpinejs-dialog</title>
<link href="https://unpkg.com/fylgja/fylgja.css" rel="stylesheet">
<script defer src="https://unpkg.com/@fylgja/alpinejs-dialog/dist/index.min.js"></script>
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>
</head>
<body>
<main class="min-h-screen flex flex-col justify-center">
<a href="https://fylgja.dev/" target="_blank" rel="noopener noreferrer" class="block py-8 mx-auto">
<img
src="https://raw.githubusercontent.com/fylgja/.github/main/assets/logo.svg"
alt="Fylgja CSS"
width="300"
height="130"
>
</a>
<div x-data="{ openModal: false, openOffcanvas: false }" class="mt-8">
<div class="flex flex-wrap justify-center"
style="font-size: clamp(1rem, 1.2vw, 1.25rem); --btn-border-width: 2px;">
<button class="btn -theme m-1" @click="openModal = !openModal">Open Alpine Dialog Modal</button>
<button class="btn -outline m-1" @click="openOffcanvas = !openOffcanvas">Open Alpine Dialog
Offcanvas</button>
</div>
<dialog x-show="openModal" x-htmldialog.noscroll="openModal = false">
<div class="dialog-header flex justify-between items-center border-block-end pb-4 mb-4">
<span class="h3 my-0">Fylgja Dialog Modal</span>
<button class="btn -icon" @click="openModal = false">X</button>
</div>
<div class="dialog-inner">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
<p>
Magnam, debitis dolor unde ab veritatis repellat hic!<br>
Cum hic corporis earum nemo facilis obcaecati soluta sapiente quia iure.<br>
Sequi, molestiae eos!
</p>
</div>
<p class="weight-bold">
Also
<a href="https://fylgja.dev/components/dialog/" target="_blank" rel="noopener noreferrer">
checkout the Fylgja Dialog,
</a>
that powers all the styling for the dialog
</p>
</dialog>
<dialog x-show="openOffcanvas" x-htmldialog.noscroll="openOffcanvas = false" class="offcanvas">
<div class="dialog-header flex justify-between items-center border-block-end pb-4 mb-4">
<span class="h3 my-0">Fylgja Dialog Offcanvas</span>
<button class="btn -icon" @click="openOffcanvas = false">X</button>
</div>
<div class="dialog-inner">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
<p>
Magnam, debitis dolor unde ab veritatis repellat hic!<br>
Cum hic corporis earum nemo facilis obcaecati soluta sapiente quia iure.<br>
Sequi, molestiae eos!
</p>
</div>
<p class="weight-bold">
Also
<a href="https://fylgja.dev/components/dialog/" target="_blank" rel="noopener noreferrer">
checkout the Fylgja Dialog,
</a>
that powers all the styling for the dialog
</p>
</dialog>
</div>
<div class="container py-12" style="--container-size: 68ch">
<div class="relative border-3" style="border-radius: 0.5em">
<div class="absolute inset-0 transform" style="--tx: 1em; --ty: 1em; border: inherit; border-radius: inherit"></div>
<pre class="relative my-0" style="--code-stroke: transparent; --code-bg: #fff; --code-font-size: 1rem;">
<code><script src="//unpkg.com/@fylgja/alpinejs-dialog" defer></script></code>
<code><script src="//unpkg.com/alpinejs" defer></script></code>
<code> </code>
<code><div x-data="{ open: false }"></code>
<code> <button @click="open = true">Expand</button></code>
<code> </code>
<code> <dialog x-show="open" x-htmldialog="open = false"></code>
<code> Content...</code>
<code> </dialog></code>
<code></div></code></pre>
</div>
</div>
</main>
</body>
</html>