Skip to content

Instantly share code, notes, and snippets.

@julienchazal
julienchazal / getUrlParameter.js
Created March 16, 2016 11:08
get URL parameter function
function getURLParameter(url, param) {
return decodeURIComponent((new RegExp('[?|&]' + param + '=' + '([^&;]+?)(&|#|;|$)').exec(url)||[,""])[1].replace(/\+/g, '%20'))||null;
}
@julienchazal
julienchazal / prevent-blue-highlight-iOs-html-tag-click.scss
Created February 16, 2016 16:06
prevent android blue highlight on click + iOs hack for clicking html tag
html {
&.touch {
// iOs hack for clicking html tag
cursor:pointer;
// prevent android blue highlight on click
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
}
}
// http://fvsch.com/code/video-background/
#video-bg {
position: fixed;
top: 0; right: 0; bottom: 0; left: 0;
overflow: hidden;
}
#video-bg > video {
position: absolute;
top: 0;
@julienchazal
julienchazal / iOs-hack-for-clicking-html-tag.scss
Last active October 7, 2015 15:15
iOs hack for clicking html tag
// iOs hack for clicking html tag or dynamically loaded elements
&.touch {
cursor:pointer;
// prevent android blue highlight on click
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
}
@julienchazal
julienchazal / jQueryOneTransitionend.js
Created September 17, 2015 12:17
jQuery one transitionend
$(this).find('.products_list').one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend", function() {
// your code when the transition has finished
});
@julienchazal
julienchazal / modernizr-load-input-placeholder.js
Created May 13, 2014 14:49
Modernizr conditionnal script loading for input placeholders
Modernizr.load({
test: Modernizr.inputtypes && Modernizr.input.placeholder,
nope: 'scripts/polyfills/placeholders.jquery.min.js'
});
@julienchazal
julienchazal / jagged-rotated-font-fix.css
Created April 30, 2014 13:00
Jagged rotated font fix
/* jagged rotated font fix (filter for FF)*/
-webkit-backface-visibility:hidden;
outline: 1px solid transparent;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
@font-face {
font-family: 'cicle_gorditagordita';
src: url('fonts/Cicle_Gordita-webfont.eot');
src: url('fonts/Cicle_Gordita-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/Cicle_Gordita-webfont.woff') format('woff'),
url('fonts/Cicle_Gordita-webfont.ttf') format('truetype'),
url('fonts/Cicle_Gordita-webfont.svg#cicle_gorditagordita') format('svg');
font-weight: normal;
font-style: normal;
@julienchazal
julienchazal / jQuery-Smooth-Scroll.js
Last active August 29, 2015 14:00
jQuery Smooth Scroll
$('a[href^="#"]').on("click", function(){
var the_id = $(this).attr("href");
$('html, body').animate({
scrollTop:$(the_id).offset().top
}, 'slow');
return false;
});
// si scroll dans un conteneur :
@julienchazal
julienchazal / LESS mixin for CSS arrow
Created April 18, 2014 13:29
LESS mixin for CSS arrow
/* ------------------------ */
/* LESS mixin for CSS arrow */
/* ------------------------ */
/* https://github.com/HugoGiraudel/LESS-Mixin-for-CSS-arrows
//Usage
.arrow(size, color, direction, offset, border-size, border-color);
Where