Skip to content

Instantly share code, notes, and snippets.

Created April 21, 2017 14:33
Show Gist options
  • Save anonymous/318225bfb01bf1d00901b6be5f844cea to your computer and use it in GitHub Desktop.
Save anonymous/318225bfb01bf1d00901b6be5f844cea 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