aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-11-25 11:39:26 +0000
committerAkshay <[email protected]>2020-11-25 11:39:26 +0000
commit24f8767278c7aaefde0dc6f0a4da3cc691431222 (patch)
tree9f92453812b9d9763d60ed6a8bb810e0ea1b94cd
parent1864a30418e652d23e0dbeaabcb8bc5c851c6c08 (diff)
add license notice, links to source and license in footer
-rw-r--r--src/Base.elm18
-rw-r--r--src/Data.elm22
-rw-r--r--src/Main.elm68
-rw-r--r--src/Styles.elm29
-rw-r--r--src/Utils.elm18
-rw-r--r--src/Views.elm40
6 files changed, 168 insertions, 27 deletions
diff --git a/src/Base.elm b/src/Base.elm
index 1d19723..e619939 100644
--- a/src/Base.elm
+++ b/src/Base.elm
@@ -1,3 +1,21 @@
1{-
2 - This file is part of `typers`.
3 -
4 - `typers` is free software: you can redistribute it and/or modify
5 - it under the terms of the GNU Affero Public License as published by
6 - the Free Software Foundation, either version 3 of the License, or
7 - (at your option) any later version.
8 -
9 - `typers` is distributed in the hope that it will be useful,
10 - but WITHOUT ANY WARRANTY; without even the implied warranty of
11 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 - GNU Affero Public License for more details.
13 -
14 - You should have received a copy of the GNU Affero Public License
15 - along with `typers`. If not, see <https://www.gnu.org/licenses/>.
16-}
17
18
1module Base exposing (..) 19module Base exposing (..)
2 20
3import Array exposing (Array) 21import Array exposing (Array)
diff --git a/src/Data.elm b/src/Data.elm
index 244f149..4708ca1 100644
--- a/src/Data.elm
+++ b/src/Data.elm
@@ -1,3 +1,21 @@
1{-
2 - This file is part of `typers`.
3 -
4 - `typers` is free software: you can redistribute it and/or modify
5 - it under the terms of the GNU Affero Public License as published by
6 - the Free Software Foundation, either version 3 of the License, or
7 - (at your option) any later version.
8 -
9 - `typers` is distributed in the hope that it will be useful,
10 - but WITHOUT ANY WARRANTY; without even the implied warranty of
11 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 - GNU Affero Public License for more details.
13 -
14 - You should have received a copy of the GNU Affero Public License
15 - along with `typers`. If not, see <https://www.gnu.org/licenses/>.
16-}
17
18
1module Data exposing (defaultConfig, randomParagraph) 19module Data exposing (defaultConfig, randomParagraph)
2 20
3import Base exposing (Config) 21import Base exposing (Config)
@@ -12,7 +30,7 @@ defaultConfig =
12 30
13textData : List String 31textData : List String
14textData = 32textData =
15 "the of to and a in is it you that he was for on are with as I his they be at one have this from or had by not word but what some we can out other were all there when up use your how said an each she which do their time if will way about many then them write would like so these her long make thing see him two has look more day could go come did number sound no most people my over know water than call first who may down side been now find any new work part take get place made live where after back little only round man year came show every good me give our under name very through just form sentence great think say help low line differ turn cause much mean before move right boy old too same tell does set three want air well also play small end put home read hand port large spell add even land here must big high such follow act why ask men change went light kind off need house picture try us again animal point mother world near build self earth father head stand own page should country found answer school grow study still learn plant cover food sun four between state keep eye never last let thought city tree cross farm hard start might story saw far sea draw left late run don't while press close night real life few north open seem together next white children begin got walk example ease paper group always music those both mark often letter until mile river car feet care second book carry took science eat room friend began idea fish mountain stop once base hear horse cut sure watch color face wood main enough plain girl usual young ready above ever red list though feel talk bird soon body dog family direct pose leave song measure door product black short numeral class wind question happen complete ship area half rock order fire south problem piece told knew pass since top whole king space heard best hour better true during hundred five remember step early hold west ground interest reach fast verb sing listen six table travel less morning ten simple several vowel toward war lay against pattern slow center love person money serve appear road map rain rule govern pull cold notice voice unit power town fine certain fly fall lead cry dark machine note wait plan figure star box noun field rest correct able pound done beauty drive stood contain front teach week final gave green oh quick develop ocean warm free minute strong special mind behind clear tail produce fact street inch multiply nothing course stay wheel full force blue object decide surface deep moon island foot system busy test record boat common gold possible plane stead dry wonder laugh thousand ago ran check game shape equate hot miss brought heat snow tire bring yes distant fill east paint language among grand ball yet wave drop heart am present heavy dance engine position arm wide sail material size vary settle speak weight general ice matter circle pair include divide syllable felt perhaps pick sudden count square reason length represent art subject region energy hunt probable bed brother egg ride cell believe fraction forest sit race window store summer train sleep prove lone leg exercise wall catch mount wish sky board joy winter sat written wild instrument kept glass grass cow job edge sign visit past soft fun bright gas weather month million bear finish happy hope flower clothe strange gone jump baby eight village meet root buy raise solve metal whether push seven paragraph third shall held hair describe cook floor either result burn hill safe cat century consider type law bit coast copy phrase silent tall sand soil roll temperature finger industry value fight lie beat excite natural view sense ear else quite broke case middle kill son lake moment scale loud spring observe child straight consonant nation dictionary milk speed method organ pay age section dress cloud surprise quiet stone tiny climb cool design poor lot experiment bottom key iron single stick flat twenty skin smile crease hole trade melody trip office receive row mouth exact symbol die least trouble shout except wrote seed tone join suggest clean break lady yard rise bad blow oil blood touch grew cent mix team wire cost lost brown wear garden equal sent choose fell fit flow fair bank collect save control decimal gentle woman captain practice separate difficult doctor please protect noon whose locate ring character insect caught period indicate radio spoke atom human history effect electric expect crop modern element hit student corner party supply bone rail imagine provide agree thus capital won't chair danger fruit rich thick soldier process operate guess necessary sharp wing create neighbor wash bat rather crowd corn compare poem string bell depend meat rub tube famous dollar stream fear sight thin triangle planet hurry chief colony clock mine tie enter major fresh search send yellow gun allow print dead spot desert suit current lift rose continue block chart hat sell success company subtract event particular deal swim term opposite wife shoe shoulder spread arrange camp invent cotton born determine quart nine truck noise level chance gather shop stretch throw shine property column molecule select wrong gray repeat require broad prepare salt nose plural anger claim continent oxygen sugar death pretty skill women season solution magnet silver thank branch match suffix especially fig afraid huge sister steel discuss forward similar guide experience score apple bought led pitch coat mass card band rope slip win dream evening condition feed tool total basic smell valley nor double seat arrive master track parent shore division sheet substance favor connect post spend chord fat glad original share station dad bread charge proper bar offer segment slave duck instant market degree populate chick dear enemy reply drink occur support speech nature range steam motion path liquid log meant quotient teeth shell neck" 33 "the of to and a in is it you that he was for on are with as I his they be at one have this from or had by not word but what some we can out other were all there when up use your how said an each she which do their time if will way about many then them write would like so these her long make thing see him two has look more day could go come did number sound no most people my over know water than call first who may down side been now find any new work part take get place made live where after back little only round man year came show every good me give our under name very through just form sentence great think say help low line differ turn cause much mean before move right boy old too same tell does set three want air well also play small end put home read hand port large spell add even land here must big high such follow act why ask men change went light kind off need house picture try us again animal point mother world near build self earth father head stand own page should country found answer school grow study still learn plant cover food sun four between state keep eye never last let thought city tree cross farm hard start might story saw far sea draw left late run don't while press close night real life few north open seem together next white children begin got walk example ease paper group always music those both mark often letter until mile river car feet care second book carry took science eat room friend began idea fish mountain stop once base hear horse cut sure watch color face wood main enough plain girl usual young ready above ever red list though feel talk bird soon body dog family direct pose leave song measure door product black short numeral class wind question happen complete ship area half rock order fire south problem piece told knew pass since top whole king space heard best hour better true during hundred five remember step early hold west ground interest reach fast verb sing listen six table travel less morning ten simple several vowel toward war lay against pattern slow center love person money serve appear road map rain rule govern pull cold notice voice unit power town fine certain fly fall lead cry dark machine note wait plan figure star box noun field rest correct able pound done beauty drive stood contain front teach week final gave green oh quick develop ocean warm free minute strong special mind behind clear tail produce fact street inch multiply nothing course stay wheel full force blue object decide surface deep moon island foot system busy test record boat common gold possible plane stead dry wonder laugh thousand ago ran check game shape equate hot miss brought heat snow tire bring yes distant fill east paint language among"
16 |> String.split " " 34 |> String.split " "
17 35
18 36
@@ -30,7 +48,7 @@ randomWord : Config -> Random.Generator ( Int, Bool, Bool )
30randomWord config = 48randomWord config =
31 let 49 let
32 idx = 50 idx =
33 Random.int 0 999 51 Random.int 0 499
34 52
35 punct = 53 punct =
36 if config.punctuation then 54 if config.punctuation then
diff --git a/src/Main.elm b/src/Main.elm
index 20443fd..ab10e82 100644
--- a/src/Main.elm
+++ b/src/Main.elm
@@ -1,3 +1,21 @@
1{-
2 - This file is part of `typers`.
3 -
4 - `typers` is free software: you can redistribute it and/or modify
5 - it under the terms of the GNU Affero Public License as published by
6 - the Free Software Foundation, either version 3 of the License, or
7 - (at your option) any later version.
8 -
9 - `typers` is distributed in the hope that it will be useful,
10 - but WITHOUT ANY WARRANTY; without even the implied warranty of
11 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 - GNU Affero Public License for more details.
13 -
14 - You should have received a copy of the GNU Affero Public License
15 - along with `typers`. If not, see <https://www.gnu.org/licenses/>.
16-}
17
18
1module Main exposing (..) 19module Main exposing (..)
2 20
3import Array exposing (..) 21import Array exposing (..)
@@ -206,33 +224,39 @@ currentContents model =
206view : Model -> Html Msg 224view : Model -> Html Msg
207view model = 225view model =
208 div 226 div
209 [ style "width" "95%" 227 []
210 , style "max-width" "650px"
211 , style "margin" "auto"
212 , style "padding-top" "15%"
213 ]
214 [ div 228 [ div
215 [ style "width" "100%" 229 [ style "width" "95%"
230 , style "max-width" "650px"
231 , style "margin" "15% auto auto auto"
216 ] 232 ]
217 [ viewWordLengthOptions 233 [ div
218 , div 234 [ style "width" "100%"
219 [ style "float" "right" ] 235 ]
220 [ styledButton [ onClick Redo ] [ text "redo" ] ] 236 [ viewWordLengthOptions
221 ] 237 , div
222 , div [] 238 [ style "float" "right" ]
223 [ toPara model.words model.currentWord (currentContents model) 239 [ styledButton [ onClick Redo ] [ text "redo" ] ]
240 ]
224 , div [] 241 , div []
225 [ text "> " 242 [ toPara model.words model.currentWord (currentContents model)
226 , styledInput model.inputCorrect [ onInput handleInputChanged, value model.inputBox ] [] 243 , div []
244 [ text "> "
245 , styledInput model.inputCorrect [ onInput handleInputChanged, value model.inputBox ] []
246 ]
227 ] 247 ]
248 , div [] [ viewStats model ]
249 , global [ selector "li:not(:last-child)::after" [ Css.property "content" "' · '" ] ]
250 , global [ selector "*,*:focus,*:hover" [ Css.property "outline" "none" ] ]
251 , global [ everything [ Css.fontFamily Css.monospace, Css.fontSize (Css.px 18) ] ]
228 ] 252 ]
229 , div [] [ viewStats model ] 253 , div
230 254 [ style "position" "absolute"
231 -- , global [ selector "li:not(:last-child)::after" [ Css.property "content" "' · '" ] ] 255 , style "bottom" "0"
232 , global [ selector "*,*:focus,*:hover" [ Css.property "outline" "none" ] ] 256 , style "left" "50%"
233 , global [ everything [ Css.fontFamily Css.monospace, Css.fontSize (Css.px 18) ] ] 257 , style "transform" "translate(-50%)"
234 258 ]
235 -- , global [ body [ Css.backgroundColor (Css.hex "#000"), Css.color (Css.hex "#fff") ] ] 259 [ viewFooter ]
236 ] 260 ]
237 261
238 262
diff --git a/src/Styles.elm b/src/Styles.elm
index db5b0ce..7b2eea7 100644
--- a/src/Styles.elm
+++ b/src/Styles.elm
@@ -1,3 +1,21 @@
1{-
2 - This file is part of `typers`.
3 -
4 - `typers` is free software: you can redistribute it and/or modify
5 - it under the terms of the GNU Affero Public License as published by
6 - the Free Software Foundation, either version 3 of the License, or
7 - (at your option) any later version.
8 -
9 - `typers` is distributed in the hope that it will be useful,
10 - but WITHOUT ANY WARRANTY; without even the implied warranty of
11 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 - GNU Affero Public License for more details.
13 -
14 - You should have received a copy of the GNU Affero Public License
15 - along with `typers`. If not, see <https://www.gnu.org/licenses/>.
16-}
17
18
1module Styles exposing (..) 19module Styles exposing (..)
2 20
3import Base exposing (WordStatus(..)) 21import Base exposing (WordStatus(..))
@@ -16,7 +34,7 @@ styledButton =
16 , paddingTop (px 12) 34 , paddingTop (px 12)
17 , paddingBottom (px 12) 35 , paddingBottom (px 12)
18 , paddingLeft (px 0) 36 , paddingLeft (px 0)
19 , paddingRight (px 12) 37 , paddingRight (px 0)
20 , fontFamily monospace 38 , fontFamily monospace
21 , border (px 0) 39 , border (px 0)
22 , backgroundColor (hex "#fff") 40 , backgroundColor (hex "#fff")
@@ -68,6 +86,15 @@ styledUnorderedList =
68 ] 86 ]
69 87
70 88
89styledExternalLink : List (Attribute msg) -> List (Html msg) -> Html msg
90styledExternalLink =
91 styled
92 a
93 [ textDecoration underline
94 , color (hex "#666")
95 ]
96
97
71styledTextBox : List (Attribute msg) -> List (Html msg) -> Html msg 98styledTextBox : List (Attribute msg) -> List (Html msg) -> Html msg
72styledTextBox = 99styledTextBox =
73 styled 100 styled
diff --git a/src/Utils.elm b/src/Utils.elm
index 83e025b..6228696 100644
--- a/src/Utils.elm
+++ b/src/Utils.elm
@@ -1,3 +1,21 @@
1{-
2 - This file is part of `typers`.
3 -
4 - `typers` is free software: you can redistribute it and/or modify
5 - it under the terms of the GNU Affero Public License as published by
6 - the Free Software Foundation, either version 3 of the License, or
7 - (at your option) any later version.
8 -
9 - `typers` is distributed in the hope that it will be useful,
10 - but WITHOUT ANY WARRANTY; without even the implied warranty of
11 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 - GNU Affero Public License for more details.
13 -
14 - You should have received a copy of the GNU Affero Public License
15 - along with `typers`. If not, see <https://www.gnu.org/licenses/>.
16-}
17
18
1module Utils exposing (..) 19module Utils exposing (..)
2 20
3import Array as A exposing (..) 21import Array as A exposing (..)
diff --git a/src/Views.elm b/src/Views.elm
index b54fc93..3a8afed 100644
--- a/src/Views.elm
+++ b/src/Views.elm
@@ -1,3 +1,21 @@
1{-
2 - This file is part of `typers`.
3 -
4 - `typers` is free software: you can redistribute it and/or modify
5 - it under the terms of the GNU Affero Public License as published by
6 - the Free Software Foundation, either version 3 of the License, or
7 - (at your option) any later version.
8 -
9 - `typers` is distributed in the hope that it will be useful,
10 - but WITHOUT ANY WARRANTY; without even the implied warranty of
11 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 - GNU Affero Public License for more details.
13 -
14 - You should have received a copy of the GNU Affero Public License
15 - along with `typers`. If not, see <https://www.gnu.org/licenses/>.
16-}
17
18
1module Views exposing (..) 19module Views exposing (..)
2 20
3import Array exposing (..) 21import Array exposing (..)
@@ -5,9 +23,9 @@ import Base exposing (..)
5import Css exposing (..) 23import Css exposing (..)
6import Html 24import Html
7import Html.Styled exposing (..) 25import Html.Styled exposing (..)
8import Html.Styled.Attributes exposing (css) 26import Html.Styled.Attributes exposing (css, href)
9import Html.Styled.Events exposing (onClick) 27import Html.Styled.Events exposing (onClick)
10import Styles exposing (styledButton, styledListItem, styledUnorderedList) 28import Styles exposing (..)
11import Time exposing (Posix, toHour, toMinute, toSecond, utc) 29import Time exposing (Posix, toHour, toMinute, toSecond, utc)
12import Utils exposing (diffDuration, isNothing, wordCountWith) 30import Utils exposing (diffDuration, isNothing, wordCountWith)
13 31
@@ -122,3 +140,21 @@ viewStats model =
122 in 140 in
123 p [] 141 p []
124 [ text (Maybe.withDefault "" stats) ] 142 [ text (Maybe.withDefault "" stats) ]
143
144
145viewFooter : Html Msg
146viewFooter =
147 let
148 footerItems =
149 [ ( "src", "https://git.peppe.rs/web/typers/about" )
150 , ( "license", "https://git.peppe.rs/web/typers/tree/COPYING" )
151 ]
152 in
153 styledUnorderedList []
154 (List.map
155 (\( inner, hr ) ->
156 styledListItem []
157 [ styledExternalLink [ href hr ] [ text inner ] ]
158 )
159 footerItems
160 )