The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
const spacingFactor = 8; | |
export const spacing = { | |
space0: `${computeGoldenRatio(spacingFactor, 0)}px`, // 8 | |
space1: `${computeGoldenRatio(spacingFactor, 1)}px`, // 13 | |
space2: `${computeGoldenRatio(spacingFactor, 2)}px`, // 21 | |
space3: `${computeGoldenRatio(spacingFactor, 3)}px`, // 34 | |
space4: `${computeGoldenRatio(spacingFactor, 4)}px`, // 55 | |
space5: `${computeGoldenRatio(spacingFactor, 5)}px`, // 89 | |
}; |
/** | |
* Get a random floating point number between `min` and `max`. | |
* | |
* @param {number} min - min number | |
* @param {number} max - max number | |
* @return {float} a random floating point number | |
*/ | |
function getRandom(min, max) { | |
return Math.random() * (max - min) + min; | |
} |
src | |
.idea/ | |
node_modules |
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
# compiled js | |
dist | |
# Dependency directories | |
node_modules |
{ | |
"presets": [ | |
"stage-2", | |
"es2015" | |
], | |
"plugins": [ | |
"transform-flow-strip-types", | |
"transform-object-assign", | |
"transform-class-properties", | |
"transform-runtime" |
[libs] | |
[ignore] | |
[options] |
{ | |
"env": { | |
"browser": true, | |
"builtin": true, | |
"jasmine": true, | |
"mocha": true, | |
"node": true | |
}, | |
"extends": "airbnb", | |
"globals": { |
// Make punctuation smarter | |
jQuery.fn.smarten = (function() { | |
function smartenNode(node) { | |
if (node.nodeType === 3) { | |
node.data = node.data | |
.replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018") // Opening singles | |
.replace(/'/g, "\u2019") // Closing singles & apostrophes | |
.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201c") // Opening doubles | |
.replace(/"/g, "\u201d") // Closing doubles |
var gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var babel = require('babelify'); | |
function compile(watch) { | |
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |