I hereby claim:
- I am altruity on github.
- I am dalex (https://keybase.io/dalex) on keybase.
- I have a public key ASCqGGiLlVdVKWz8d77kF-01XJWxbAnKxCirBlH27QCD-Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/** | |
* Loader that automatically prepends a reference to sassIncludes in the Webpack configuration files | |
*/ | |
import fs from 'fs'; | |
import path from 'path'; | |
import config from './config'; | |
let fileFound = true; |
// Global extend method | |
var extend = function(obj, extObj) { | |
if (arguments.length > 2) { | |
for (var a = 1; a < arguments.length; a++) { | |
extend(obj, arguments[a]); | |
} | |
} else { | |
for (var i in extObj) { | |
obj[i] = extObj[i]; | |
} |
function hexToRgb(hex) { | |
hex = hex.replace(/^.*#/, ''); | |
var bigint = parseInt(hex, 16); | |
var r = (bigint >> 16) & 255; | |
var g = (bigint >> 8) & 255; | |
var b = bigint & 255; | |
console.log("rgb("+r + "," + g + "," + b+")"); | |
return r + "," + g + "," + b; | |
} |
var width; | |
function sizeUpdate(){ | |
width = $(window).width(); | |
}; | |
$(document).ready(sizeUpdate); | |
$(window).resize(sizeUpdate); | |
// Use: | |
if (width < 768) { | |
// Do something |
// TODO: scroll to element | |
function scroll(scrollTo, time) { | |
var scrollFrom = parseInt(document.body.scrollTop), | |
i = 0, | |
runEvery = 5; // run every 5ms | |
scrollTo = parseInt(scrollTo); | |
time /= runEvery; | |
var interval = setInterval(function () { | |
i++; | |
document.body.scrollTop = (scrollTo - scrollFrom) / time * i + scrollFrom; |
/* demo page only */ | |
html { | |
width: 100%; | |
height: 100%; | |
} | |
body { | |
display: table; | |
width: 100%; | |
height: 100%; | |
overflow: hidden; |
// Add data to localStorage | |
var jsonUrl = "data/covers.json"; | |
function loadFileJSON( toLocalStorage, fromUrl){ | |
if (localStorage[toLocalStorage]) { | |
//console.log("Data already loaded."); | |
} else { | |
$.getJSON(jsonUrl, function (data) { | |
localStorage[toLocalStorage] = JSON.stringify(data); | |
//console.log("Data now loaded."); | |
}); |