Skip to content

Instantly share code, notes, and snippets.

View mrrocks's full-sized avatar
🤓
Learning

Fran Pérez mrrocks

🤓
Learning
View GitHub Profile
@mrrocks
mrrocks / innertia.coffee
Last active August 29, 2015 14:15
Draggable layer with inertia and boundaries in FramerJS
ACCELERATION = 180
INERTIA_CURVE = "spring(140, 30, 0, 0)"
Layer::inertia = ->
calculateFinalY = =>
newY = @y + @draggable.calculateVelocity().y * ACCELERATION
switch
when newY > 0 then return 0
@mrrocks
mrrocks / font-size-mixin.scss
Created October 14, 2012 14:41
SCSS (Sass) mixin to define font-size in PX, line-height and font-smoothing and then convert it to rem (base 10)
// Sets up the base 10 stuff
html { font-size: 62.5%; }
// Defaults values
$default-line-height: 1.5 !default;
$default-font-smoothing: subpixel-antialiased !default;
// Function to convert pixels to rems