about summary refs log tree commit diff
path: root/website/sandbox/learnpianochords/src/UI.elm
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-04-18T13·24+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-04-18T13·24+0100
commit720d727d64593baaa6653f77fc5fb6f5fc8868d5 (patch)
tree2fb42963555dc8f3638222f45578e268b898e2f3 /website/sandbox/learnpianochords/src/UI.elm
parentf0803547e47827a3fb3b9fb1f89949fa270b6d8e (diff)
Orient "Press to practice" button
Rotate the "Press to practice" copy to ensure that it is readable in landscape
mode.
Diffstat (limited to 'website/sandbox/learnpianochords/src/UI.elm')
-rw-r--r--website/sandbox/learnpianochords/src/UI.elm46
1 files changed, 46 insertions, 0 deletions
diff --git a/website/sandbox/learnpianochords/src/UI.elm b/website/sandbox/learnpianochords/src/UI.elm
index 00114332db89..ac15b37d54fe 100644
--- a/website/sandbox/learnpianochords/src/UI.elm
+++ b/website/sandbox/learnpianochords/src/UI.elm
@@ -114,3 +114,49 @@ textField { placeholderText, handleInput, classes } =
         , placeholder placeholderText
         ]
         []
+
+
+overlayButton :
+    { label : String
+    , handleClick : msg
+    , isVisible : Bool
+    }
+    -> Html msg
+overlayButton { label, handleClick, isVisible } =
+    let
+        classes =
+            [ "bg-red-600"
+            , "absolute"
+            , "top-0"
+            , "left-0"
+            , "h-screen"
+            , "w-screen"
+            , "z-30"
+            ]
+
+        extraClasses =
+            if isVisible then
+                [ "opacity-100" ]
+
+            else
+                [ "opacity-0" ]
+    in
+    button
+        [ List.concat [ classes, extraClasses ] |> tw |> class
+        , style "background-color" "rgba(0,0,0,0.30)"
+        , onClick handleClick
+        ]
+        [ h1
+            [ style "-webkit-text-stroke-width" "2px"
+            , style "-webkit-text-stroke-color" "black"
+            , class <|
+                tw
+                    [ "transform"
+                    , "-rotate-90"
+                    , "text-6xl"
+                    , "text-white"
+                    , "font-mono"
+                    ]
+            ]
+            [ text label ]
+        ]