On Github varmil / totec2014_front_presen
name = '山本 晃大' occupation = 'ぎじゅつけい' properties = [ 'JSer', 'Underscore.js', 'Node.js' 'PHPer(過去の話)', 'isucon' ]
(100%これだけです)
とりあえず開始前に gulp-webserver の導入
var gulp = require('gulp'); var webserver = require('gulp-webserver'); gulp.task('webserver', function() { gulp.src('pu7mQgd') .pipe(webserver({ livereload: true, directoryListing: true, port: 9999, fallback: 'index.html' }) ); }); gulp.task('default', ['webserver']);
convert -quality 10 ./images/features/2.png ./img_o/features/2.jpg convert -quality 10 ./images/features/3.png ./img_o/features/3.jpg convert -quality 10 ./images/features/4.png ./img_o/features/4.jpg convert -quality 10 ./images/features/5.png ./img_o/features/5.jpg
これが元画像で...
(ファイルサイズ 1/50)
(24ファイル。多すぎるので2列) "javascripts/jquery-1.11.1.js", "javascripts/underscore.js" "javascripts/underscore.string.js", "javascripts/backbone.js" "javascripts/bootstrap.js", "javascripts/coffee-script.js" "javascripts/createjs-2013.12.12.min.js", "javascripts/imgLiquid.js" "javascripts/jquery-ui.js", "javascripts/jquery.bxslider.js" "javascripts/jquery.cycle.all.js", "javascripts/jquery.ellipsis.js" "javascripts/jquery.heightLine.js", "javascripts/jquery.localscroll.js" "javascripts/jquery.maximage.js", "javascripts/jquery.scrollto.js" "javascripts/jquery.slides.js", "javascripts/jquery.smarttruncation.js" "javascripts/masonry.pkgd.js", "javascripts/paper-full.js" "javascripts/tabulous.js", "javascripts/trunk8.js" "javascripts/jquery.smoothScroll.js", "javascripts/modernizr.custom.86912.js"
(14ファイル) 'javascripts/jquery-1.11.1.js', 'javascripts/underscore.js', 'javascripts/underscore.string.js', 'javascripts/backbone.js', 'javascripts/coffee-script.js', 'javascripts/imgLiquid.js', 'javascripts/jquery.bxslider.js', 'javascripts/jquery.ellipsis.js', 'javascripts/jquery.heightLine.js', 'javascripts/jquery.localscroll.js', 'javascripts/jquery.maximage.js', 'javascripts/jquery.scrollto.js', 'javascripts/masonry.pkgd.js', 'javascripts/jquery.smoothScroll.js'
=> ライブラリ本体もゴリゴリ削る
watch: { js: { files: 'javascripts/*.js', tasks: ['concat:js', 'uglify'] }, css: { files: 'stylesheets/*.css', tasks: ['concat:css', 'cssmin'] }, html: { files: './src/index.html', tasks: ['htmlmin'] } }
反省:JSエラーが見辛いこと、この上なし
苦肉の策で、いじるファイルは外出しして作業
<scrip src="javascripts/backbone.js"></scrip> <scrip src="min/jm.js"></scrip>
uglify: { dist: { options: { // 同階層にjm.js.mapファイルが生成される //# sourceMappingURL=jm.js.map というリンクがjm.jsの末尾に挿入される sourceMap: true }, files: { 'min/jm.js': 'concat/j.js' } } },
concat: { js: { src : [ 'javascripts/jquery-1.11.1.js', 'javascripts/underscore.js', 'javascripts/underscore.string.js', ...(略)... ], dest: 'concat/j.js' }, css: { src : [ 'stylesheets/bootstrap.css', 'stylesheets/jquery.bxslider.css', 'stylesheets/main.css' ], dest: 'concat/c.css' } },
uglify: { dist: { files: { 'min/jm.js': 'concat/j.js' } } }, htmlmin: { dist: { options: { removeComments: true, collapseWhitespace: true }, files: { './index.html': 'src/index.html' } } }, cssmin: { combine: { files: { 'min/c.css': 'concat/c.css' } } },
<section class="Sitesummary"> <div class="Sitesummary-element-container"> <div class="inner"> <div class="Sitesummary-permalink-block"> <h1> <div class="Sitesummary-text-block"> <span class="Sitesummary-button-spot"> <img src="images/visual-title.png" alt="Pashalistock Tokyo. 100% Free Stock Photos. Every. Single. Week. Everything you need for your creative projects, all public domain images!"> </span> </div> </h1> </div> </div> </div> </section>
<section class="Sitesummary"> <div class="inner"> <h1> <img src="images/visual-title.png"> </h1> </div> </section>
ImageMagick, pngquantの併用
convert -quality 75 ./images/visual-photo.png ./img_o/visual-photo.jpg convert -quality 75 ./images/features/1.png ./img_o/features/1.jpg convert -quality 75 ./images/features/2.png ./img_o/features/2.jpg convert -quality 75 ./images/features/3.png ./img_o/features/3.jpg convert -quality 75 ./images/features/4.png ./img_o/features/4.jpg convert -quality 75 ./images/features/5.png ./img_o/features/5.jpg pngquant --ext _.png images/photos/ *.png pngquant --ext _.png images/onlineshopitems/ *.png
(割と適当)
n = changedNumber complexity = Math.pow(2, n) - 1