gallery/make-pages/NsfwWarning.hs

43 lines
1.1 KiB
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></script>|]
dialog :: Maybe What -> Builder
dialog Nothing = ""
dialog (Just what) = [b|@0
<div class=dialog id=nsfw-dialog>
<div class=dialog-inner>
<h1>cw: lewd art</h1>
<img class=dialog-icon src=/style/stop_hand.svg>
<div class=dialog-message>
<p>
$what contains pornographic content that is
<strong>not suitable for minors</strong>.
<p>
by continuing, you are confirming that you are at least
<strong>eighteen years old</strong>.
</div>
<div class=dialog-buttons>
<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>
</div>
</div>
</div>
|]