Skip to content

Instantly share code, notes, and snippets.

View TheSeamau5's full-sized avatar

Hassan Hayat TheSeamau5

  • Entrepreneur
  • Austin, TX
View GitHub Profile
@TheSeamau5
TheSeamau5 / Button.elm
Created June 14, 2015 23:40 — forked from jinjor/Button.elm
Version using Elm Architecture
import Html exposing (Html)
import Html.Events
import Signal exposing (Address, Signal)
-- Button Component --
type ButtonAction
= Click
| NoOpButton
@TheSeamau5
TheSeamau5 / elm-animation-alt.elm
Created June 14, 2015 22:06
Example of Alternative to elm-animation
import Html exposing (Html, Attribute)
import Html.Attributes
import Html.Events
import Signal exposing (Address)
import Json.Decode exposing (Decoder, (:=))
import Time
import List
@TheSeamau5
TheSeamau5 / swipepageselm.elm
Last active September 20, 2016 08:10
Swipeable Pages in Elm
import Html exposing (Html)
import Html.Attributes
import Html.Events
import Mouse
import Signal exposing (Signal, Address)
import StartApp
import Json.Decode exposing ((:=))
import List
import Html exposing (Html)
import Html.Attributes exposing (style)
import Color exposing (Color)
(=>) = (,)
toRgbaString color =
let {red, green, blue, alpha} = Color.toRgb color
in
@TheSeamau5
TheSeamau5 / labelAsData.elm
Created June 9, 2015 20:55
Label as Data
import Html exposing (Html)
import Html.Attributes exposing (style)
import Color exposing (Color)
import Mouse
(=>) = (,)
toRgbaString color =
let {red, green, blue, alpha} = Color.toRgb color
in
@TheSeamau5
TheSeamau5 / buttonAnim.elm
Last active August 29, 2015 14:22
Button in Elm with animation
import Html exposing (Html)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick, onMouseOver, onMouseOut)
import Signal exposing (Signal, Address)
import Time
(=>) = (,)
type alias Options =
@TheSeamau5
TheSeamau5 / divmouse.elm
Created June 5, 2015 16:25
Div follows mouse example
import Html
import Html.Attributes exposing (style)
import Html.Events exposing (on)
import Signal exposing (mailbox)
import Json.Decode exposing (Decoder, (:=), int)
positionDecoder =
import Signal exposing (Signal)
import Html exposing (Html)
import Time
import Random exposing (Generator)
import Json.Decode exposing (Decoder)
import Json.Encode exposing (Value)
type alias Encoder a = a -> Value
mock
import Signal
import Time
import List
import Graphics.Element exposing (show)
import Graphics.Collage as Collage
import Color
import Random
initial =
import Html exposing (Html)
import Html.Events exposing (onClick)
import Signal exposing (Signal, Address, Mailbox)
import Json.Decode as Decode exposing (Decoder, (:=))
import Json.Encode as Encode exposing (Value)
import List
--------------------------------------------
-- Example :
initial = 0