Skip to content

Instantly share code, notes, and snippets.

Created April 21, 2017 14:33

Revisions

  1. @invalid-email-address Anonymous created this gist Apr 21, 2017.
    43 changes: 43 additions & 0 deletions Main.elm
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    module Main exposing (..)

    import Html exposing (..)
    import Html.Attributes exposing (..)


    sampleText : String
    sampleText =
    "As long as Rayquaza has any Grass Energy cards attached to it, ignore the effect of Rayquaza's Lightning Storm attack."



    list : List String -> String
    list l =
    case l of
    [] ->
    "Nothing"

    [last] ->
    last

    (x::xs) ->
    case x of
    "Grass" ->
    "https://s3-us-west-2.amazonaws.com/pokecard/assets/icons/Grass-icon.png"

    _ ->
    list xs


    textView : String -> Html a
    textView string =
    p [] [ text string ]


    testView : Html a
    testView =
    div [] [ textView (list (String.split "," sampleText)) ]


    main : Html a
    main =
    div [] [ testView ]
    15 changes: 15 additions & 0 deletions elm-package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    {
    "version": "1.0.0",
    "summary": "Tell the world about your project!",
    "repository": "https://github.com/user/project.git",
    "license": "BSD3",
    "source-directories": [
    "."
    ],
    "exposed-modules": [],
    "dependencies": {
    "elm-lang/core": "5.1.1 <= v < 5.1.1",
    "elm-lang/html": "2.0.0 <= v < 2.0.0"
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
    }
    15 changes: 15 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    <html>
    <head>
    <style>
    html {
    background: #F7F7F7;
    color: red;
    }
    </style>
    </head>
    <body>
    <script>
    var app = Elm.Main.fullscreen()
    </script>
    </body>
    </html>