Skip to content

Instantly share code, notes, and snippets.

View andipollok's full-sized avatar

Andi Pollok andipollok

View GitHub Profile
// using p5 to draw and canvas2svg to export svg from canvas-sketch
// https://gist.github.com/mattdesl/83a1eb53bb703f5dd939d424ccab86b6
//
// ====================================================================================================
// Not working, SVG is empty. P5 content renders fine.
// ====================================================================================================
const canvasSketch = require('canvas-sketch');
const svg = require('./canvas-to-svg.js');
const p5 = require('p5');
@andipollok
andipollok / index.html
Created March 12, 2015 08:57
JS Bin Load and display CSV using an Angular controller and a directive // source http://jsbin.com/toxucitidi
<!DOCTYPE html>
<html ng-app='test'>
<head>
<meta name="description" content="Load and display CSV using an Angular controller and a directive">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-controller="testCtrl">
<test-directive>
@andipollok
andipollok / dabblet.css
Created May 8, 2014 14:39
Align text on typographic baseline at absolute position on page
/**
* Align text on typographic baseline at absolute position on page
* http://en.wikipedia.org/wiki/Baseline_(typography)
* also see discussion on SO http://stackoverflow.com/questions/6178506/css-display-text-at-descent-instead-of-baseline
*/
.position {
position:absolute;
top:100px;
left:50px;
@andipollok
andipollok / README.md
Last active August 29, 2015 13:56
Text Hover Effect

Simple mouseover on a text, changing its color and font size.

@andipollok
andipollok / README.md
Last active January 2, 2016 17:58
Animated typography outlines
@andipollok
andipollok / README.md
Last active December 30, 2015 06:29
Folding Horizontal Menu II

Menu items unfold on mouseover and move on click.

Activate slow transitions by pressing shift key.

@andipollok
andipollok / README.md
Last active December 29, 2015 18:08
Folding Horizontal Menu

Menu items unfold on mouseover. Also includes code to trigger mouse events on d3 objects via jQuery. This was necessary here because the mouse over area of the whole menu as well as the buttons have to react to mouse events and they are on top of each other.

@andipollok
andipollok / README.md
Last active December 29, 2015 16:09
Button mouseover transitions

Button mouseover animations with d3 transitions, which offer much more possibilities than CSS animations. Bonus points for knowing why I selected these six countries for this demo!

@andipollok
andipollok / README.md
Last active December 29, 2015 12:59
Text Label Backgrounds

Resizing the background rectangle of text labels according to the bounding box of the text.

@andipollok
andipollok / README.md
Last active December 29, 2015 10:58
Zoomable Labeled Dots

Added text labels to the dots, that show and hide depending on zoom level. Semantic zooming of random positioned clusters with connected dots.