From 2ea48c4319e28e730dc332e383804c139f790a17 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 5 Oct 2020 19:57:17 -0500 Subject: [PATCH] Transcriptions fade in/out --- Main.purs | 4 ++-- index.scss | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Main.purs b/Main.purs index 0213ac3..1b216a0 100644 --- a/Main.purs +++ b/Main.purs @@ -64,10 +64,10 @@ triggerSpot doc n = do traverse_ (\(Tuple i (Tuple figure audio)) -> do style <- Style.style (Style.fromHTMLElement figure) if Just i == n then do - Style.setProperty style "display" "block" + Style.setProperty style "opacity" "1" HTMLMediaElement.play audio else do - Style.setProperty style "display" "none" + Style.setProperty style "opacity" "0" HTMLMediaElement.load audio ) (zip (1..5) figures) diff --git a/index.scss b/index.scss index 65c1e41..c3f68cc 100644 --- a/index.scss +++ b/index.scss @@ -183,7 +183,8 @@ body > p { } &.js figure { - display: none; + opacity: 0; + transition: opacity 0.75s; pointer-events: none; position: absolute; width: 45%; -- 2.38.4