-
Notifications
You must be signed in to change notification settings - Fork 1
/
dialog.tsx
232 lines (208 loc) · 9.65 KB
/
dialog.tsx
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
import type { VoidComponent } from "solid-js"
import { createSignal } from "solid-js"
import { Title } from "solid-start"
import Layout from "~/layouts/Layout"
import Modal from "solid-dialog"
import XCOMOperationBriefing from "~/components/XCOMOperationBriefing"
import XCOMInfoPanel from "~/components/XCOMInfoPanel"
const DialogPage: VoidComponent = () => {
const [modalBasicIsOpen, setModalBasicIsOpen] = createSignal(false)
const closeModalBasic = () => setModalBasicIsOpen(false)
const [modalledWithChildrenIsOpen, setModalledWithChildrenIsOpen] = createSignal(false)
const closeModalledWithChildren = () => setModalledWithChildrenIsOpen(false)
const [modalStackIsOpen, setModalStackIsOpen] = createSignal(false)
const closeModalStack = () => setModalStackIsOpen(false)
const [modalAboutIsOpen, setModalAboutIsOpen] = createSignal(false)
const closeModalAbout = () => setModalAboutIsOpen(false)
return (
<Layout>
<Title>Dialog/modal examples and testing</Title>
<h1>Dialog/modal examples and testing</h1>
<div class="w-full flex flex-wrap gap-4 justify-evenly">
<button
type='button'
onClick={() => setModalBasicIsOpen(true)}
class='btn btn-primary text-2xl'
>
basic modal
</button>
<Modal
isShown={modalBasicIsOpen()}
closeModal={closeModalBasic}
>
May the blur be with you
</Modal>
<button
type='button'
onClick={() => setModalledWithChildrenIsOpen(true)}
class='btn btn-secondary text-2xl'
>
modalled with children
</button>
<Modal
isShown={modalledWithChildrenIsOpen()}
closeModal={closeModalledWithChildren}
dismissText='ACCEPT'
// disableDefaultDesktopStyles={true}
// disableDefaultMobileStyles={true}
modalStyles={{
background: "transparent",
"width": "90%",
"max-width": "666px",
"align-content": "left",
"color": "white",
}}
>
<XCOMOperationBriefing
title="Operation: BLURRY MODAL"
subtitle="Customizable and accessible modals for solid-js"
summary="NOT SURE IF TAILWIND WORKS HERE"
class="text-left"
>
<img src="https://picsum.photos/180/180" alt="random image" class="float-right ml-4" />
<p>Bacon ipsum dolor amet tongue hamburger short ribs venison prosciutto swine andouille bresaola kielbasa chuck. Tri-tip pork chop shank ball tip strip steak picanha, chicken cupim bacon sirloin ham fatback chislic.</p>
<p> </p>
<p>Fatback swine frankfurter bresaola short ribs spare ribs, shankle sausage picanha cow sirloin leberkas. Meatloaf hamburger leberkas, meatball ground round sirloin doner brisket shankle porchetta beef ham hock shoulder fatback.</p>
</XCOMOperationBriefing>
</Modal>
<button
type='button'
onClick={() => setModalStackIsOpen(true)}
class='btn btn-error btn-outline text-2xl'
>
FOOL STACK
</button>
<Modal
isShown={modalStackIsOpen()}
closeModal={closeModalStack}
modalStyles={{
background: "transparent",
"width": "100%",
"color": "white",
}}
dismissText="SYS64378"
>
<h1>FULL STACK DEV JOURNEY: <code>COMPLETE</code></h1>
</Modal>
<Modal
isShown={modalStackIsOpen()}
closeModal={closeModalStack}
modalStyles={{
background: "transparent",
"min-width": "100%",
"color": "slategray",
}}
dismissText={`and so do i`}
>
you know the rules
<iframe width="200" height="800" src="https://www.youtube.com/embed/BC68uKrBvdg" title="YouTube video player" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen />
</Modal>
<Modal
isShown={modalStackIsOpen()}
closeModal={closeModalStack}
modalStyles={{
background: "transparent",
"min-width": "100%",
"height": "100vh",
"align-content": "left",
"color": "white",
}}
dismissText="you pretty much have to click me"
>
<XCOMInfoPanel
class="h-2/3"
>
nearly there
</XCOMInfoPanel>
</Modal>
<Modal
isShown={modalStackIsOpen()}
closeModal={closeModalStack}
dismissText="k"
>
<pre> YOU DON'T{`\n`}
MATTER GIVE UP</pre>
</Modal>
<Modal
isShown={modalStackIsOpen()}
closeModal={closeModalStack}
dismissText='ACCEPT'
modalStyles={{
background: "transparent",
"width": "90%",
"max-width": "666px",
"align-content": "left",
"color": "white",
}}
>
<XCOMOperationBriefing
title="Operation: BLURRY MODAL"
subtitle="Customizable and accessible modals for solid-js"
summary="NOT SURE IF TAILWIND WORKS HERE"
>
<img src="https://picsum.photos/180/180" alt="random image" class="float-right ml-4" />
<p>Bacon ipsum dolor amet tongue hamburger short ribs venison prosciutto swine andouille bresaola kielbasa chuck. Tri-tip pork chop shank ball tip strip steak picanha, chicken cupim bacon sirloin ham fatback chislic.</p>
<p> </p>
<p>Fatback swine frankfurter bresaola short ribs spare ribs, shankle sausage picanha cow sirloin leberkas. Meatloaf hamburger leberkas, meatball ground round sirloin doner brisket shankle porchetta beef ham hock shoulder fatback.</p>
</XCOMOperationBriefing>
</Modal>
<Modal
isShown={modalStackIsOpen()}
closeModal={closeModalStack}
modalStyles={{
background: "transparent",
translate: '0 600%',
}}
>
qwer
</Modal>
<Modal
isShown={modalStackIsOpen()}
closeModal={closeModalStack}
modalStyles={{
background: "transparent",
"width": "90%",
"max-width": "666px",
"align-content": "center",
"color": "yellow",
"font-family": "Comic Sans MS, Comic Sans, cursive",
"font-size": "xxx-large",
translate: '0 -200%',
}}
dismissText="Wait, what...?"
>
</Modal>
<button
type='button'
onClick={() => setModalAboutIsOpen(true)}
class='btn btn-accent text-2xl'
>
About
</button>
<Modal
isShown={modalAboutIsOpen()}
closeModal={closeModalAbout}
modalStyles={{
background: "transparent",
"width": "90%",
"max-width": "666px",
"align-content": "left",
"color": "white",
}}
dismissText="sweet"
>
<XCOMInfoPanel>
<h2>Alaricus/solid-dialog</h2>
Library: <a href="https://github.com/Alaricus/solid-dialog" target="_blank" rel="noreferrer">github.com/Alaricus/solid-dialog</a><br />
<br />
Source of this page: <a href="https://github.com/AshSimmonds/solidstart-17/blob/main/src/routes/dialog.tsx" target="_blank" rel="noreferrer">/blob/main/src/routes/dialog.tsx</a><br />
<br />
<h3>PRs welcome</h3>
</XCOMInfoPanel>
</Modal>
</div>
</Layout>
)
}
export default DialogPage