Skip to content

Commit

Permalink
[mini] copied the favicon function = cut the size by 1kB+
Browse files Browse the repository at this point in the history
  • Loading branch information
Grovkillen committed Mar 7, 2020
1 parent 1fcde37 commit 727057f
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/0.1.nightly.5/info/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gui-easy",
"timestamp": 1583570480036,
"timestamp": 1583578088039,
"version": "0.1.5",
"versionName": "0.1.nightly.5",
"author": "Jimmy 'Grovkillen' Westberg <jimmy@grovkillen.com> (https://grovkillen.com)",
Expand Down
4 changes: 2 additions & 2 deletions build/0.1.nightly.5/info/release.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
timestamp:1583570480036
timestamp:1583578088039
major:0
minor:1
revision:5
rc:0
dev:true
files:[{"build":"main","size":77102},{"build":"noDash","size":66062},{"build":"mini","size":6218}]
files:[{"build":"main","size":77102},{"build":"noDash","size":66062},{"build":"mini","size":4339}]
2 changes: 1 addition & 1 deletion build/0.1.nightly.5/info/source_files.json

Large diffs are not rendered by default.

Binary file modified build/0.1.nightly.5/mini/index.htm.gz
Binary file not shown.
Binary file modified build/0.1.nightly.5/src-0.1.nightly.5.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gui-easy",
"timestamp": 1583570480036,
"timestamp": 1583578088039,
"version": "0.1.5",
"versionName": "0.1.nightly.5",
"author": "Jimmy 'Grovkillen' Westberg <jimmy@grovkillen.com> (https://grovkillen.com)",
Expand Down
1 change: 0 additions & 1 deletion src/index-minimal.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<meta charset="utf-8">
<meta name="theme-color" content="#000000">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link id="favicon" rel="shortcut icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYA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TgIsV3EO9KUBPBQB9O3Mgr45WDaBqgF8pwPsKAD6kAMuZzX8Kn1KAl5kBXhWT8AcWMgJMNyrCqUzmb4U3OwHCEp5nAHi41zEcq3cuh3kVrzRryc7jHY6XbD4r3G0eRGEVQ/haovlMI/PdkzAsY6DeUrej3xgX7rX+Mgp3MFFvKg+iF4i/gdPu06yG67iNQZzYZeYq5vFM+Fz+43QbqBunCqMfhS3/m/4AdNBPLAboKPcAAAAASUVORK5CYII=">
<title>ESP Easy</title>
<!-- build:css inline ../build/temp/mini.min.css -->
<link rel="stylesheet" href="index-minimal.css">
Expand Down
72 changes: 72 additions & 0 deletions src/index-minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ obj.color = "dark";
obj.tab = "frontend";
let fe, be, r, rc, n, t, d, f, m, upload, b, a, p, v, w, buttons, toggle;
ini = function () {
favicon();
let ok = start(obj.tab);
dragDropEvent();
};
Expand Down Expand Up @@ -429,4 +430,75 @@ update = async function (file) {
console.warn('Error uploading (' + obj[type].fileName + '): ' + error, 0, "error");
});
}
};
favicon = function () {
let canvas = document.createElement('canvas');
let iconSide = 113;
let iconRadius = 15;
canvas.width = iconSide;
canvas.height = iconSide;
let ctx = canvas.getContext('2d');
ctx.lineWidth = 8;
ctx.fillStyle = "blue";
ctx.beginPath();
ctx.moveTo(0,iconRadius);
ctx.lineTo(0,iconSide-iconRadius);
ctx.arc(iconRadius,iconSide-iconRadius, iconRadius, Math.PI, 0.5 * Math.PI, true);
ctx.lineTo(iconRadius,iconSide);
ctx.lineTo(iconSide-iconRadius,iconSide);
ctx.arc(iconSide-iconRadius,iconSide-iconRadius, iconRadius, Math.PI, 1.5 * Math.PI, true);
ctx.lineTo(iconSide,iconSide-iconRadius);
ctx.lineTo(iconSide,iconRadius);
ctx.arc(iconSide-iconRadius,iconRadius, iconRadius, 0, 1.5 * Math.PI, true);
ctx.lineTo(iconSide-iconRadius,0);
ctx.lineTo(iconRadius,0);
ctx.arc(iconRadius,iconRadius, iconRadius, 0, 0.5 * Math.PI, true);
ctx.lineTo(0,iconRadius);
ctx.closePath();
ctx.fill();
//The dot
ctx.fillStyle = "white";
ctx.beginPath();
ctx.arc(90, 90, 10, 0, 2 * Math.PI);
ctx.closePath();
ctx.fill();
//The warning line
ctx.lineCap = "round";
ctx.strokeStyle = "white";
ctx.beginPath();
ctx.moveTo(42,99);
ctx.lineTo(99,42);
ctx.closePath();
ctx.stroke();
//The info line
ctx.strokeStyle = "white";
ctx.beginPath();
ctx.moveTo(14,99);
ctx.lineTo(99,14);
ctx.closePath();
ctx.stroke();
//The sunny line
ctx.strokeStyle = "white";
ctx.beginPath();
ctx.moveTo(14,70);
ctx.lineTo(70,14);
ctx.closePath();
ctx.stroke();
//The success line
ctx.strokeStyle = "white";
ctx.beginPath();
ctx.moveTo(14,42);
ctx.lineTo(42,14);
ctx.closePath();
ctx.stroke();
let favicon = document.getElementById("favicon");
if (favicon !== null) {
favicon.remove();
}
favicon = document.createElement('link');
favicon.id = "favicon";
favicon.type = 'image/x-icon';
favicon.rel = 'shortcut icon';
favicon.href = canvas.toDataURL("image/x-icon");
document.head.appendChild(favicon);
};

0 comments on commit 727057f

Please sign in to comment.