2022-01-03 20:45:55 +01:00
|
|
|
module NsfwWarning (What (..), script, dialog) where
|
2020-10-06 22:07:39 +02:00
|
|
|
|
|
|
|
import BuilderQQ
|
|
|
|
|
|
|
|
|
2022-01-03 20:45:55 +01:00
|
|
|
data What = Single | Gallery
|
|
|
|
|
|
|
|
instance CanBuild What where
|
|
|
|
build Single = "this art"
|
2023-07-19 23:07:18 +02:00
|
|
|
build Gallery = "some of the art in this gallery"
|
2022-01-03 20:45:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
script :: Maybe What -> Builder
|
|
|
|
script Nothing = ""
|
2023-09-07 01:17:21 +02:00
|
|
|
script (Just _) = [b|<script src=/script/nsfw-warning.js type=module></script>|]
|
2022-01-03 20:45:55 +01:00
|
|
|
|
|
|
|
dialog :: Maybe What -> Builder
|
|
|
|
dialog Nothing = ""
|
2024-08-18 07:37:58 +02:00
|
|
|
dialog (Just what) = [b|
|
2024-08-05 23:36:30 +02:00
|
|
|
<dialog id=nsfw-dialog>
|
|
|
|
<h1>cw: lewd art</h1>
|
|
|
|
<img src=/style/stop_hand.svg>
|
|
|
|
<div> you must be an adult to view $what. no minors! </div>
|
|
|
|
<form>
|
|
|
|
<button id=nsfw-yes class=yes>i am an adult</button>
|
|
|
|
<a href=//crouton.net referrerpolicy=no-referrer>
|
|
|
|
<button id=nsfw-no class=no>i am not</button>
|
|
|
|
</a>
|
|
|
|
</form>
|
|
|
|
</dialog>
|
2020-10-06 22:07:39 +02:00
|
|
|
|]
|