aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/Utils.elm
blob: b6c4bd5d90948e1dabf4b3f89f2de7e814ed1344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
module Utils exposing (..)

import Html
import Html.Styled exposing (..)
import Html.Styled.Attributes exposing (..)
import Html.Styled.Events exposing (..)


between : ( Float, Float ) -> Float -> Bool
between ( l, u ) v =
    v >= l && v <= u


range : Int -> Int -> Int -> List Int
range start stop step =
    if start >= stop then
        []

    else
        start :: range (start + step) stop step


modelViewer : List (Attribute msg) -> List (Html msg) -> Html msg
modelViewer attributes children =
    node "model-viewer" attributes children


cameraControls : Attribute msg
cameraControls =
    attribute "camera-controls" ""


autoRotate : Attribute msg
autoRotate =
    attribute "auto-rotate" ""


ar : Attribute msg
ar =
    attribute "ar" ""


arSrc : String -> Attribute msg
arSrc src =
    attribute "src" src


arIosSrc : String -> Attribute msg
arIosSrc src =
    attribute "ios-src" src


arModes : String -> Attribute msg
arModes mode =
    attribute "ar-modes" mode


loading : String -> Attribute msg
loading mode =
    attribute "loading" mode