Skip to content

Commit 9327032

Browse files
DedeHaiblazoncek
authored andcommitted
"WLEDPixelForge": new image & scrolling text interface
replaces the pixel magic tool with a much more feature-rich tool for handling gif images. Also adds a scrolling text interface and the possibility to add more tools with a single button click like the classic pixel magic tool and the pixel-painter tool.
1 parent c3a019f commit 9327032

7 files changed

Lines changed: 2024 additions & 7 deletions

File tree

tools/cdata.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const packageJson = require("../package.json");
2626
// Export functions for testing
2727
module.exports = { isFileNewerThan, isAnyFileInFolderNewerThan };
2828

29-
const output = ["wled00/html_ui.h", "wled00/html_pixart.h", "wled00/html_cpal.h", "wled00/html_pxmagic.h", "wled00/html_settings.h", "wled00/html_other.h"]
29+
const output = ["wled00/html_ui.h", "wled00/html_pixart.h", "wled00/html_cpal.h", "wled00/html_pxmagic.h", "wled00/html_pixelforge.h", "wled00/html_settings.h", "wled00/html_other.h"]
3030

3131
// \x1b[34m is blue, \x1b[36m is cyan, \x1b[0m is reset
3232
const wledBanner = `
@@ -125,12 +125,13 @@ async function minify(str, type = "plain") {
125125
throw new Error("Unknown filter: " + type);
126126
}
127127

128-
async function writeHtmlGzipped(sourceFile, resultFile, page) {
128+
async function writeHtmlGzipped(sourceFile, resultFile, page, inlineCss = true) {
129129
console.info("Reading " + sourceFile);
130130
inline.html({
131131
fileContent: fs.readFileSync(sourceFile, "utf8"),
132132
relativeTo: path.dirname(sourceFile),
133-
strict: true,
133+
strict: inlineCss, // when not inlining css, ignore errors (enables linking style.css from subfolder htm files)
134+
stylesheets: inlineCss // when true (default), css is inlined
134135
},
135136
async function (error, html) {
136137
if (error) throw error;
@@ -245,6 +246,7 @@ writeHtmlGzipped("wled00/data/index.htm", "wled00/html_ui.h", 'index');
245246
writeHtmlGzipped("wled00/data/pixart/pixart.htm", "wled00/html_pixart.h", 'pixart');
246247
//writeHtmlGzipped("wled00/data/cpal/cpal.htm", "wled00/html_cpal.h", 'cpal');
247248
writeHtmlGzipped("wled00/data/pxmagic/pxmagic.htm", "wled00/html_pxmagic.h", 'pxmagic');
249+
writeHtmlGzipped("wled00/data/pixelforge/pixelforge.htm", "wled00/html_pixelforge.h", 'pixelforge', false); // do not inline css
248250

249251
writeChunks(
250252
"wled00/data/cpal",

wled00/data/index.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
</div>
128128
<div style="padding: 8px 0;" id="btns">
129129
<button class="btn btn-xs" title="File editor" type="button" id="edit" onclick="window.location.href=getURL('/edit')"><i class="icons btn-icon">&#xe2c6;</i></button>
130-
<button class="btn btn-xs" title="Pixel Magic Tool" type="button" id="pxmb" onclick="window.location.href=getURL('/pxmagic.htm')"><i class="icons btn-icon">&#xe410;</i></button>
130+
<button class="btn btn-xs" title="PixelForge" type="button" onclick="window.location.href=getURL('/pixelforge.htm')"><i class="icons btn-icon">&#xe410;</i></button>
131131
<button class="btn btn-xs" title="Add custom palette" type="button" id="adPal" onclick="window.location.href=getURL('/cpal.htm')"><i class="icons btn-icon">&#xe18a;</i></button>
132132
<button class="btn btn-xs" title="Remove last custom palette" type="button" id="rmPal" onclick="palettesData=null;localStorage.removeItem('wledPalx');requestJson({rmcpal:true});setTimeout(loadPalettes,250,loadPalettesData);"><i class="icons btn-icon">&#xe037;</i></button>
133133
</div>

wled00/data/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,6 @@ function updateUI()
12691269
gId('buttonPower').className = (isOn) ? 'active':'';
12701270
gId('buttonNl').className = (nlA) ? 'active':'';
12711271
gId('buttonSync').className = (syncSend) ? 'active':'';
1272-
gId('pxmb').style.display = (isM) ? "inline-block" : "none";
12731272

12741273
updateSelectedFx();
12751274
updateSelectedPalette(selectedPal); // must be after updateSelectedFx() to un-hide color slots for * palettes

0 commit comments

Comments
 (0)