Skip to content

Instantly share code, notes, and snippets.

View elierotenberg's full-sized avatar

Elie Rotenberg elierotenberg

View GitHub Profile
@elierotenberg
elierotenberg / SimpleAnimationWithCSS.jsx
Created August 2, 2014 17:03
SimpleAnimationWithCSS.jsx
/** @jsx React.DOM */
var React = require("react");
var AnimateMixin = require("react-animate");
var fromCSS = require("react-css").fromCSS;
var from = fromCSS("{" +
"transform: rotate(0deg);" +
"background-color: blue;" +
"margin: 50px;" +
"width: 200px;" +
@elierotenberg
elierotenberg / SimpleCSS.jsx
Created August 2, 2014 17:01
SimpleCSS.jsx
/** @jsx React.DOM */
var React = require("react");
var fromCSS = require("react-css").fromCSS;
var myStyle = fromCSS("{" +
"transform: rotate(20deg);" +
"background-color: red;" +
"width: 100px;" +
"margin: 50px;" +
"}");
/** @jsx React.DOM */
var React = require("react");
var AnimateMixin = require("react-animate");
var SimpleAnimation = React.createClass({
mixins: [AnimateMixin],
getInitialState: function getInitialState() {
return {
showoff: false,
};
@elierotenberg
elierotenberg / Animate.js
Created July 25, 2014 09:37
Animating with React and d3
var _ = require("lodash");
var d3 = require("d3");
var raf = require("raf");
var getInterpolator = function getInterpolator(from, to) {
return d3.interpolate(from, to);
};
var startInterpolation = function startInterpolation(properties, easing, duration, onTick, onComplete) {
var aborted = false;