Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010250
toggle-modal.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
toggle-modal.ts
View Options
import
{
FlatTemplatable
,
tempstream
}
from
"tempstream"
;
import
{
makeSlug
}
from
"../utils/utils.js"
;
export
function
toggleModal
(
options
:
{
name
:
string
;
contentWrapped
:
(
id
:
string
)
=>
FlatTemplatable
|
Promise
<
FlatTemplatable
>
;
contentUnwrapped
:
(
id
:
string
)
=>
FlatTemplatable
|
Promise
<
FlatTemplatable
>
;
})
{
const
{
contentWrapped
,
contentUnwrapped
,
name
}
=
options
;
const
id
=
makeSlug
(
name
);
return
tempstream
/* HTML */
`<style>
.toggle-modal__wrapped {
display: none;
}
@media (max-width: 960px) {
.toggle-modal__wrapped {
display: block;
}
.toggle-modal__unwrapped {
display: none;
}
#
${
id
}
{
display: none;
}
#
${
id
}
:checked ~ .toggle-modal__wrapped {
display: none;
}
#
${
id
}
:checked ~ .toggle-modal__unwrapped {
display: block;
position: fixed;
height: 100vh;
width: 100vw;
top: 0;
left: 0;
background-color: white;
z-index: 99;
overflow-y: scroll;
}
}
</style>
<div class="toggle-modal toggle-modal--
${
id
}
">
<input id="
${
id
}
" name="
${
id
}
" type="checkbox" autocomplete="off" />
<div class="toggle-modal__wrapped">
${
contentWrapped
(
id
)
}
</div>
<div class="toggle-modal__unwrapped">
${
contentUnwrapped
(
id
)
}
</div>
</div>`
;
}
File Metadata
Details
Attached
Mime Type
text/html
Expires
Wed, May 7, 19:38 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
624907
Default Alt Text
toggle-modal.ts (1 KB)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment