Skip to content

Instantly share code, notes, and snippets.

@johnanthonyevans
Created August 28, 2014 21:18
Show Gist options
  • Save johnanthonyevans/73a4cb36a9831038ef18 to your computer and use it in GitHub Desktop.
Save johnanthonyevans/73a4cb36a9831038ef18 to your computer and use it in GitHub Desktop.
class InputTextLayer extends Framer.Layer
constructor: (options) ->
super options
@ignoreEvents = false
@input = document.createElement("input")
_.extend @input.style,
"-webkit-user-select": "text"
"-webkit-box-sizing": "border-box"
"cursor": "auto"
@_update()
@_element.appendChild(@input)
@on "change:width", @_update
@on "change:height", @_update
_update: =>
_.extend @input.style,
width: "#{@width}px"
height: "#{@height}px"
textLayer = new InputTextLayer width:Screen.width , height:120, y:0, x:0
textLayer.states.animationOptions = curve: "spring(250, 20, 0)"
textLayer.input.style.font = "36px/1.35em Helvetica"
textLayer.input.style.font-style = "normal"
textLayer.input.style.font-weight = "100"
textLayer.input.style.padding = "24px"
textLayer.input.style.textAlign = "left"
textLayer.input.style.background = "transparent"
textLayer.input.style.outline = '0'
textLayer.input.style.color = "#fff"
textLayer.input.style.border = "0px solid"
# textLayer.input.style.display = "none"
textLayer.input.value = new Date().getSeconds()
textLayer.input.placeholder = "Search Me"
textLayer.backgroundColor = "rgba(0, 0, 0, 1)"
# textLayer.input.addEventListener "keyup", ->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment