Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jerstucki on github.
  • I am jeremystucki (https://keybase.io/jeremystucki) on keybase.
  • I have a public key ASBKlemcHpNeMObrKnqsHfhx86MBIXlOx8tv4j8-lxTRugo

To claim this, I am signing this object:

@jstcki
jstcki / react-portal.js
Last active September 18, 2017 13:49
React 16 Portal
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
// Portal into a DOM element with ID 'sidebar'
const Sidebar = ({ children }) =>
ReactDOM.createPortal(children, document.getElementById("sidebar"));
// Portal into a dynamically created iframe
class IFrame extends React.Component {
@jstcki
jstcki / README.md
Last active June 1, 2016 07:35
Draggable Blob II

Drag the blob to deform it. Press the shift key to show the underlying force simulation's nodes and links.

Uses d3-shape's line() and curveBasisClosed() functions to draw a blob from a graph.

This version tries to prevent the blob from collapsing using polygonHull() but this results in the removal of points and leads to jumpiness (you see the dragged point getting removed when you hold the shift key and drag it inside the blob). See the version without it for smoother dragging.

@jstcki
jstcki / README.md
Last active June 1, 2016 07:18
Draggable Blob

Drag the blob to deform it. Press the shift key to show the underlying force simulation's nodes and links.

Uses d3-shape's line() and curveBasisClosed() functions to draw a blob from a graph.

Inspired by Mike Bostock's Force Dragging III example.

@jstcki
jstcki / README.md
Last active March 3, 2016 08:13
React Motion Issue #294

Test case for React Motion issue #294.

When the animation has a low frame rate, React Motion's restarting logic restarts the animation constantly.

@jstcki
jstcki / .block
Last active August 10, 2018 04:37
Interpolate anything with React Motion
license: mit
@jstcki
jstcki / README.md
Last active November 11, 2015 08:50
Playin with p5.js
@jstcki
jstcki / README.md
Last active November 11, 2015 08:28
Animating Circles (Canvas)

Animation with Canvas. Runs with 23 – 24 FPS on a Retina MBP 13".

Also with D3 and React.

@jstcki
jstcki / README.md
Last active August 29, 2015 14:13
Animating Circles (React & SVG)

Animation with React and SVG. Runs with 8 – 9 FPS on a Retina MBP 13".

Also with D3 and Canvas.

@jstcki
jstcki / README.md
Last active August 29, 2015 14:13
Animating Circles (D3 & SVG)

Animation with D3 and SVG. Runs with 18 – 20 FPS on a Retina MBP 13".

Also with Canvas and React.