Skip to content

Instantly share code, notes, and snippets.

@luruke
luruke / smashingmagazine.js
Last active January 12, 2022 15:34
Source code of the demo "Improving User Flow Through Page Transitions" on Smashing Magazine.
/*
https://www.smashingmagazine.com/2016/07/improving-user-flow-through-page-transitions/
You can copy paste this code in your console on smashingmagazine.com
in order to have cross-fade transition when change page.
*/
var cache = {};
function loadPage(url) {
if (cache[url]) {
@eduardocereto
eduardocereto / cb_addEventListener.js
Created May 4, 2011 17:45
a cross-browser implementation of addEventListener/AttachEvent without external dependencies
/**
* Cross Browser helper to addEventListener.
*
* @param {HTMLElement} obj The Element to attach event to.
* @param {string} evt The event that will trigger the binded function.
* @param {function(event)} fnc The function to bind to the element.
* @return {boolean} true if it was successfuly binded.
*/
var cb_addEventListener = function(obj, evt, fnc) {
// W3C model
@tmaybe
tmaybe / README.md
Last active January 5, 2018 01:31
Stacked to Normalized Stacked Bar Chart

Based on mbostock's examples Stacked Bar Chart and Normalized Stacked Bar Chart. Adds transitions between the two states.

Data shows answers to the question "Generally speaking, do you think things in Afghanistan today are going in the right direction, or do you think they are going in the wrong direction?" in the Asia Foundation's 2012 Survey of the Afghan People broken down by gender, age, location, ethnicity, income, education and region.

anonymous
anonymous / Circle-Animation.markdown
Created August 4, 2014 14:18
A Pen by Florian Wirtz.