Skip to content

Commit

Permalink
Merge pull request #8 from elmbridge/move-from-release-system-tofiles
Browse files Browse the repository at this point in the history
Move from release system to files
  • Loading branch information
avh4 authored Sep 28, 2018
2 parents b69aadf + c6955b6 commit 4490428
Show file tree
Hide file tree
Showing 15 changed files with 1,039 additions and 84 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
/dist/
/elm-stuff/
/index.html
.DS_Store
/node_modules/
/package-lock.json
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sudo: false

language: node_js
node_js: "10"

install:
- npm install [email protected]

script:
- npx elm-make --yes HelloWorld.elm
- npx elm-make --yes Part1.elm
- npx elm-make --yes Part2.elm
- npx elm-make --yes Part3.elm
- npx elm-make --yes Part4.elm
- npx elm-make --yes Part5.elm
- npx elm-make --yes Part6.elm
- npx elm-make --yes Part7.elm
- npx elm-make --yes Part8.elm
69 changes: 69 additions & 0 deletions HelloWorld.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
module HelloWorld exposing (..)

import Html
import Html.Attributes
import Html.Events


-- MAIN


main : Program Never Model Msg
main =
Html.beginnerProgram
{ model = init
, view = view
, update = update
}



-- MODEL


type alias Model =
{ buttonLabel : String }


init : Model
init =
{ buttonLabel = "hello world!" }



-- UPDATE


type Msg
= ChangeText


update : Msg -> Model -> Model
update msg model =
case msg of
ChangeText ->
if model.buttonLabel == "hello world!" then
{ model | buttonLabel = "goodbye world!" }
else
{ model | buttonLabel = "hello world!" }



-- VIEW


view : Model -> Html.Html Msg
view model =
Html.div
[ Html.Attributes.class "skeleton-elm-project" ]
[ Html.node "link"
[ Html.Attributes.rel "stylesheet"
, Html.Attributes.href "stylesheets/main.css"
]
[]
, Html.div
[ Html.Attributes.class "waves-effect waves-light btn-large"
, Html.Events.onClick ChangeText
]
[ Html.text model.buttonLabel ]
]
15 changes: 0 additions & 15 deletions Main.elm

This file was deleted.

26 changes: 0 additions & 26 deletions Model.elm

This file was deleted.

84 changes: 84 additions & 0 deletions Part1.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
module Part1 exposing (..)

import Html
import Html.Attributes
import Html.Events


-- MAIN


main : Program Never Model Msg
main =
Html.beginnerProgram
{ model = init
, view = view
, update = update
}



-- MODEL


type alias Model =
{ currentText : String }


init : Model
init =
{ currentText = "" }



-- UPDATE


type Msg
= SetCurrentText String


update : Msg -> Model -> Model
update msg model =
case msg of
SetCurrentText newText ->
-- currently, this does nothing!
model



-- VIEW


view : Model -> Html.Html Msg
view model =
Html.div
[]
[ Html.node "link"
[ Html.Attributes.rel "stylesheet"
, Html.Attributes.href "stylesheets/main.css"
]
[]
, Html.nav
[]
[ Html.div
[ Html.Attributes.class "nav-wrapper light-blue lighten-2" ]
[ Html.div
[ Html.Attributes.class "brand-logo center" ]
[ Html.text "Elmoji Translator" ]
]
]
, Html.section
[ Html.Attributes.class "container" ]
[ Html.div
[ Html.Attributes.class "input-field" ]
[ Html.input
[ Html.Attributes.type_ "text"
, Html.Attributes.class "center"
, Html.Attributes.placeholder "Let's Translate!"
, Html.Events.onInput SetCurrentText
]
[]
]
]
]
86 changes: 86 additions & 0 deletions Part2.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
module Part2 exposing (..)

import Html
import Html.Attributes
import Html.Events


-- MAIN


main : Program Never Model Msg
main =
Html.beginnerProgram
{ model = init
, view = view
, update = update
}



-- MODEL


type alias Model =
{ currentText : String }


init : Model
init =
{ currentText = "" }



-- UPDATE


type Msg
= SetCurrentText String


update : Msg -> Model -> Model
update msg model =
case msg of
SetCurrentText newText ->
{ model | currentText = newText }



-- VIEW


view : Model -> Html.Html Msg
view model =
Html.div
[]
[ Html.node "link"
[ Html.Attributes.rel "stylesheet"
, Html.Attributes.href "stylesheets/main.css"
]
[]
, Html.nav
[]
[ Html.div
[ Html.Attributes.class "nav-wrapper light-blue lighten-2" ]
[ Html.div
[ Html.Attributes.class "brand-logo center" ]
[ Html.text "Elmoji Translator" ]
]
]
, Html.section
[ Html.Attributes.class "container" ]
[ Html.div
[ Html.Attributes.class "input-field" ]
[ Html.input
[ Html.Attributes.type_ "text"
, Html.Attributes.class "center"
, Html.Attributes.placeholder "Let's Translate!"
, Html.Events.onInput SetCurrentText
]
[]
]
, Html.p
[ Html.Attributes.class "center output-text emoji-size" ]
[ Html.text model.currentText ]
]
]
Loading

0 comments on commit 4490428

Please sign in to comment.