From 812043fa231a30928db250965b2733ab9c38a4f4 Mon Sep 17 00:00:00 2001 From: Bowen Yu Date: Sat, 18 Feb 2017 16:16:19 -0500 Subject: [PATCH 01/35] improve style --- doc.html | 2 +- gulp/build.js | 7 +- gulp/copy.js | 12 ++- gulp/css.js | 70 +++++++++++++++++ gulp/paths.js | 6 ++ gulp/sass.js | 37 --------- imgs/microphone.png | Bin 0 -> 487 bytes index.html | 47 +++++++----- package.json | 6 +- server/config | 3 + src/about/about.html | 5 -- src/common/colors.scss | 11 +++ src/common/common.scss | 29 +++++++ src/common/override/bootstrap-switch.less | 9 +++ src/common/override/bootstrap.scss | 44 +++++++++++ src/common/override/jquery-ui.scss | 34 +++++++++ src/common/override/select-bootstrap.scss | 11 +++ .../{override.scss => override/select2.scss} | 71 +----------------- src/common/style-deps/bootstrap.less | 20 +++++ src/common/style.scss | 3 +- src/common/utils.scss | 4 - src/data-source/data-source.scss | 4 +- src/dialog/dialog.scss | 2 - src/node/node.scss | 19 +++-- src/panel/node-panel/index.js | 17 ++++- src/panel/node-panel/node-panel.scss | 34 ++++----- src/panel/option-panel/index.js | 2 +- src/panel/option-panel/option-panel.scss | 25 ++---- src/panel/popup-panel/popup-panel.scss | 7 +- src/panel/tool-panel/tool-panel.scss | 29 ++++--- src/port/port.scss | 7 +- src/tooltip/tooltip.scss | 4 +- .../colorscale-select/colorscale-select.scss | 4 +- src/unit/editable-list/editable-list.scss | 4 +- src/upload/upload.scss | 2 +- 35 files changed, 369 insertions(+), 222 deletions(-) create mode 100644 gulp/css.js delete mode 100644 gulp/sass.js create mode 100644 imgs/microphone.png create mode 100644 server/config create mode 100644 src/common/common.scss create mode 100644 src/common/override/bootstrap-switch.less create mode 100644 src/common/override/bootstrap.scss create mode 100644 src/common/override/jquery-ui.scss create mode 100644 src/common/override/select-bootstrap.scss rename src/common/{override.scss => override/select2.scss} (52%) create mode 100644 src/common/style-deps/bootstrap.less delete mode 100644 src/common/utils.scss diff --git a/doc.html b/doc.html index 0418862..21bbcd2 100644 --- a/doc.html +++ b/doc.html @@ -12,7 +12,7 @@ - + diff --git a/gulp/build.js b/gulp/build.js index 2a52e7f..20dfc07 100644 --- a/gulp/build.js +++ b/gulp/build.js @@ -6,7 +6,7 @@ var runSequence = require('run-sequence'); gulp.task('build', function(cb) { runSequence( 'dist', - ['copy', 'sass', 'compile'], + ['copy', 'css', 'compile'], cb); }); @@ -15,10 +15,7 @@ gulp.task('build-dev', function(cb) { runSequence( 'dist', 'compile-dev', - [ - 'copy', - 'sass-dev' - ], + ['copy', 'css-dev'], cb); }); diff --git a/gulp/copy.js b/gulp/copy.js index 72f67ae..42cfd31 100644 --- a/gulp/copy.js +++ b/gulp/copy.js @@ -7,7 +7,7 @@ var paths = require('./paths.js'); gulp.task('copy-imgs', function() { return gulp.src(paths.imgs) - .pipe(gulp.dest(paths.dist + 'imgs')); + .pipe(gulp.dest(paths.dist + 'css/imgs')); }); gulp.task('copy-html', function() { @@ -25,6 +25,12 @@ gulp.task('copy-doc-imgs', function() { .pipe(gulp.dest(paths.dist + 'doc')); }); -gulp.task('copy', ['copy-imgs', 'copy-html']); +gulp.task('copy-fonts', function() { + return gulp.src(paths.fonts) + .pipe(gulp.dest(paths.dist + 'fonts')); +}); + + +gulp.task('copy', ['copy-imgs', 'copy-html', 'copy-fonts']); -gulp.task('copy-doc', ['copy-doc-js', 'copy-doc-imgs']); +gulp.task('copy-doc', ['copy-doc-js', 'copy-doc-imgs', 'copy-fonts']); diff --git a/gulp/css.js b/gulp/css.js new file mode 100644 index 0000000..5b01217 --- /dev/null +++ b/gulp/css.js @@ -0,0 +1,70 @@ +// Sass and Less build the css. +var gulp = require('gulp'); +var sass = require('gulp-sass'); +var less = require('gulp-less'); +var flatten = require('gulp-flatten'); +var concat = require('gulp-concat'); +var autoprefixer = require('gulp-autoprefixer'); +var cleanCSS = require('gulp-clean-css'); +var gutil = require('gulp-util'); + +var paths = require('./paths.js'); + +var runSass = function(cb, path, outputFile, compressed) { + return gulp.src(path) + .pipe(concat(outputFile) + .on('error', function(err) { + cb(err); + })) + .pipe(flatten() + .on('error', function(err) { + cb(err); + })) + .pipe(sass({ + outputStyle: compressed ? 'compressed' : '' + }).on('error', sass.logError)) + .pipe(autoprefixer()) + .pipe(gulp.dest(paths.dist + 'css')); +}; + +gulp.task('sass', function(cb) { + return runSass(cb, paths.scss, 'visflow.css', true); +}); + +gulp.task('sass-dev', function(cb) { + return runSass(cb, paths.scss, 'visflow.css', false); +}); + +gulp.task('sass-doc', function(cb) { + return runSass(cb, paths.docScss, 'doc.css', false); +}); + +var runLess = function(cb, path, outputFile, isDev) { + var stream = gulp.src(path) + .pipe(concat(outputFile) + .on('error', function(err) { + cb(err); + })) + .pipe(flatten() + .on('error', function(err) { + cb(err); + })) + .pipe(less().on('error', gutil.log)); + if (isDev) { + stream.pipe(cleanCSS().on('error', gutil.log)); + } + return stream.pipe(autoprefixer()) + .pipe(gulp.dest(paths.dist + 'css')); +}; + +gulp.task('less', function(cb) { + return runLess(cb, paths.less, 'visflow_deps.css', false); +}); + +gulp.task('less-dev', function(cb) { + return runLess(cb, paths.less, 'visflow_deps.css', true); +}); + +gulp.task('css', ['sass', 'less']); + +gulp.task('css-dev', ['sass-dev', 'less-dev']); \ No newline at end of file diff --git a/gulp/paths.js b/gulp/paths.js index a111407..00c20dd 100644 --- a/gulp/paths.js +++ b/gulp/paths.js @@ -100,9 +100,15 @@ module.exports = { 'src/**/*.scss', 'src/**/*.css' ], + less: [ + 'src/**/*.less' + ], html: [ 'src/**/*.html' ], + fonts: [ + 'bower_components/bootstrap/dist/fonts/*' + ], index: ['index.html'], gulpTasks: ['gulp/**/*.js'] }; diff --git a/gulp/sass.js b/gulp/sass.js deleted file mode 100644 index c7db42c..0000000 --- a/gulp/sass.js +++ /dev/null @@ -1,37 +0,0 @@ -// Sass build the css. -var gulp = require('gulp'); -var sass = require('gulp-sass'); -var flatten = require('gulp-flatten'); -var concat = require('gulp-concat'); -var autoprefixer = require('gulp-autoprefixer'); - -var paths = require('./paths.js'); - -var runSass = function(cb, path, outputFile, compressed) { - return gulp.src(path) - .pipe(concat(outputFile) - .on('error', function(err) { - cb(err); - })) - .pipe(flatten() - .on('error', function(err) { - cb(err); - })) - .pipe(sass({ - outputStyle: compressed ? 'compressed' : '' - }).on('error', sass.logError)) - .pipe(autoprefixer()) - .pipe(gulp.dest(paths.dist)); -}; - -gulp.task('sass', function(cb) { - return runSass(cb, paths.scss, 'visflow.css', true); -}); - -gulp.task('sass-dev', function(cb) { - return runSass(cb, paths.scss, 'visflow.css', false); -}); - -gulp.task('sass-doc', function(cb) { - return runSass(cb, paths.docScss, 'doc.css', false); -}); diff --git a/imgs/microphone.png b/imgs/microphone.png new file mode 100644 index 0000000000000000000000000000000000000000..85084432e7aaf51a5213dc9d823056bfde64a4e0 GIT binary patch literal 487 zcmVIf1&JtVM5XZOXp}xW zqE*o7brK4VuV~N+e*ukld(O<=y=Mp^P!_`|E7;ly4=OrkFq}F_=X=KT57HR`g0>F(XfzAfx z0DUF-r2S@ML&pCO$hV%Lz& z2v?0)KJBJJukcxZk~Lr)=*VN-c>VPx+5@`3WY<8O@p7a@PsU3?+SGlJ3-v%cEs}lV zM@VLYu5Y=~-h7u;;rq|!{4jpUD(a9lWISIV2Q&(yJyEhyf0v=l5USfzl9HM)G_Z+! dTmT(0ju*UXNj_qH|MLI<002ovPDHLkV1i4r%V+=q literal 0 HcmV?d00001 diff --git a/index.html b/index.html index 254ae49..5ffe003 100644 --- a/index.html +++ b/index.html @@ -14,11 +14,18 @@ + + + + + @@ -46,10 +53,10 @@ - + -