gallery/make-pages/NsfwWarning.hs

31 lines
800 B
Haskell

module NsfwWarning (What (..), script, dialog) where
import BuilderQQ
data What = Single | Gallery
instance CanBuild What where
build Single = "this art"
build Gallery = "some of the art in this gallery"
script :: Maybe What -> Builder
script Nothing = ""
script (Just _) = [b|<script src=/script/nsfw-warning.js type=module></script>|]
dialog :: Maybe What -> Builder
dialog Nothing = ""
dialog (Just what) = [b|@0
<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>
|]