aboutsummaryrefslogtreecommitdiff
path: root/picarones-elm/src/Switcher.elm
diff options
context:
space:
mode:
authorstuebinm2021-03-15 18:38:02 +0100
committerstuebinm2021-03-15 18:38:02 +0100
commit0596b9f6c561daa67945adb81570efd30650dffd (patch)
tree4e86c41cd264dd9220d24cc9fe564a93b7a84f12 /picarones-elm/src/Switcher.elm
parent393186f9ebf0bf43a1add8bd8d0e37be566ae8cc (diff)
Add a display view which does nothing but display the slides
(should be useful e.g. as input for a screen recorder)
Diffstat (limited to 'picarones-elm/src/Switcher.elm')
-rw-r--r--picarones-elm/src/Switcher.elm39
1 files changed, 39 insertions, 0 deletions
diff --git a/picarones-elm/src/Switcher.elm b/picarones-elm/src/Switcher.elm
new file mode 100644
index 0000000..e1a7709
--- /dev/null
+++ b/picarones-elm/src/Switcher.elm
@@ -0,0 +1,39 @@
+module Switcher exposing (..)
+
+import Browser
+import Html exposing (Html, button, div, text, br, input, img)
+import Html.Attributes exposing (style, class, value, placeholder, src)
+import Html.Events exposing (onInput, onClick)
+import Html.Lazy exposing (lazy)
+import List exposing (foldr)
+
+import Main exposing (..)
+
+main = Browser.document
+ { init = init
+ , update = update
+ , view = view
+ , subscriptions = subscriptions
+ }
+
+
+{- VIEW COMPONENTS -}
+
+ -- our body consists of a slide container and a couple controls
+body : Model -> Html Msg
+body model = div []
+ [ div [class "slides"] (slideView model.slide model.max model.prefix)
+ , div [class "controls"]
+ [ button [ onClick PrevSlide ] [ text "←" ]
+ , text (String.fromInt (model.slide+1))
+ , button [ onClick NextSlide ] [ text "→" ]
+ ]
+ ]
+
+
+view : Model -> Browser.Document Msg
+view model = { title = "Picarones"
+ , body = [body model]
+ }
+
+