Skip to content

Instantly share code, notes, and snippets.

@glinesbdev
Forked from anonymous/Main.elm
Created April 21, 2017 14:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save glinesbdev/c36df06929eec8e362a9f25263bd44f7 to your computer and use it in GitHub Desktop.
Untitled
{
"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"
}
<html>
<head>
<style>
html {
background: #F7F7F7;
color: red;
}
</style>
</head>
<body>
<script>
var app = Elm.Main.fullscreen()
</script>
</body>
</html>
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 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment