Skip to content

Instantly share code, notes, and snippets.

View dearsherlock's full-sized avatar

Sherlock Tsai dearsherlock

View GitHub Profile
@dearsherlock
dearsherlock / .coffee
Created December 30, 2015 01:10
framer states
# Set imageA states
photos.imageA.states.add
large:
y: 300
width: 750
height: 533
normal:
sepia: 0
brightness: 100
contrast: 100
@dearsherlock
dearsherlock / .coffee
Created December 29, 2015 16:09
practice
# Create a background layer with background color #73a7f4
new BackgroundLayer
backgroundColor: "#73a7f4"
# Create a default animation spring curve
# with values of your choice
Framer.Defaults.Animation =
curve: "spring(200,10,0)"
@dearsherlock
dearsherlock / .coffee
Created December 29, 2015 15:45
event sample 3/3
# Set default animation
Framer.Defaults.Animation =
curve: "ease"
time: 0.3
# 加上背景
new BackgroundLayer
backgroundColor: "#d1e377"
# 建構雲朵
@dearsherlock
dearsherlock / .coffee
Created December 29, 2015 09:52
framer exe 2/3
Framer.Defaults.Animation =
curve: "ease"
time: 0.3
# 加上背景
new BackgroundLayer
backgroundColor: "#d1e377"
# Create an empty clouds array
# clouds = []
@dearsherlock
dearsherlock / .coffee
Created December 29, 2015 08:23
drag.sample.1/3
navMenu = new Layer
x:0, y:0, width:750, height:144, image:"images/navBar.png"
# Content
pullDown = new Layer
x:0, y:144, width:750, height:1190, image:"images/pullDown.png"
# Make draggable
@dearsherlock
dearsherlock / .coffee
Created December 29, 2015 05:44
drag event
# Make circle bigger when starting
# Another way to write Events.DragStart is just "dragstart"
circle.on Events.DragStart, ->
circle.animate
properties:
scale: 1.2
shadowY: 8
shadowBlur: 20
# Move circle back to original position and size when done
@dearsherlock
dearsherlock / .coffee
Created December 29, 2015 03:37
bounceoptions
circle.draggable.bounceOptions =
friction: 40,
tension: 200,
tolerance: 0.0001
@dearsherlock
dearsherlock / .coffee
Created December 26, 2015 14:39
event 3
hitTarget = new Layer
width: Screen.width
height: Screen.height
backgroundColor: "transparent"
#把這些圖片變成亂數選項
hearts = [
"blue"
"orange"
"purple"
@dearsherlock
dearsherlock / .coffee
Created December 26, 2015 14:21
event fun2
hitTarget = new Layer
width: Screen.width
height: Screen.height
backgroundColor: "transparent"
#把這些圖片變成亂數選項
hearts = [
"blue"
"orange"
"purple"
@dearsherlock
dearsherlock / .coffee
Created December 26, 2015 13:40
excercise 1 framer event
hitTarget = new Layer
width: Screen.width
height: Screen.height
backgroundColor: "transparent"
#把這些圖片變成亂數選項
hearts = [
"blue"
"orange"
"purple"