aboutsummaryrefslogtreecommitdiff
path: root/src/Styles.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/Styles.elm')
-rw-r--r--src/Styles.elm87
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 @@
1module Styles exposing (..) 1module Styles exposing (..)
2 2
3import Base exposing (WordStatus(..))
3import Css exposing (..) 4import Css exposing (..)
4import Css.Global exposing (global, selector) 5import Css.Global exposing (global, selector)
5import Html 6import Html
@@ -10,27 +11,43 @@ styledButton : List (Attribute msg) -> List (Html msg) -> Html msg
10styledButton = 11styledButton =
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
23styledInput : List (Attribute msg) -> List (Html msg) -> Html msg 27correctInputStyle : Style
24styledInput = 28correctInputStyle =
29 color (hex "#000")
30
31
32wrongInputStyle : Style
33wrongInputStyle =
34 wrongWordStyle
35
36
37styledInput : Bool -> List (Attribute msg) -> List (Html msg) -> Html msg
38styledInput 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
55styledTextBox = 72styledTextBox =
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
94wrongWordStyle : Style
95wrongWordStyle =
96 color (hex "#f07178")
97
98
99correctWordStyle : Style
100correctWordStyle =
101 color (hex "#13CA91")
102
103
104todoWordStyle : Style
105todoWordStyle =
106 color (hex "#787878")
107
108
109currentWordStyle : Style
110currentWordStyle =
111 textDecoration underline
112
113
114wordStyle : WordStatus -> Style
115wordStyle w =
116 case w of
117 Correct ->
118 correctWordStyle
119
120 Wrong ->
121 wrongWordStyle
122
123 Todo ->
124 todoWordStyle
125
126 CurrentWord ->
127 currentWordStyle