Skip to content

Instantly share code, notes, and snippets.

Avatar

Axel Michel axelmichel

View GitHub Profile
@axelmichel
axelmichel / durationtransitionprop.js
Created Jan 13, 2017
Extracting the transition with the longest duration (and delay)
View durationtransitionprop.js
function getMaxDurationTransitionProperty(el) {
// small helper to extract the values
function extract(str) {
return str
.replace(/[A-Z]/gi, "")
.split(", ")
.map(parseFloat);
};
// get the current style
var style = getComputedStyle(el);
@axelmichel
axelmichel / blurry-example.html
Created Feb 1, 2016
facebook like unblur effect with tiny images onload and src switch after
View blurry-example.html
<img class="blurry" src="super-tinyimage-small.jpg" />
<div class="blurry" style="background-image:url(super-tinyimage-small.jpg);"></div>
View ios-viewport-scaling-bug-fix-original.js
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
You can’t perform that action at this time.