Skip to content

Instantly share code, notes, and snippets.

@briangonzalez
briangonzalez / README.md
Created October 21, 2012 04:25
img2boxshadow - a ruby script to convert images to CSS [http://codepen.io/briangonzalez/details/AvrGI#pen-details-tab]

img2boxshadow.rb

a ruby script to convert images to CSS (box-shadows)

Installation

gem install rmagick    # you'll need ImageMagick & Ruby first
gem install colormath
gem install micro-optparse
滚动条
当前高度
window.scrollY
最大高度[2]
document.documentElement.scrollHeight - document.documentElement.clientHeight //所有现代浏览器,标准模式。火狐在混杂模式下为 0。2013年7月21日
window.scrollMaxY //火狐,2013年7月21日
document.height - window.innerHeight //Chrome
document.body.scrollHeight //Chrome,2013年7月21日
document.documentElement.clientHeight //火狐,标准模式。2013年7月21日
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),