Skip to content

Instantly share code, notes, and snippets.

Avatar

Yauhen Kavalenka ykavalenka

View GitHub Profile
@luruke
luruke / smashingmagazine.js
Last active Jul 29, 2021
Source code of the demo "Improving User Flow Through Page Transitions" on Smashing Magazine.
View smashingmagazine.js
/*
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]) {
@tmaybe
tmaybe / README.md
Last active Jan 5, 2018
Stacked to Normalized Stacked Bar Chart
View README.md

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.

@eduardocereto
eduardocereto / cb_addEventListener.js
Created May 4, 2011
a cross-browser implementation of addEventListener/AttachEvent without external dependencies
View cb_addEventListener.js
/**
* 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