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 style = require('dom-css'); | |
var NUM_SAMPLES = 100; | |
var CURVE = [0,1.45,1,-1]; | |
for(var i = 0; i <= NUM_SAMPLES; i++) { | |
var el = document.createElement('div'); | |
style(el, { | |
width: 10, |
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 style = require('dom-css'); | |
var NUM_SAMPLES = 100; | |
var bezier = require('bezier'); | |
var CURVE = [.62,.12,0,1.4]; | |
var x = [ 0, CURVE[0], CURVE[2], 1 ] | |
var y = [ 0, CURVE[1], CURVE[3], 1 ] | |
for(var i = 0; i <= NUM_SAMPLES; i++) { |
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 f1DOM = require('f1-dom'); | |
var elButton; | |
var button; | |
// data-f1 defines an association with states | |
// which are later defined when creating an f1 instance | |
document.body.innerHTML = | |
'<div data-f1="elButton">' + | |
'<div data-f1="text">Im a button</div>' + | |
'</div>'; |
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 f1DOM = require('f1-dom'); | |
var elButton; | |
var button; | |
// data-f1 defines an association with states | |
// which are later defined when creating an f1 instance | |
document.body.innerHTML = | |
'<div data-f1="elButton">' + | |
'<div data-f1="text">Im a button</div>' + | |
'</div>'; |
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 f1DOM = require('f1-dom'); | |
var elButton; | |
var button; | |
// data-f1 defines an association with states | |
// which are later defined when creating an f1 instance | |
document.body.innerHTML = | |
'<div data-f1="elButton">' + | |
'<div data-f1="text">Im a button</div>' + | |
'</div>'; |
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
fire(); | |
setInterval(fire, 300); | |
setInterval(unfire, 500); | |
function fire() { | |
$('#can').trigger(TRUMP.main.events[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
export default (paths) => { | |
const rules = []; | |
Array.prototype.forEach.call(document.styleSheets, (sheet) => { | |
Array.prototype.forEach.call(sheet.cssRules, (rule) => { | |
paths.forEach((path) => { | |
if (rule.selectorText && rule.selectorText.endsWith(`${path[0]}_${path[1]}`)) { | |
rules.push(rule); | |
} | |
}); |
OlderNewer