Skip to content

Instantly share code, notes, and snippets.

View isaacw's full-sized avatar

Isaac Weinhausen isaacw

View GitHub Profile
@isaacw
isaacw / Layer.createChildrenRefs.coffee
Last active March 5, 2018 20:20
Creates convenience refs on targeted layers from the design tab so that we don't have to use Layer::childrenWithName.
# Layer::createChildrenRefs
# Creates convenience refs on targetd layers from the design tab so that we don't have to use Layer::childrenWithName.
# Pass recursive=true to do this for all descendant layers while maintaining hierarchy.
Layer::createChildrenRefs = (recursive=false) ->
for layer in @children
# Get layer name for the key
key = layer.name
@isaacw
isaacw / ScrollPoint.coffee
Created February 17, 2017 03:16
Simple class for detecting when the user scrolls past a specific point
# ScrollPoint class
Events.PassedForward = "passed:forward"
Events.PassedBackward = "passed:backward"
class exports.ScrollPoint extends Framer.EventEmitter
constructor: (scroll, value, axis="y") ->
@isaacw
isaacw / triangle.coffee
Created December 26, 2016 23:13 — forked from jordandobson/triangle.coffee
Creating a triangle via Framer Layer
# Project Info
# This info is presented in a widget when you share.
# http://framerjs.com/docs/#info.info
Framer.Info =
title: "Triangle Layer Rebound"
author: "Jordan Dobson"
twitter: "jordandobson"
description: "jordandobson@gmail.com\n\nThis rebound of jrdn.io/haJ2 \nby Black Ray adds direction checking, allows you to set direction as an option when creating a layer and sets the bounding box of the layer to it's intrinsic size."
@isaacw
isaacw / Layer.makeTriangle.coffee
Last active September 26, 2016 21:09 — forked from RayPS/Framer-Make-CSS-Triangle.coffee
Turn layer into a CSS-bassed triangle
# Layer::makeTriangle
# CSS Based triangles
# Directions: "top", "right", "bottom", "left"
# Credit: Black Ray https://gist.github.com/RayPS/9460d020b59fe7a201da65207bb369a0
Layer::makeTriangle = (direction)->
@.borderColor = "transparent"
@.borderWidth = @.width / 2
@.style["border-#{direction}-color"] = @.backgroundColor.toHexString()
@.backgroundColor = "transparent"
@isaacw
isaacw / Layer.createChildrenRefs.coffee
Last active February 12, 2017 00:46
Creates convenience refs on imported layers so that we don't have to use Layer::childrenWithName; can be applied to all descendant layers while maintaining hierarchy.
# Layer::createChildrenRefs
# Creates convenience refs on imported layers so that we don't have to use Layer::childrenWithName.
# Pass recursive=true to do this for all descendant layers while maintaining hierarchy.
Layer::createChildrenRefs = (recursive=false) ->
# Regex pattern for finding trailing numbers
rgx = /(\d+$)/g
for layer in @.children
@isaacw
isaacw / dabblet.css
Created January 25, 2012 22:43
Hello World
/**
* Hello World
*/
html{
padding: 60px 80px;
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
font-size: 30px;