diff options
Diffstat (limited to 'src/Styles.elm')
-rw-r--r-- | src/Styles.elm | 87 |
1 files changed, 69 insertions, 18 deletions
diff --git a/src/Styles.elm b/src/Styles.elm index 36bd1a3..db5b0ce 100644 --- a/src/Styles.elm +++ b/src/Styles.elm | |||
@@ -1,5 +1,6 @@ | |||
1 | module Styles exposing (..) | 1 | module Styles exposing (..) |
2 | 2 | ||
3 | import Base exposing (WordStatus(..)) | ||
3 | import Css exposing (..) | 4 | import Css exposing (..) |
4 | import Css.Global exposing (global, selector) | 5 | import Css.Global exposing (global, selector) |
5 | import Html | 6 | import Html |
@@ -10,27 +11,43 @@ styledButton : List (Attribute msg) -> List (Html msg) -> Html msg | |||
10 | styledButton = | 11 | styledButton = |
11 | styled | 12 | styled |
12 | button | 13 | button |
13 | [ margin (px 12) | 14 | [ marginTop (px 12) |
14 | , color (hex "#000") | 15 | , marginBottom (px 12) |
16 | , paddingTop (px 12) | ||
17 | , paddingBottom (px 12) | ||
18 | , paddingLeft (px 0) | ||
19 | , paddingRight (px 12) | ||
15 | , fontFamily monospace | 20 | , fontFamily monospace |
16 | , backgroundColor (hex "#ddd") | ||
17 | , border (px 0) | 21 | , border (px 0) |
22 | , backgroundColor (hex "#fff") | ||
18 | , borderRadius (px 4) | 23 | , borderRadius (px 4) |
19 | , padding (px 12) | ||
20 | ] | 24 | ] |
21 | 25 | ||
22 | 26 | ||
23 | styledInput : List (Attribute msg) -> List (Html msg) -> Html msg | 27 | correctInputStyle : Style |
24 | styledInput = | 28 | correctInputStyle = |
29 | color (hex "#000") | ||
30 | |||
31 | |||
32 | wrongInputStyle : Style | ||
33 | wrongInputStyle = | ||
34 | wrongWordStyle | ||
35 | |||
36 | |||
37 | styledInput : Bool -> List (Attribute msg) -> List (Html msg) -> Html msg | ||
38 | styledInput inputStatus = | ||
25 | styled | 39 | styled |
26 | input | 40 | input |
27 | [ margin (px 12) | 41 | [ fontFamily monospace |
28 | , color (hex "#000") | 42 | , if inputStatus then |
29 | , fontFamily monospace | 43 | correctInputStyle |
30 | , backgroundColor (hex "#eee") | 44 | |
31 | , border (px 0) | 45 | else |
32 | , borderRadius (px 4) | 46 | wrongInputStyle |
33 | , padding (px 12) | 47 | , border zero |
48 | , paddingTop (px 12) | ||
49 | , paddingBottom (px 12) | ||
50 | , width (pct 95) | ||
34 | ] | 51 | ] |
35 | 52 | ||
36 | 53 | ||
@@ -55,14 +72,12 @@ styledTextBox : List (Attribute msg) -> List (Html msg) -> Html msg | |||
55 | styledTextBox = | 72 | styledTextBox = |
56 | styled | 73 | styled |
57 | div | 74 | div |
58 | [ margin (px 12) | 75 | [ color (hex "#000") |
59 | , color (hex "#000") | ||
60 | , fontFamily monospace | 76 | , fontFamily monospace |
61 | , backgroundColor (hex "#eee") | ||
62 | , border (px 0) | 77 | , border (px 0) |
63 | , borderRadius (px 4) | 78 | , borderRadius (px 4) |
64 | , padding (px 12) | 79 | , paddingTop (px 12) |
65 | , width (px 500) | 80 | , paddingBottom (px 12) |
66 | , display inlineBlock | 81 | , display inlineBlock |
67 | ] | 82 | ] |
68 | 83 | ||
@@ -74,3 +89,39 @@ actionContainer = | |||
74 | [ padding (px 12) | 89 | [ padding (px 12) |
75 | , width (pct 100) | 90 | , width (pct 100) |
76 | ] | 91 | ] |
92 | |||
93 | |||
94 | wrongWordStyle : Style | ||
95 | wrongWordStyle = | ||
96 | color (hex "#f07178") | ||
97 | |||
98 | |||
99 | correctWordStyle : Style | ||
100 | correctWordStyle = | ||
101 | color (hex "#13CA91") | ||
102 | |||
103 | |||
104 | todoWordStyle : Style | ||
105 | todoWordStyle = | ||
106 | color (hex "#787878") | ||
107 | |||
108 | |||
109 | currentWordStyle : Style | ||
110 | currentWordStyle = | ||
111 | textDecoration underline | ||
112 | |||
113 | |||
114 | wordStyle : WordStatus -> Style | ||
115 | wordStyle w = | ||
116 | case w of | ||
117 | Correct -> | ||
118 | correctWordStyle | ||
119 | |||
120 | Wrong -> | ||
121 | wrongWordStyle | ||
122 | |||
123 | Todo -> | ||
124 | todoWordStyle | ||
125 | |||
126 | CurrentWord -> | ||
127 | currentWordStyle | ||