From 8b62e6185aaecbceb46f8732e9e937fe70e6cadf Mon Sep 17 00:00:00 2001 From: Amio Date: Thu, 29 May 2014 17:32:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=92=8CApp=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E4=B8=BA=E4=B8=A4=E4=B8=AA=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 38 ++++++++---- home/index.html | 156 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+), 12 deletions(-) create mode 100644 home/index.html diff --git a/gulpfile.js b/gulpfile.js index ea4fcb9..a17f0e7 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,7 +4,8 @@ var $ = require('gulp-load-plugins')(); var LOCAL_PORT = 9999; var SOURCE_ROOT = './app'; -var BUILD_ROOT = './dist'; +var BUILD_ROOT = './dist/app'; +var INTRO_ROOT = './dist/intro'; /** * ===================================== @@ -88,17 +89,24 @@ gulp.task('lint', function () { * ===================================== */ -//var sass = require('gulp-ruby-sass'); -//var jshint = require('gulp-jshint'); - gulp.task('usemin', ['html2js'], function () { - gulp.src('./app/*.html') + + // WebApp + gulp.src('app/*.html') .pipe($.usemin({ css: [$.autoprefixer(), $.minifyCss(), $.rev()], js: [$.ngmin(), $.uglify(), $.rev()], html: [$.minifyHtml({empty: true})] })) .pipe(gulp.dest(BUILD_ROOT)); + + // Homepage + gulp.src('home/*.html') + .pipe($.usemin({ + css: [$.autoprefixer(), $.minifyCss(), $.rev()], + html: [$.minifyHtml({empty: true})] + })) + .pipe(gulp.dest('dist/home')); }); gulp.task('html2js', function () { @@ -115,16 +123,18 @@ gulp.task('html2js', function () { }); gulp.task('imagemin', function () { - var imgSrc = './app/images/*.*'; - var imgDst = './dist/images'; + var imgSrc = SOURCE_ROOT + '/images/*.*'; + var imgDst = BUILD_ROOT + '/images'; gulp.src(imgSrc) - .pipe($.changed('./dist/images')) + .pipe($.changed(imgDst)) .pipe($.imagemin()) .pipe(gulp.dest(imgDst)); }); gulp.task('copy', function () { + + // WebApp gulp.src([ '!' + SOURCE_ROOT + '/*.html', SOURCE_ROOT + '/*.*', @@ -132,6 +142,10 @@ gulp.task('copy', function () { SOURCE_ROOT + '/fonts/**/*' ], { base: SOURCE_ROOT }) .pipe(gulp.dest(BUILD_ROOT)); + + // Homepage + gulp.src(['app/fonts/**/*']) + .pipe(gulp.dest('dist/home/fonts')); }); gulp.task('clean', function () { @@ -164,18 +178,18 @@ function sh(commands) { function distribution(tar) { var targets = { - open: 'ProtoShop@protoshop.io:/var/www/ProtoShop/html/', + io: 'ProtoShop@protoshop.io:/var/www/ProtoShop/html/', ctqa: 'weiwuxu@10.2.254.48:/var/www/ProtoShop/html/', debug: 'weiwuxu@10.2.254.48:/var/www/Debug/html/' }; var rsyncParams = ' -avz -e ssh --delete --exclude=.git* --exclude=*.scss --exclude=node_modules'; - var command = 'rsync ' + BUILD_ROOT + '/ ' + targets[tar] + rsyncParams; + var command = 'rsync ./dist/ ' + targets[tar] + rsyncParams; sh(command); } -gulp.task('dist:open', function () { - distribution('open'); +gulp.task('dist:io', function () { + distribution('io'); }); gulp.task('dist:ctqa', function () { diff --git a/home/index.html b/home/index.html new file mode 100644 index 0000000..a98b5dd --- /dev/null +++ b/home/index.html @@ -0,0 +1,156 @@ + + + + + Protoshop + + + + + + +
+ +
+

Build on Web
+ +

View on Mobile
+
+ +
+
+
+

BuildOn Web

+
+
+
+
+
+

ViewOn Mobile

+
+
+
+
+ +
+
Credits:
+
+ Yanghe Liu + +
+
+ Flea + +
+
+ Xianqin Zhu + +
+
+ +
+ + + + \ No newline at end of file