Browse Source

Embed images and favicon into HTML file

fastled
Xose Pérez 7 years ago
parent
commit
9d9f0e9a02
15 changed files with 141 additions and 17 deletions
  1. BIN
      code/espurna/data/favicon.ico
  2. BIN
      code/espurna/data/images/check.png
  3. BIN
      code/espurna/data/index.html.gz
  4. +12
    -2
      code/gulpfile.js
  5. +7
    -14
      code/html/checkboxes.css
  6. BIN
      code/html/images/border-off.png
  7. BIN
      code/html/images/border-on.png
  8. BIN
      code/html/images/handle-center.png
  9. BIN
      code/html/images/handle-left.png
  10. BIN
      code/html/images/handle-right.png
  11. BIN
      code/html/images/label-off.png
  12. BIN
      code/html/images/label-on.png
  13. +1
    -1
      code/html/index.html
  14. +119
    -0
      code/html/src/checkboxes.css
  15. +2
    -0
      code/package.json

BIN
code/espurna/data/favicon.ico View File

Before After

BIN
code/espurna/data/images/check.png View File

Before After
Width: 4  |  Height: 189  |  Size: 1.4 KiB

BIN
code/espurna/data/index.html.gz View File


+ 12
- 2
code/gulpfile.js View File

@ -33,6 +33,8 @@ const del = require('del');
const useref = require('gulp-useref'); const useref = require('gulp-useref');
const gulpif = require('gulp-if'); const gulpif = require('gulp-if');
const inline = require('gulp-inline'); const inline = require('gulp-inline');
const inlineImages = require('gulp-css-base64');
const favicon = require('gulp-base64-favicon');
const destination = 'espurna/data/'; const destination = 'espurna/data/';
@ -51,10 +53,18 @@ gulp.task('files', function() {
.pipe(gulp.dest(destination)); .pipe(gulp.dest(destination));
}); });
gulp.task('inline_images', function() {
return gulp.src(['html/src/checkboxes.css'])
.pipe(inlineImages({
baseDir: "../"
}))
.pipe(gulp.dest('html/'));
});
/* Process HTML, CSS, JS --- INLINE --- */
/* Process HTML, CSS, JS, IMAGES and FAVICON --- INLINE --- */
gulp.task('inline', function() { gulp.task('inline', function() {
return gulp.src('html/*.html') return gulp.src('html/*.html')
.pipe(favicon())
.pipe(inline({ .pipe(inline({
base: 'html/', base: 'html/',
js: uglify, js: uglify,
@ -90,5 +100,5 @@ gulp.task('html', function() {
/* Build file system */ /* Build file system */
gulp.task('buildfs_split', ['clean', 'files', 'html']); gulp.task('buildfs_split', ['clean', 'files', 'html']);
gulp.task('buildfs_inline', ['clean', 'files', 'inline']);
gulp.task('buildfs_inline', ['clean', 'inline_images', 'inline']);
gulp.task('default', ['buildfs_inline']); gulp.task('default', ['buildfs_inline']);

+ 7
- 14
code/html/checkboxes.css View File

@ -46,16 +46,14 @@ div.iPhoneCheckBorderOn {
left: 0; left: 0;
width: 4px; width: 4px;
height: 100%; height: 100%;
background-image: url('images/check.png');
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAbCAYAAABbcS4wAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QIRFR85CxvmEAAAAPhJREFUGNM1jjtOA1EUQ8+1PW9GgIiIkChooGITtBSwF3YAVLRIlKyGkoLFIGgSPhqF4iWlLdvHBXB2fX8KPAGXdX7zcAG8jQdHy7a/ILIep8Pj5Xh4ghxi+WpanJBxn3IjshYZD3Cb8DARy7hNpO2hjMQ2ScNDQ8PUDWXADqUgx0jeCiHblIQkVEZxUIGqkKpXqKKKbiRBJVSiUKc0G8V4MEnCOIjEONvEFJNm3Nw3yp3g2lJchQsi+g8L7N0PG6sn7F3FRVR4l0h1kZ0hbbAhtUGWv8SM2FACyXqdf1eImWJGlu/mv/XH9+qT+WdNAdy+vJ8Cz8DlP5OVH/+5ZpfdAAAAAElFTkSuQmCC');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 0px 0px;
} }
label.iPhoneCheckLabelOn { label.iPhoneCheckLabelOn {
color: white; color: white;
background-image: url('images/check.png');
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAbCAYAAABbcS4wAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QIRFSAYH6zccgAAALhJREFUGNNdkM1VBDEMgz85yrALHHg0sBRAIxRFm5TAiRLYJw4O7Ay5OZasH728vYfd8/PllQBCIPA8P4F6G8A+PyIVC4Z99wCqtQd7uweBJAh4zO0mEXCN+TcLcJU4+CgVWX8KWFUUaQ39UtJOA7gQUXNKwdODvYxPc5C97GkbRx8ukdAnJVwSVIAO6FG3YCDssWtH4FFC0PbDf0SwV1kdUE3JQkhgcqUkIlCCuX6vTtfRr8+PQ2M/SZ8sUjiJqjYAAAAASUVORK5CYII=');
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: 0px -27px;
text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6); text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6);
left: 0; left: 0;
padding-top: 5px; padding-top: 5px;
@ -69,9 +67,8 @@ label.iPhoneCheckLabelOn span {
label.iPhoneCheckLabelOff { label.iPhoneCheckLabelOff {
color: #8b8b8b; color: #8b8b8b;
background-image: url('images/check.png');
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAbCAYAAABbcS4wAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QIRFSAnqcrxTwAAAK9JREFUGNNVkEt2wzAMAwcU6ubjNhfyHXzg5mh5RheWnUhLiBiQ0Lqu4eN5WRYG4ffxAIIQAfwzz+PEPN8JoD7n+60L2iVfLtf+HZDw9D1xegDbHqGfQgA3N+CNsctERyy4teI4RoC/pgkIyR7jqkI618B2283sIEsN1DdTcKsipMcIV6sO2G2uUq9HJMFVbbylqkahVZEOhMOiQEQEDhvZ3gX49do4K1Pw8/k3QP8BlXw2dG+s/nEAAAAASUVORK5CYII=');
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: 0px -54px;
text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.6); text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.6);
text-align: right; text-align: right;
margin-right: 4px; margin-right: 4px;
@ -87,9 +84,8 @@ div.iPhoneCheckBorderOff {
position: absolute; position: absolute;
width: 4px; width: 4px;
height: 100%; height: 100%;
background-image: url('images/check.png');
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAbCAYAAABbcS4wAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QIRFSEDjNIk3wAAAQxJREFUGNNNkTtOA0EQRF939Sz+jBzg2EchJLaPgsQBnHAhx6TEPsSKNUgGIhJsdodg1sid9VNVV0lt6/X6FXgBHne7XWfb7bYcjx+8vR2+gLtYLpcsFgsmk5vbtm2fPOdMzpnVaoWk+5jnzOn0g+RIyjGfzUgKDEMSMZ1OcTeGMhARRNM0lFLo+xGklBiGgfP5XEFE0Pc9kRIRgSuEFIRUQShqpI/AvS6Sk1IimtTQDz36jfGGnPBAHqSUcEXUhuFVYeaYGYZVhcsxGeajQma4OX4BdhX7D1yO2cXijruuLOa4G2Y2VjfqFJD07YVCGQY+Po9Iera2bUvXHTgcuvqX/X7/DrxIethsNt0fBBNKg/wAUGwAAAAASUVORK5CYII=');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 0px -81px;
} }
.iPhoneCheckHandle { .iPhoneCheckHandle {
@ -100,9 +96,8 @@ div.iPhoneCheckBorderOff {
top: 0; top: 0;
left: 0; left: 0;
width: 0; width: 0;
background-image: url('images/check.png');
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAbCAYAAABbcS4wAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QIRFSEzqgsUcwAAANZJREFUGNNVkD1qw0AUhL+Z3T5gNRY+QECFTuA2t0rpNpAzbKNbpEypXq0OEAjEcRGZTbH6c7EsDDPzvvcEkFI6AW/AWSmlZ+CzaZpDXddE4NK27aGqKn6uVwy81Mcjv7cb5EyU9BRiRAASsfwqD4qAhC3yIgiQvDkkYRmAuOatx1J7dsydJaK8lPoxUsYGIC+lFI68H2uRs/foAa+lswO8oa8cC6kl0G5byZuw7rKtXwRlYeB7uk9YBd+SPsZxJISAZAy89n3/NQwD0/RXjt113Ql4B87/SLstv7YcoHkAAAAASUVORK5CYII=');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 0px -108px;
padding-left: 4px; padding-left: 4px;
} }
@ -110,9 +105,8 @@ div.iPhoneCheckBorderOff {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-image: url('images/check.png');
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAbCAYAAABbcS4wAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QIRFSILqST/LgAAAJVJREFUGNNVkcsVxSAIRO8g/ReRbUrzpYZ5CzAaN3pgPgzqui5zHM05jQEMEvl7nt0FMtRP15VS7DaQklAD8FFoABkRnKoZsQQFuEW1CN4UY0QUxWiLKgJZSAaLDEV7arnEGbYLNpbQsq3RK10NBqiduvCJP3pbNf5GcOzjXZB7UgC1dcaLaJeiqBkmxxjfb7jv+5PlD4a+KFo56aIvAAAAAElFTkSuQmCC');
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: 0px -135px;
} }
.iPhoneCheckHandleRight { .iPhoneCheckHandleRight {
@ -120,7 +114,6 @@ div.iPhoneCheckBorderOff {
height: 100%; height: 100%;
width: 4px; width: 4px;
right: 0px; right: 0px;
background-image: url('images/check.png');
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAbCAYAAABbcS4wAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QIRFSIm7PujWwAAANdJREFUGNNlkTFuhDAQRd8fU6ZKA7fgBFvmEDScIVKukJNwBNq0uQESLUIKItVW62y1mRRrDNEW1thf/z/PaNR13RfwCby1bbtoWRZf15VxHM/AyeIlUpYldV0/A+/mONefK1VVAbwUkgAIISDpKQtbLcyEu3ZBMtI9CWboELFghqR8iuMjQe0eVmYIXIjNIQOBPUYSdHPs0GDgfuxU2Q5gdmgsfys34AHKPj7Of6hLu0O6j3+7/QJczMwIITDPM5I+FGP0aZoYhuEMnIq+77/T5l6bpln+AEtTOnfJ0VScAAAAAElFTkSuQmCC');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 0px -162px;
} }

BIN
code/html/images/border-off.png View File

Before After
Width: 4  |  Height: 27  |  Size: 383 B

BIN
code/html/images/border-on.png View File

Before After
Width: 4  |  Height: 27  |  Size: 363 B

BIN
code/html/images/handle-center.png View File

Before After
Width: 4  |  Height: 27  |  Size: 264 B

BIN
code/html/images/handle-left.png View File

Before After
Width: 4  |  Height: 27  |  Size: 329 B

BIN
code/html/images/handle-right.png View File

Before After
Width: 4  |  Height: 27  |  Size: 330 B

BIN
code/html/images/label-off.png View File

Before After
Width: 4  |  Height: 27  |  Size: 290 B

BIN
code/html/images/label-on.png View File

Before After
Width: 4  |  Height: 27  |  Size: 299 B

+ 1
- 1
code/html/index.html View File

@ -4,7 +4,7 @@
<title>ESPurna 0.0.0</title> <title>ESPurna 0.0.0</title>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<!-- shortcut::html/favicon.ico -->
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- build:css style.css --> <!-- build:css style.css -->


+ 119
- 0
code/html/src/checkboxes.css View File

@ -0,0 +1,119 @@
.iPhoneCheckContainer {
-webkit-transform:translate3d(0,0,0);
position: relative;
height: 27px;
cursor: pointer;
overflow: hidden;
}
.iPhoneCheckContainer input {
position: absolute;
top: 5px;
left: 30px;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
}
.iPhoneCheckContainer label {
white-space: nowrap;
font-size: 17px;
line-height: 17px;
font-weight: bold;
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
cursor: pointer;
display: block;
height: 27px;
position: absolute;
width: auto;
top: 0;
padding-top: 5px;
overflow: hidden;
}
.iPhoneCheckContainer, .iPhoneCheckContainer label {
user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
}
.iPhoneCheckDisabled {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
opacity: 0.5;
}
div.iPhoneCheckBorderOn {
position: absolute;
left: 0;
width: 4px;
height: 100%;
background-image: url('images/border-on.png');
background-repeat: no-repeat;
}
label.iPhoneCheckLabelOn {
color: white;
background-image: url('images/label-on.png');
background-repeat: repeat-x;
text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6);
left: 0;
padding-top: 5px;
margin-left: 4px;
margin-top: 0px;
}
label.iPhoneCheckLabelOn span {
padding-left: 4px;
}
label.iPhoneCheckLabelOff {
color: #8b8b8b;
background-image: url('images/label-off.png');
background-repeat: repeat-x;
text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.6);
text-align: right;
margin-right: 4px;
margin-top: 0px;
right: 0;
}
label.iPhoneCheckLabelOff span {
padding-right: 4px;
}
div.iPhoneCheckBorderOff {
position: absolute;
width: 4px;
height: 100%;
background-image: url('images/border-off.png');
background-repeat: no-repeat;
}
.iPhoneCheckHandle {
display: block;
height: 27px;
cursor: pointer;
position: absolute;
top: 0;
left: 0;
width: 0;
background-image: url('images/handle-left.png');
background-repeat: no-repeat;
padding-left: 4px;
}
.iPhoneCheckHandleCenter {
position: absolute;
width: 100%;
height: 100%;
background-image: url('images/handle-center.png');
background-repeat: repeat-x;
}
.iPhoneCheckHandleRight {
position: absolute;
height: 100%;
width: 4px;
right: 0px;
background-image: url('images/handle-right.png');
background-repeat: no-repeat;
}

+ 2
- 0
code/package.json View File

@ -8,7 +8,9 @@
"devDependencies": { "devDependencies": {
"del": "^2.2.1", "del": "^2.2.1",
"gulp": "^3.9.1", "gulp": "^3.9.1",
"gulp-base64-favicon": "^1.0.2",
"gulp-clean-css": "^2.0.10", "gulp-clean-css": "^2.0.10",
"gulp-css-base64": "^1.3.4",
"gulp-gzip": "^1.4.0", "gulp-gzip": "^1.4.0",
"gulp-htmlmin": "^2.0.0", "gulp-htmlmin": "^2.0.0",
"gulp-if": "^2.0.1", "gulp-if": "^2.0.1",


Loading…
Cancel
Save