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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>let outside or const inside</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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
# Swap two Framer layers of different heights and reposition parent layers | |
# Special thanks to Niels http://stackoverflow.com/questions/39240373/framerjs-layer-with-dynamic-height-importing-layers-from-sketch (much cleaner than the original solution I wrote) | |
# Cowritten by Emily (https://github.com/xymostech) & Nick (https://github.com/mrnickbreen) at Khan Academy (https://github.com/khan) | |
stackLayers = (layerList, amountToReposition = 0) -> | |
for layer in layerList | |
layer.y = layer.y + amountToReposition | |
resizeParents = (layer, heightDifference) -> | |
if !layer.parent | |
return |