diff options
Diffstat (limited to 'frontend/src/Utils.elm')
-rw-r--r-- | frontend/src/Utils.elm | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/frontend/src/Utils.elm b/frontend/src/Utils.elm index 825e4b7..b6c4bd5 100644 --- a/frontend/src/Utils.elm +++ b/frontend/src/Utils.elm | |||
@@ -1,5 +1,10 @@ | |||
1 | module Utils exposing (..) | 1 | module Utils exposing (..) |
2 | 2 | ||
3 | import Html | ||
4 | import Html.Styled exposing (..) | ||
5 | import Html.Styled.Attributes exposing (..) | ||
6 | import Html.Styled.Events exposing (..) | ||
7 | |||
3 | 8 | ||
4 | between : ( Float, Float ) -> Float -> Bool | 9 | between : ( Float, Float ) -> Float -> Bool |
5 | between ( l, u ) v = | 10 | between ( l, u ) v = |
@@ -13,3 +18,43 @@ range start stop step = | |||
13 | 18 | ||
14 | else | 19 | else |
15 | start :: range (start + step) stop step | 20 | start :: range (start + step) stop step |
21 | |||
22 | |||
23 | modelViewer : List (Attribute msg) -> List (Html msg) -> Html msg | ||
24 | modelViewer attributes children = | ||
25 | node "model-viewer" attributes children | ||
26 | |||
27 | |||
28 | cameraControls : Attribute msg | ||
29 | cameraControls = | ||
30 | attribute "camera-controls" "" | ||
31 | |||
32 | |||
33 | autoRotate : Attribute msg | ||
34 | autoRotate = | ||
35 | attribute "auto-rotate" "" | ||
36 | |||
37 | |||
38 | ar : Attribute msg | ||
39 | ar = | ||
40 | attribute "ar" "" | ||
41 | |||
42 | |||
43 | arSrc : String -> Attribute msg | ||
44 | arSrc src = | ||
45 | attribute "src" src | ||
46 | |||
47 | |||
48 | arIosSrc : String -> Attribute msg | ||
49 | arIosSrc src = | ||
50 | attribute "ios-src" src | ||
51 | |||
52 | |||
53 | arModes : String -> Attribute msg | ||
54 | arModes mode = | ||
55 | attribute "ar-modes" mode | ||
56 | |||
57 | |||
58 | loading : String -> Attribute msg | ||
59 | loading mode = | ||
60 | attribute "loading" mode | ||