aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--picarones-elm/src/Main.elm6
1 files changed, 5 insertions, 1 deletions
diff --git a/picarones-elm/src/Main.elm b/picarones-elm/src/Main.elm
index 56cf48f..014d2f4 100644
--- a/picarones-elm/src/Main.elm
+++ b/picarones-elm/src/Main.elm
@@ -82,10 +82,14 @@ body model = div []
-- that these are all loaded on startup, with visibility done through
-- z indices so we won't have lags while switching between them.
slideView : Int -> Int -> String -> List (Html Msg)
-slideView i max prefix = List.range 0 (max - 1)
+slideView i max prefix = mkInterval i max -- List.range 0 (max - 1)
|> List.map (\x -> (prefix ++ (padNum 2 (x+1)) ++ ".png", x == i))
|> List.map (\(path,t) -> img [src path, onTop t] [])
+mkInterval : Int -> Int -> List Int
+mkInterval i m = List.range (i-2) (i+2)
+ |> List.map (\x -> modBy m x)
+
onTop t = style "z-index" (String.fromInt (if t then 10 else 0))
-- format an int with prefixed 0's — apparently elm doesn't have a