This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Framer X Utils.modulate equivalent | |
function modulate(value, rangeA, rangeB, limit = false) { | |
const [fromLow, fromHigh] = rangeA; | |
const [toLow, toHigh] = rangeB; | |
const result = toLow + ((value - fromLow) / (fromHigh - fromLow)) * (toHigh - toLow); | |
if (limit === true) { | |
if (toLow < toHigh) { | |
if (result < toLow) { | |
return toLow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var s = document.createElement("script"); s.setAttribute("src", "https://magic-motion-intro.koenbok.now.sh/MagicMotionIntro.d93f8ba0.js");document.body.appendChild(s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Changes XML to JSON | |
// Modified version from here: http://davidwalsh.name/convert-xml-json | |
function xmlToJson(xml) { | |
// Create the return object | |
var obj = {}; | |
if (xml.nodeType == 1) { // element | |
// do attributes | |
if (xml.attributes.length > 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getBoundingLayerForRotatedLayer = (layer) -> | |
tr = "topRight"; bl = "bottomLeft"; tl = "topLeft"; br = "bottomRight"; | |
center = x: layer.midX, y: layer.midY | |
size = w: layer.width, h: layer.height | |
rotation = layer.rotation | |
corners = | |
"#{tr}": x: (size.w/2), y: (size.h/2) | |
"#{bl}": x: -(size.w/2), y: -(size.h/2) | |
getRotatedPoint = (p) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "hello world" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set inline width & height. | |
Video, img alternative natural width & height: 1920 x 1080 | |
21mb video O_O | |
http://codepen.io/MikeMcChillin/pen/wKGFz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
document.addEventListener('touchmove', function(e){e.preventDefault();}, false); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( 'ontouchstart' in window ){ document.addEventListener("touchstart", function(){}, false) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b = document.documentElement; | |
b.setAttribute('data-ua', navigator.userAgent); | |
b.setAttribute('data-pf', navigator.platform ); |
NewerOlder