Skip to content

Instantly share code, notes, and snippets.

View andrewliebchen's full-sized avatar

Andrew Liebchen andrewliebchen

View GitHub Profile
@andrewliebchen
andrewliebchen / App.js
Last active July 19, 2018 05:56
Perhaps a way to simplify ResourceCards?
import React, {Component} from 'react';
import './App.css';
const cards = ['Card 1', 'Card 2', 'Card 3'];
const Card = props => (
<div
onClick={props.handleClick}
className="Card"
style={{transform: props.selected && 'scale(1.5)'}}>
@andrewliebchen
andrewliebchen / BoundsLayer.coffee
Created December 8, 2017 17:02
BoundsLayer component: a layer that knows if a click is inside or outside itself
class BoundsLayer extends Layer
constructor: (props) ->
super props
@_origin = @convertPointToScreen({x: 0, y: 0})
@background = new Layer
parent: @
size: Screen.size
x: -@_origin.x
@andrewliebchen
andrewliebchen / app.coffee
Created September 27, 2017 04:39
Yoga in Framer, v2
{ yoga } = require "npm"
root = yoga.Node.create()
root.setWidth(Screen.width)
root.setHeight(Screen.height)
root.setPadding(yoga.EDGE_ALL, 20)
root.setDisplay(yoga.DISPLAY_FLEX)
root.setFlexDirection(yoga.FLEX_DIRECTION_ROW)
childA = new Layer
@andrewliebchen
andrewliebchen / app.coffee
Created September 27, 2017 04:06
Yoga in Framer, v1
{ yoga } = require "npm"
# Establish a root node
root = yoga.Node.create()
root.setWidth(Screen.width)
root.setHeight(Screen.height)
root.setPadding(yoga.EDGE_ALL, 20)
root.setDisplay(yoga.DISPLAY_FLEX)
root.setFlexDirection(yoga.FLEX_DIRECTION_ROW)
@andrewliebchen
andrewliebchen / Router.coffee
Last active December 8, 2017 23:36
FramerJS FlowComponent router
class Router extends FlowComponent
constructor: (props) ->
@_props = props || {}
super _.defaults props,
name: 'Provider'
@define 'current',
get: -> @_props.current
set: (current) ->
@andrewliebchen
andrewliebchen / app.coffee
Created September 4, 2017 23:57
Framer EventEmitter
EE = new Framer.EventEmitter
box = new Layer
x: Align.center
y: Align.center
backgroundColor: 'blue'
EE.on box, (update) ->
box.props = update
@andrewliebchen
andrewliebchen / app.coffee
Last active June 29, 2017 20:52
Pills demo
{ color } = require 'fk-color'
Framer.Device.customize
screenWidth: 1439
screenHeight: 1023
Framer.Defaults.Animation =
curve: 'spring(600, 40, 0)'
Canvas.backgroundColor = color 'light30'
colors = [
'red'
'blue'
'yellow'
]
checks = []
samples = []
for color, i in colors
@andrewliebchen
andrewliebchen / app.coffee
Created April 14, 2017 15:36
Animating donut chart in FramerJS
c =
background: '#f0f0f0'
foreground: 'blue'
start: 10
end: 90
strokeWidth: 10
speed: 50
size: 100
circle = new Layer
@andrewliebchen
andrewliebchen / app.coffee
Created January 12, 2017 16:01
Chat in Framer
InputModule = require 'input'
# Data
p =
fontSize: 24
lineHeight: 36
bubbleColor:
left: '#4080FF'
right: '#ccc'
padding: 20