Commit d6b53313cf9dbf1a1ddbe069d8906572cb4a0309

Authored by Eric Fernandez
1 parent e92e5f4d56
Exists in master and in 1 other branch develop

Espacios

Showing 2 changed files with 2 additions and 2 deletions   Show diff stats
1 const clean = require('gulp-clean'); 1 const clean = require('gulp-clean');
2 const concat = require('gulp-concat'); 2 const concat = require('gulp-concat');
3 const connect = require('gulp-connect'); 3 const connect = require('gulp-connect');
4 const gulp = require('gulp'); 4 const gulp = require('gulp');
5 const htmlmin = require('gulp-htmlmin'); 5 const htmlmin = require('gulp-htmlmin');
6 const jshint = require('gulp-jshint'); 6 const jshint = require('gulp-jshint');
7 const pump = require('pump'); 7 const pump = require('pump');
8 const rename = require('gulp-rename'); 8 const rename = require('gulp-rename');
9 const replace = require('gulp-replace'); 9 const replace = require('gulp-replace');
10 const templateCache = require('gulp-angular-templatecache'); 10 const templateCache = require('gulp-angular-templatecache');
11 const uglify = require('gulp-uglify-es').default; 11 const uglify = require('gulp-uglify-es').default;
12 const sass = require('gulp-sass'); 12 const sass = require('gulp-sass');
13 13
14 var paths = { 14 var paths = {
15 dist: 'dist/', 15 dist: 'dist/',
16 srcJS: 'src/js/*.js', 16 srcJS: 'src/js/*.js',
17 srcViews: 'src/views/*.html', 17 srcViews: 'src/views/*.html',
18 tmp: 'tmp' 18 tmp: 'tmp'
19 }; 19 };
20 20
21 gulp.task('templates', function() { 21 gulp.task('templates', function() {
22 return pump( 22 return pump(
23 [ 23 [
24 gulp.src(paths.srcViews), 24 gulp.src(paths.srcViews),
25 htmlmin(), 25 htmlmin(),
26 templateCache('views.js', { 26 templateCache('views.js', {
27 module: 'focaTeclado', 27 module: 'focaTeclado',
28 root: '' 28 root: ''
29 }), 29 }),
30 gulp.dest(paths.tmp) 30 gulp.dest(paths.tmp)
31 ] 31 ]
32 ); 32 );
33 }); 33 });
34 34
35 gulp.task('sass', function() { 35 gulp.task('sass', function() {
36 return gulp.src('src/sass/*.scss') 36 return gulp.src('src/sass/*.scss')
37 .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) 37 .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
38 .pipe(gulp.dest('css')); 38 .pipe(gulp.dest('css'));
39 }); 39 });
40 40
41 gulp.task('uglify', ['templates'], function() { 41 gulp.task('uglify', ['templates'], function() {
42 return pump( 42 return pump(
43 [ 43 [
44 gulp.src([ 44 gulp.src([
45 paths.srcJS, 45 paths.srcJS,
46 'tmp/views.js' 46 'tmp/views.js'
47 ]), 47 ]),
48 concat('foca-teclado.js'), 48 concat('foca-teclado.js'),
49 replace('src/views/', ''), 49 replace('src/views/', ''),
50 replace("'ngSanitize', 'onScreenKeyboard'", ''), 50 replace("'ngSanitize', 'onScreenKeyboard'", ''),
51 gulp.dest(paths.tmp), 51 gulp.dest(paths.tmp),
52 rename('foca-teclado.min.js'), 52 rename('foca-teclado.min.js'),
53 uglify(), 53 uglify(),
54 gulp.dest(paths.dist) 54 gulp.dest(paths.dist)
55 ] 55 ]
56 ); 56 );
57 }); 57 });
58 58
59 gulp.task('clean', function() { 59 gulp.task('clean', function() {
60 return gulp.src(['tmp', 'dist'], {read: false}) 60 return gulp.src(['tmp', 'dist'], {read: false})
61 .pipe(clean()); 61 .pipe(clean());
62 }); 62 });
63 63
64 gulp.task('pre-commit', function() { 64 gulp.task('pre-commit', function() {
65 pump( 65 pump(
66 [ 66 [
67 gulp.src(paths.srcJS), 67 gulp.src(paths.srcJS),
68 jshint('.jshintrc'), 68 jshint('.jshintrc'),
69 jshint.reporter('default'), 69 jshint.reporter('default'),
70 jshint.reporter('fail') 70 jshint.reporter('fail')
71 ] 71 ]
72 ); 72 );
73 }); 73 });
74 74
75 gulp.task('webserver', function() { 75 gulp.task('webserver', function() {
76 pump [ 76 pump [
77 connect.server( 77 connect.server(
78 { 78 {
79 port: 3000 79 port: 3000
80 } 80 }
81 ) 81 )
82 ] 82 ]
83 }); 83 });
84 84
85 gulp.task('clean-post-install', function() { 85 gulp.task('clean-post-install', function() {
86 return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', 86 return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js',
87 'index.html'], {read: false}) 87 'index.html'], {read: false})
88 .pipe(clean()); 88 .pipe(clean());
89 }); 89 });
90 90
91 gulp.task('default', ['webserver']); 91 gulp.task('default', ['webserver']);
92 92
src/sass/_teclado.scss
1 .keyboard { 1 .keyboard {
2 -webkit-touch-callout: none; 2 -webkit-touch-callout: none;
3 -webkit-user-select: none; 3 -webkit-user-select: none;
4 -khtml-user-select: none; 4 -khtml-user-select: none;
5 -moz-user-select: none; 5 -moz-user-select: none;
6 -ms-user-select: none; 6 -ms-user-select: none;
7 user-select: none; 7 user-select: none;
8 8
9 table { 9 table {
10 border-spacing: 10px; 10 border-spacing: 10px;
11 border-collapse: separate; 11 border-collapse: separate;
12 background-color: #F1F1F1; 12 background-color: #F1F1F1;
13 13
14 td { 14 td {
15 touch-action: none; 15 touch-action: none;
16 } 16 }
17 } 17 }
18 18
19 .letter { 19 .letter {
20 background-color: #bdbdbd; 20 background-color: #bdbdbd;
21 box-shadow: 2px 2px 3px #555555; 21 box-shadow: 2px 2px 3px #555555;
22 width: 47px; 22 width: 47px;
23 height: 50px; 23 height: 50px;
24 text-align: center; 24 text-align: center;
25 font-family: "arial"; 25 font-family: "arial";
26 cursor: pointer; 26 cursor: pointer;
27 color: #000; 27 color: #000;
28 font-size: 22px; 28 font-size: 22px;
29 29
30 &:hover{ 30 &:hover {
31 background-color: #fafafa; 31 background-color: #fafafa;
32 } 32 }
33 &:active { 33 &:active {
34 background-color: #999; 34 background-color: #999;
35 color: #fff; 35 color: #fff;
36 } 36 }
37 } 37 }
38 .number { 38 .number {
39 background-color: #bdbdbd; 39 background-color: #bdbdbd;
40 box-shadow: 2px 2px 3px #555555; 40 box-shadow: 2px 2px 3px #555555;
41 width: 47px; 41 width: 47px;
42 height: 35px; 42 height: 35px;
43 text-align: center; 43 text-align: center;
44 font-family: "arial"; 44 font-family: "arial";
45 cursor: pointer; 45 cursor: pointer;
46 color: #000; 46 color: #000;
47 font-size: 22px; 47 font-size: 22px;
48 48
49 &:hover{ 49 &:hover{
50 background-color: #fafafa; 50 background-color: #fafafa;
51 } 51 }
52 &:active { 52 &:active {
53 background-color: #999; 53 background-color: #999;
54 color: #fff; 54 color: #fff;
55 } 55 }
56 } 56 }
57 57
58 .margin { 58 .margin {
59 width: 40px; 59 width: 40px;
60 height: 50px; 60 height: 50px;
61 } 61 }
62 } 62 }
63 63