Last active
December 24, 2015 11:59
-
-
Save robbschiller/6794838 to your computer and use it in GitHub Desktop.
javascript for creative mornings checkin app prototype on framer.js // using the un-documented framer property `Draggable`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iphone = new View ({ | |
x: 0, | |
y: 0, | |
width: 640, | |
height: 1096 | |
}); | |
iphone.style.background = '#fff'; | |
iphone.style.overflow = 'hidden'; | |
header = new View({ | |
x: 0, | |
y: 0, | |
width: 640, | |
height: 120 | |
}); | |
header.style.backgroundColor = '#333'; | |
header.superView = iphone; | |
// top cell slide | |
cell0 = new View ({ | |
x: 0, | |
y: 120, | |
width: 640, | |
height: 150, | |
}); | |
cell0.style = { | |
"background": "#fff", | |
"border-bottom": "1px solid #f2f2f2" | |
}; | |
cell0.superView = iphone; | |
cell0.dragger = new ui.Draggable(cell0); | |
cell0.on(Events.DragMove, function() { | |
cell0.y = 120 | |
}); | |
cell0.dragger.on(Events.DragEnd, function(){ | |
cell0.animate({ | |
properties: { x: 0 }, | |
time: 200 | |
}); | |
}); | |
// second cell slide | |
cell1 = new View ({ | |
x: 0, | |
y: 270, | |
width: 640, | |
height: 150, | |
}); | |
cell1.style = { | |
"background": "#fff", | |
"border-bottom": "1px solid #f2f2f2" | |
}; | |
cell1.superView = iphone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment