Skip to content

Instantly share code, notes, and snippets.

View antoniocapelo's full-sized avatar

Capelo antoniocapelo

View GitHub Profile
@antoniocapelo
antoniocapelo / ClassExport
Last active August 29, 2015 14:04
Class creation and export on JavaScript
(function() {
var ClassName, root;
function ClassName (config) {
var privateProperty = 24;
this.publicProperty = 42;
privateMethod = function (foo) {
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@antoniocapelo
antoniocapelo / filtered-gif-cover-bg
Last active August 29, 2015 14:04
SCSS class for using a scaled and filtered gif as background
// Using a scaled and filtered gif as background
.background {
position: absolute;
top: 0;
left: 0;
width: 20%;
height: 20%;
z-index: -1;
background-image: url('http://37.media.tumblr.com/tumblr_lupg946u5S1qe0eclo1_r5_500.gif');
@antoniocapelo
antoniocapelo / cover-background
Created July 17, 2014 22:35
Procedure to obtain the background cover effect whichs works on small or large screens
// Procedure to obtain the background cover effect whichs works on small or large screens
html {
background: url(url_to_img) no-repeat center center fixed;
background-size: cover;
height: 100%;
overflow: hidden;
}
body