Instantly share code, notes, and snippets.

Embed
What would you like to do?
javascript for creative mornings checkin app prototype on framer.js // using the un-documented framer property `Draggable`
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