Skip to content

Commit c35140e

Browse files
authored
"WLEDPixelForge": new image & scrolling text interface (#4982)
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 6388b8f commit c35140e

9 files changed

Lines changed: 2017 additions & 16 deletions

File tree

tools/cdata.js

Lines changed: 5 additions & 4 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_edit.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_edit.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 = `
@@ -134,12 +134,13 @@ async function minify(str, type = "plain") {
134134
throw new Error("Unknown filter: " + type);
135135
}
136136

137-
async function writeHtmlGzipped(sourceFile, resultFile, page) {
137+
async function writeHtmlGzipped(sourceFile, resultFile, page, inlineCss = true) {
138138
console.info("Reading " + sourceFile);
139139
inline.html({
140140
fileContent: fs.readFileSync(sourceFile, "utf8"),
141141
relativeTo: path.dirname(sourceFile),
142-
strict: true,
142+
strict: inlineCss, // when not inlining css, ignore errors (enables linking style.css from subfolder htm files)
143+
stylesheets: inlineCss // when true (default), css is inlined
143144
},
144145
async function (error, html) {
145146
if (error) throw error;
@@ -252,8 +253,8 @@ if (isAlreadyBuilt("wled00/data") && process.argv[2] !== '--force' && process.ar
252253

253254
writeHtmlGzipped("wled00/data/index.htm", "wled00/html_ui.h", 'index');
254255
writeHtmlGzipped("wled00/data/pixart/pixart.htm", "wled00/html_pixart.h", 'pixart');
255-
//writeHtmlGzipped("wled00/data/cpal/cpal.htm", "wled00/html_cpal.h", 'cpal');
256256
writeHtmlGzipped("wled00/data/pxmagic/pxmagic.htm", "wled00/html_pxmagic.h", 'pxmagic');
257+
writeHtmlGzipped("wled00/data/pixelforge/pixelforge.htm", "wled00/html_pixelforge.h", 'pixelforge', false); // do not inline css
257258
//writeHtmlGzipped("wled00/data/edit.htm", "wled00/html_edit.h", 'edit');
258259

259260

wled00/data/index.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
</div>
129129
<div style="padding: 8px 0;" id="btns">
130130
<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>
131-
<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>
131+
<button class="btn btn-xs" title="PixelForge" type="button" onclick="window.location.href=getURL('/pixelforge.htm')"><i class="icons btn-icon">&#xe410;</i></button>
132132
<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>
133133
<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>
134134
</div>

wled00/data/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,6 @@ function updateUI()
12761276
gId('buttonPower').className = (isOn) ? 'active':'';
12771277
gId('buttonNl').className = (nlA) ? 'active':'';
12781278
gId('buttonSync').className = (syncSend) ? 'active':'';
1279-
gId('pxmb').style.display = (isM) ? "inline-block" : "none";
12801279

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

0 commit comments

Comments
 (0)