Skip to content

Commit

Permalink
GZIP pack SVG, add favicon
Browse files Browse the repository at this point in the history
This correctly applies GZIP compression and SVG optimizations to the pack status image, and thanks to the filesize savings (10203 bytes to 3849 bytes), added in a .ico and .svg favicon.
  • Loading branch information
nomakewan committed Oct 31, 2024
1 parent 7c143d2 commit 2984266
Show file tree
Hide file tree
Showing 10 changed files with 404 additions and 81 deletions.
3 changes: 2 additions & 1 deletion source/AttenuatorESP32/include/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const char DEVICE_page[] PROGMEM = R"=====(
<meta http-equiv="Cache-control" content="public">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Device Preferences</title>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/style.css">
</head>
<body>
Expand Down
317 changes: 244 additions & 73 deletions source/AttenuatorESP32/include/Equip.h

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion source/AttenuatorESP32/include/ExtWiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const char NETWORK_page[] PROGMEM = R"=====(
<meta http-equiv="Cache-control" content="public">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>WiFi Settings</title>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/style.css">
</head>
<body>
Expand Down
123 changes: 123 additions & 0 deletions source/AttenuatorESP32/include/Icon.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/**
* GPStar Attenuator - Ghostbusters Proton Pack & Neutrona Wand.
* Copyright (C) 2023-2024 Michael Rajotte <michael.rajotte@gpstartechnologies.com>
* & Dustin Grau <dustin.grau@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*
*/

#pragma once

// array size is 1125
const uint8_t FAVICON_ico[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x08, 0x3c, 0x86, 0x23, 0x67, 0x02, 0x00, 0x66, 0x61, 0x76, 0x69, 0x63, 0x6f,
0x6e, 0x2e, 0x69, 0x63, 0x6f, 0x00, 0xed, 0x5a, 0x31, 0x8b, 0x13, 0x41, 0x14, 0x7e, 0x21, 0x42,
0x14, 0x04, 0xaf, 0xb4, 0xd1, 0xa4, 0x11, 0xae, 0x3c, 0x1b, 0x0b, 0x11, 0xbd, 0x9f, 0x21, 0x82,
0xb0, 0xa5, 0xa5, 0xa0, 0x7d, 0xee, 0x1a, 0xcf, 0xee, 0xac, 0x45, 0xd8, 0xd6, 0xc6, 0xca, 0x1f,
0x30, 0x27, 0x16, 0x96, 0x82, 0xd9, 0xdc, 0x61, 0xe3, 0xe6, 0x7e, 0x81, 0xb9, 0x2e, 0x07, 0x21,
0xe3, 0x7b, 0x3b, 0x2b, 0x5f, 0x98, 0xb9, 0x65, 0x92, 0xcd, 0xce, 0x6d, 0x16, 0xf6, 0x83, 0x8f,
0x97, 0xd9, 0xdd, 0x79, 0xf3, 0xde, 0xcc, 0xe4, 0xed, 0xcc, 0x9b, 0x25, 0xea, 0x50, 0x97, 0xf6,
0xf6, 0x44, 0x0e, 0xe8, 0xf3, 0x03, 0xa2, 0x47, 0x44, 0x28, 0xef, 0x10, 0xfd, 0x79, 0x80, 0xf2,
0xab, 0x1b, 0x44, 0xef, 0xf8, 0x81, 0x5d, 0x79, 0x86, 0x19, 0x91, 0xb9, 0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x58, 0xbf, 0x5a, 0x4c, 0xad, 0xfd, 0x55, 0xec, 0xd0, 0x0b, 0xac,
0x4b, 0x37, 0xdf, 0xe7, 0x94, 0x5f, 0x0b, 0x6d, 0xfe, 0xee, 0xfd, 0xf5, 0x34, 0x9b, 0xc3, 0x5b,
0x06, 0xad, 0x0d, 0xe3, 0x98, 0xe8, 0x88, 0xad, 0x3b, 0x61, 0x4e, 0x98, 0x17, 0x31, 0xcb, 0x23,
0xa2, 0x83, 0xc3, 0xfc, 0xb9, 0x7e, 0xce, 0x63, 0xe6, 0x4f, 0xd4, 0xfb, 0x07, 0x90, 0xdb, 0x47,
0x4b, 0xee, 0x3a, 0x00, 0x00
};

// array size is 363
const uint8_t FAVICON_svg[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x08, 0x59, 0x23, 0x23, 0x67, 0x02, 0x00, 0x66, 0x61, 0x76, 0x69, 0x63, 0x6f,
0x6e, 0x2e, 0x73, 0x76, 0x67, 0x00, 0x45, 0x51, 0x5b, 0x6e, 0xdc, 0x30, 0x0c, 0xbc, 0x0a, 0xa1,
0x7e, 0x33, 0x16, 0x1f, 0x92, 0xec, 0x20, 0xce, 0x57, 0x3f, 0xd3, 0x43, 0x2c, 0x1c, 0xd7, 0x5e,
0x40, 0x69, 0x17, 0x6b, 0xc3, 0x6e, 0x7b, 0xfa, 0x8e, 0x16, 0x01, 0x22, 0x89, 0x02, 0xc4, 0x19,
0xce, 0x80, 0xd4, 0xcb, 0x76, 0x2c, 0xf4, 0xe7, 0xa3, 0xfe, 0xda, 0xc6, 0xb0, 0xee, 0xfb, 0xed,
0xb9, 0xeb, 0xce, 0xf3, 0x7c, 0x3a, 0xed, 0xe9, 0xf7, 0x7d, 0xe9, 0x34, 0xc6, 0xd8, 0x81, 0x11,
0x1a, 0xe5, 0x79, 0xbb, 0x5d, 0xa6, 0x79, 0x0c, 0xb7, 0xfb, 0xbc, 0xcd, 0xf7, 0x63, 0x0e, 0x74,
0x5e, 0xdf, 0xf7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a, 0x7f, 0xa1,
0xfb, 0x1a, 0xd8, 0x07, 0xe6, 0x35, 0x08, 0x99, 0x51, 0x22, 0x05, 0xe5, 0xcd, 0xa9, 0x87, 0xb2,
0x56, 0x51, 0x27, 0xb1, 0x43, 0x2b, 0xab, 0x91, 0x7c, 0x0e, 0x05, 0xde, 0x13, 0xec, 0x9d, 0xd1,
0x56, 0x62, 0x45, 0x6f, 0x15, 0x0f, 0xf0, 0xd1, 0x91, 0x91, 0x3e, 0x94, 0xbb, 0x05, 0x81, 0x3f,
0x7e, 0xfd, 0x0f, 0xea, 0xab, 0x15, 0xbc, 0x0b, 0x02, 0x00, 0x00
};
4 changes: 3 additions & 1 deletion source/AttenuatorESP32/include/Index.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ const char INDEX_page[] PROGMEM = R"=====(
<meta http-equiv="Cache-control" content="public">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-title" content="Proton Pack" />
<title>Proton Pack</title>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/style.css">
</head>
<body class="dark">
Expand Down
3 changes: 2 additions & 1 deletion source/AttenuatorESP32/include/PackSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const char PACK_SETTINGS_page[] PROGMEM = R"=====(
<meta http-equiv="Cache-control" content="public">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Proton Pack Settings</title>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/style.css">
</head>
<body>
Expand Down
3 changes: 2 additions & 1 deletion source/AttenuatorESP32/include/Password.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const char PASSWORD_page[] PROGMEM = R"=====(
<meta http-equiv="Cache-control" content="public">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>WiFi Password</title>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/style.css">
</head>
<body>
Expand Down
3 changes: 2 additions & 1 deletion source/AttenuatorESP32/include/SmokeSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const char SMOKE_SETTINGS_page[] PROGMEM = R"=====(
<meta http-equiv="Cache-control" content="public">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Smoke Settings</title>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/style.css">
</head>
<body>
Expand Down
3 changes: 2 additions & 1 deletion source/AttenuatorESP32/include/WandSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const char WAND_SETTINGS_page[] PROGMEM = R"=====(
<meta http-equiv="Cache-control" content="public">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Neutrona Wand Settings</title>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/style.css">
</head>
<body>
Expand Down
23 changes: 22 additions & 1 deletion source/AttenuatorESP32/include/Webhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "SmokeSettings.h" // SMOKE_SETTINGS_page
#include "Style.h" // STYLE_page
#include "Equip.h" // EQUIP_svg
#include "Icon.h" // FAVICON_ico, FAVICON_svg

// Forward function declarations.
void setupRouting();
Expand Down Expand Up @@ -337,7 +338,25 @@ void handleStylesheet(AsyncWebServerRequest *request) {
void handleSvgImage(AsyncWebServerRequest *request) {
// Used for the root page (/) of the web server.
debug("Sending -> Equipment SVG");
request->send(200, "image/svg+xml", String(EQUIP_svg)); // Serve page content.
AsyncWebServerResponse *response = request->beginResponse(200, "image/svg+xml", EQUIP_svg, sizeof(EQUIP_svg));
response->addHeader("Content-Encoding", "gzip");
request->send(response);
}

void handleFavIcon(AsyncWebServerRequest *request) {
// Used for the root page (/) of the web server.
debug("Sending -> Favicon");
AsyncWebServerResponse *response = request->beginResponse(200, "image/x-icon", FAVICON_ico, sizeof(FAVICON_ico));
response->addHeader("Content-Encoding", "gzip");
request->send(response);
}

void handleSvgFavIcon(AsyncWebServerRequest *request) {
// Used for the root page (/) of the web server.
debug("Sending -> Favicon");
AsyncWebServerResponse *response = request->beginResponse(200, "image/svg+xml", FAVICON_svg, sizeof(FAVICON_svg));
response->addHeader("Content-Encoding", "gzip");
request->send(response);
}

String getAttenuatorConfig() {
Expand Down Expand Up @@ -1323,6 +1342,8 @@ void setupRouting() {

// Static Pages
httpServer.on("/", HTTP_GET, handleRoot);
httpServer.on("/favicon.ico", HTTP_GET, handleFavIcon);
httpServer.on("/favicon.svg", HTTP_GET, handleSvgFavIcon);
httpServer.on("/common.js", HTTP_GET, handleCommonJS);
httpServer.on("/index.js", HTTP_GET, handleRootJS);
httpServer.on("/network", HTTP_GET, handleNetwork);
Expand Down

0 comments on commit 2984266

Please sign in to comment.