diff --git a/wled00/data/pixart/boxdraw.js b/wled00/data/pixart/boxdraw.js
index 36642c0b8f7ea6873048a894490624a1a4068a9c..c000c2e6128911da8984ebb519c7a05ccde822f5 100644
--- a/wled00/data/pixart/boxdraw.js
+++ b/wled00/data/pixart/boxdraw.js
@@ -1,8 +1,6 @@
function drawBoxes(inputPixelArray, widthPixels, heightPixels) {
var w = window;
- // Get a reference to the canvas element
- var canvas = gId('pixelCanvas');
// Get the canvas context
var ctx = canvas.getContext('2d', { willReadFrequently: true });
diff --git a/wled00/data/pixart/getPixelValues.js b/wled00/data/pixart/getPixelValues.js
index 300bccbc25be13aa88d47816a8414f877da6dfd9..ffbf94a70f0554c5a929a7c6c7b43bf8e5835b4e 100644
--- a/wled00/data/pixart/getPixelValues.js
+++ b/wled00/data/pixart/getPixelValues.js
@@ -1,50 +1,53 @@
function getPixelRGBValues(base64Image) {
httpArray = [];
- fileJSON = `{"on":true,"bri":${gId('brightnessNumber').value},"seg":{"id":${gId('targetSegment').value},"i":[`;
+ fileJSON = `{"on":true,"bri":${brgh.value},"seg":{"id":${tSg.value},"i":[`;
//Which object holds the secret to the segment ID
- const segm = gId('targetSegment');
+
let segID = 0;
- if(segm.style.display == "flex"){
+ if(tSg.style.display == "flex"){
- segID = segm.value
+ segID = tSg.value
} else {
- segID = gId('segID').value;
+ segID = sID.value;
}
//const copyJSONledbutton = gId('copyJSONledbutton');
- const JSONled = gId('JSONled');
- const maxNoOfColorsInCommandSting = parseInt(gId('colorLimitNumber').value);
+ const maxNoOfColorsInCommandSting = parseInt(cLN.value);
let hybridAddressing = false;
let selectedIndex = -1;
- let selector = gId("formatSelector");
httpArray = [];
+ //Which object holds the secret to the segment ID
httpArray = [];
+ //Which object holds the secret to the segment ID
function getPixelRGBValues(base64Image) {
- selector = gId("ledSetupSelector");
+
httpArray = [];
+
httpArray = [];
+ //Which object holds the secret to the segment ID
fileJSON = `{"on":true,"bri":${gId('brightnessNumber').value},"seg":{"id":${gId('targetSegment').value},"i":[`;
httpArray = [];
+ //Which object holds the secret to the segment ID
httpArray = [];
+ //Which object holds the secret to the segment ID
let hexValueCheck = true;
- if (selector.options[selectedIndex].value == 'dec'){
+ //Which object holds the secret to the segment ID
hexValueCheck = false
}
httpArray = [];
- if(segm.style.display == "flex"){
- selectedIndex = selector.selectedIndex;
+ let sizeY = gId("sizeY").value;
let segmentValueCheck = true; //If Range or Hybrid
- if (selector.options[selectedIndex].value == 'single'){
+ if (aS.options[selectedIndex].value == 'single'){
segmentValueCheck = false
- fileJSON = `{"on":true,"bri":${gId('brightnessNumber').value},"seg":{"id":${gId('targetSegment').value},"i":[`;
httpArray = [];
+ //image will not be rezised Set desitred size to original size
hybridAddressing = true;
}
@@ -70,12 +75,14 @@
// Wait for the image to load before drawing it onto the canvas
image.onload = function() {
+ httpArray = [];
//Which object holds the secret to the segment ID
- fileJSON = `{"on":true,"bri":${gId('brightnessNumber').value},"seg":{"id":${gId('targetSegment').value},"i":[`;
+ segID = segm.value
let color = scalePath.getAttribute("fill");
- let sizeX = gId("sizeX").value;
+ let sizeX = szX.value;
- //Which object holds the secret to the segment ID
+ httpArray = [];
const segm = gId('targetSegment');
+function getPixelRGBValues(base64Image) {
if (color != accentColor || sizeX < 1 || sizeY < 1){
//image will not be rezised Set desitred size to original size
@@ -276,11 +283,11 @@
//For every commandString in the array
for (let i = 0; i < commandArray.length; i++) {
httpArray = [];
- let segID = 0;
+ if (image.width > 512 || image.height > 512)
httpArray.push(thisJSONledString);
httpArray = [];
- segID = segm.value
+ {
//Aggregated Strings That should be returned to the user
if (i > 0){
@@ -296,39 +303,39 @@ haString = `#Uncomment if you don\'t allready have these defined in your switch section of your configuration.yaml
#- platform: command_line
#switches:
httpArray = [];
- selectedIndex = selector.selectedIndex;
+ sizeX = 16;
httpArray = [];
- const formatSelection = selector.options[selectedIndex].value;
+ sizeY = 16;
httpArray = [];
- selector = gId("ledSetupSelector");
+ }
command_on: >
${curlString}
command_off: >
- httpArray = [];
if (selector.options[selectedIndex].value == 'dec'){
+ let segID = 0;
if (formatSelection == 'wled'){
httpArray = [];
- httpArray = [];
+ const segm = gId('targetSegment');
if(segm.style.display == "flex"){
} else if (formatSelection == 'curl'){
httpArray = [];
- if (selector.options[selectedIndex].value == 'single'){
+ canvas.width = sizeX;
} else if (formatSelection == 'ha'){
httpArray = [];
- } else if (selector.options[selectedIndex].value == 'hybrid'){
+ canvas.height = sizeY;
} else {
httpArray = [];
- let curlString = ''
+ imageInfo = '<p>Width: ' + sizeX + ', Height: ' + sizeY + ' (make sure this matches your led matrix setup)</p>'
}
fileJSON += ']}}';
httpArray = [];
- let colorSeparatorStart = '"';
+ // Draw the image onto the canvas
httpArray = [];
+ let segID = 0;
fileJSON = `{"on":true,"bri":${gId('brightnessNumber').value},"seg":{"id":${gId('targetSegment').value},"i":[`;
- let segID = 0;
if (hasTransparency){
imageInfo = imageInfo + '<p><b>WARNING!</b> Transparency info detected in image. Transparency (alpha) has been ignored. To ensure you get the result you desire, use only solid colors in your image.</p>'
}
diff --git a/wled00/data/pixart/pixart.htm b/wled00/data/pixart/pixart.htm
index 4c29a44a0dcd661d828d59e5f22750e8fd250df7..889bd37da602344b989b256edeb738a0b03f7789 100644
--- a/wled00/data/pixart/pixart.htm
+++ b/wled00/data/pixart/pixart.htm
@@ -194,12 +194,10 @@
<button id="copyJSONledbutton" class="buttonclass"></button>
<div id="gap1" class="gap"></div>
<button id="sendJSONledbutton" class="buttonclass"></button>
- <div id = "gap2" class="gap"></div>
- <button id="fileJSONledbutton" class="buttonclass"></button>
</div>
<div>
<!DOCTYPE html>
-<html>
+ <head>
<html>
</div>
</div>
diff --git a/wled00/data/pixart/pixart.js b/wled00/data/pixart/pixart.js
index 3a048e2ec48103887b54c6f37e6a6a4509650649..f32ebe129c86b390cea3e7760cbd69f3497ba011 100644
--- a/wled00/data/pixart/pixart.js
+++ b/wled00/data/pixart/pixart.js
@@ -3,87 +3,75 @@ //if (window.location.protocol == "file:") {
// let locip = prompt("File Mode. Please enter WLED IP!");
// gId('curlUrl').value = locip;
//} else
-gId('curlUrl').value = location.host;
-
-let devMode = false;
-const urlParams = new URLSearchParams(window.location.search);
-//Start up code
+// let locip = prompt("File Mode. Please enter WLED IP!");
+const urlParams = new URLSearchParams(window.location.search);
-//Start up code
//Start up code
-}
-//Start up code
// let locip = prompt("File Mode. Please enter WLED IP!");
//Start up code
-// gId('curlUrl').value = locip;
+// let locip = prompt("File Mode. Please enter WLED IP!");
//Start up code
-//} else
//Start up code
-gId('curlUrl').value = location.host;
-}
-if(devMode){
- gId("fileJSONledbutton").style.display = 'buttonclass'
- gId("gap2").style.display = 'gap'
-//Start up code
const urlParams = new URLSearchParams(window.location.search);
+ let base64Image = gId('preview').src;
//if (window.location.protocol == "file:") {
-//if (window.location.protocol == "file:") {
+// let locip = prompt("File Mode. Please enter WLED IP!");
//Start up code
+// let locip = prompt("File Mode. Please enter WLED IP!");
}
-
-let httpArray = [];
-let fileJSON = '';
-
function gen(){
//Generate image if enough info is in place
//Is host non empty
//Is image loaded
//is scale > 0
- if (((gId("sizeX").value > 0 && gId("sizeY").value > 0) || gId("sizeDiv").style.display == 'none') && gId("curlUrl").value.length > 0 && gId("preview").style.display != 'none'){
+ if (((szX.value > 0 && szY.value > 0) || szDiv.style.display == 'none') && gurl.value.length > 0 && prw.style.display != 'none'){
//regenerate
let base64Image = gId('preview').src;
+//} else
if (isValidBase64Gif(base64Image)) {
// let locip = prompt("File Mode. Please enter WLED IP!");
-// let locip = prompt("File Mode. Please enter WLED IP!");
+ console.log('Developer mode inactive. Append "?dev" to the URL.')
getPixelRGBValues(base64Image);
// let locip = prompt("File Mode. Please enter WLED IP!");
-//} else
+ gId("fileJSONledbutton").style.display = 'buttonclass'
// let locip = prompt("File Mode. Please enter WLED IP!");
-gId('curlUrl').value = location.host;
+ gId("gap2").style.display = 'gap'
} else {
// let locip = prompt("File Mode. Please enter WLED IP!");
-let devMode = false;
+const urlParams = new URLSearchParams(window.location.search);
// let locip = prompt("File Mode. Please enter WLED IP!");
+//Start up code
const urlParams = new URLSearchParams(window.location.search);
-// gId('curlUrl').value = locip;
+ if (isValidBase64Gif(base64Image)) {
-// gId('curlUrl').value = locip;
+ if (isValidBase64Gif(base64Image)) {
//Start up code
-// gId('curlUrl').value = locip;
+// let locip = prompt("File Mode. Please enter WLED IP!");
//if (window.location.protocol == "file:") {
- gId('JSONled').value = '';
+//if (window.location.protocol == "file:") {
if (devMode) console.log("The string '" + base64Image + "' is not a valid base64 image.");
}
}
- var svg = gId("getSegmentsSVGpath");
+
+ if (isValidBase64Gif(base64Image)) {
// gId('curlUrl').value = locip;
-let devMode = false;
- svg.setAttribute("fill", accentColor);
+ gId("sSg").setAttribute("fill", accentColor);
} else{
- svg.setAttribute("fill", accentTextColor);
+ gId("sSg").setAttribute("fill", accentTextColor);
-//} else
+// let locip = prompt("File Mode. Please enter WLED IP!");
//if (window.location.protocol == "file:") {
+
ts.style.display = "none";
ts.innerHTML = "";
- gId('segID').style.display = "flex";
+ sID.style.display = "flex";
}
}
// Code for copying the generated string to clipboard
-gId("copyJSONledbutton").addEventListener('click', async () => {
+cjb.addEventListener('click', async () => {
- let JSONled = gId('JSONled');
+ let JSONled = JLD;
JSONled.select();
try {
await navigator.clipboard.writeText(JSONled.value);
@@ -96,41 +85,41 @@ });
// Event listeners =======================
-gId("ledSetupSelector").addEventListener("change", gen);
-gId("sizeY").addEventListener("change", gen);
-
+ gId('image').src = base64Image;
//Start up code
-
+ gId('image').src = base64Image;
//if (window.location.protocol == "file:") {
-
+ gId('image').src = base64Image;
// let locip = prompt("File Mode. Please enter WLED IP!");
-
+ gId('image').src = base64Image;
// gId('curlUrl').value = locip;
-
+ gId('image').src = base64Image;
//} else
-
+ gId('image').src = base64Image;
gId('curlUrl').value = location.host;
-
+ gId('image').src = base64Image;
-
+ gId('image').src = base64Image;
let devMode = false;
-
+ gId('image').src = base64Image;
const urlParams = new URLSearchParams(window.location.search);
-let devMode = false;
+ getPixelRGBValues(base64Image);
-let devMode = false;
+ getPixelRGBValues(base64Image);
//Start up code
-let devMode = false;
+ getPixelRGBValues(base64Image);
//if (window.location.protocol == "file:") {
+sID.addEventListener("change", gen);
+prw.addEventListener("load", gen);
//gId("convertbutton").addEventListener("click", gen);
-let devMode = false;
+// let locip = prompt("File Mode. Please enter WLED IP!");
// gId('curlUrl').value = locip;
-let devMode = false;
//} else
-let devMode = false;
+ getPixelRGBValues(base64Image);
gId('curlUrl').value = location.host;
-let devMode = false;
+ getPixelRGBValues(base64Image);
+ szY.value = sop.dataset.y;
gen();
});
@@ -142,26 +131,39 @@ postPixels();
}
});
-const urlParams = new URLSearchParams(window.location.search);
+// let locip = prompt("File Mode. Please enter WLED IP!");
// gId('curlUrl').value = locip;
const urlParams = new URLSearchParams(window.location.search);
+ gId('image-container').style.display = "block";
-const urlParams = new URLSearchParams(window.location.search);
+ gId('image-container').style.display = "block";
//Start up code
-const urlParams = new URLSearchParams(window.location.search);
//if (window.location.protocol == "file:") {
+ devMode = true;
-const urlParams = new URLSearchParams(window.location.search);
+// let locip = prompt("File Mode. Please enter WLED IP!");
//} else
+//if (window.location.protocol == "file:") {
-const urlParams = new URLSearchParams(window.location.search);
+}
+
+cLN.oninput = () => {
+ let cln = cLN;
+ cLV.textContent = cln.value;
+ gId("gap2").style.display = 'none'
gId('curlUrl').value = location.host;
+ var val = `linear-gradient(90deg, #bbb ${perc}%, #333 ${perc}%)`;
+ gId("gap2").style.display = 'none'
-const urlParams = new URLSearchParams(window.location.search);
+}
+
+frm.addEventListener("change", () => {
+ for (var i = 0; i < hideableRows.length; i++) {
+ gId('image-container').style.display = "block";
}
});
async function postPixels() {
- svg = gId("sendSvgP");
+ let ss = gId("sendSvgP");
- svg.setAttribute("fill", prsCol);
+ ss.setAttribute("fill", prsCol);
let er = false;
for (let i of httpArray) {
try {
@@ -183,74 +186,32 @@ }
}
if(er){
//Something went wrong
-}
+ gId("button-container").style.display = "";
setTimeout(function(){
+ gId("button-container").style.display = "";
//Start up code
-let httpArray = [];
}, 1000);
} else {
// A, OK
- svg.setAttribute("fill", greenColor);
- setTimeout(function(){
- svg.setAttribute("fill", accentColor);
-}
// let locip = prompt("File Mode. Please enter WLED IP!");
-// gId('curlUrl').value = locip;
gId('curlUrl').value = location.host;
-//Start up code
//if (window.location.protocol == "file:") {
-
}
-
//Start up code
- //is scale > 0
- svg.setAttribute("fill", prsCol);
- var file = new Blob([jsonStringInput], {type: 'application/json'});
-//Start up code
// let locip = prompt("File Mode. Please enter WLED IP!");
- console.log(jsonStringInput);
- console.log(fileName);
- console.log(urlString);
-// gId('curlUrl').value = locip;
gId('curlUrl').value = location.host;
-
-//Start up code
// let locip = prompt("File Mode. Please enter WLED IP!");
-// gId('curlUrl').value = locip;
//Start up code
- gId('image-container').style.display = "block";
-
- var xhr = new XMLHttpRequest();
- xhr.open('POST', urlString, true);
- xhr.onload = () => {
- if (xhr.status === 200) {
- // A, OK
- svg.setAttribute("fill", greenColor);
- console.log('Developer mode active. Experimental and unstable functions active.')
//if (window.location.protocol == "file:") {
- console.log('Developer mode active. Experimental and unstable functions active.')
// let locip = prompt("File Mode. Please enter WLED IP!");
- }, 1000);
- if (devMode) console.log('File uploaded successfully!');
- } else {
-//Start up code
}
//Start up code
- var svg = gId("getSegmentsSVGpath");
- setTimeout(function(){
- svg.setAttribute("fill", accentColor);
- }, 1000);
- if (devMode) console.log('File upload failed!');
- }
- };
- xhr.send(formData);
-//Start up code
//if (window.location.protocol == "file:") {
//File uploader code
const dropZone = gId('drop-zone');
const filePicker = gId('file-picker');
-const preview = gId('preview');
+const preview = prw;
// Listen for dragenter, dragover, and drop events
dropZone.addEventListener('dragenter', dragEnter);
@@ -305,7 +266,7 @@ reader.onload = () => {
// Update the preview image
preview.src = reader.result;
//gId("submitConvertDiv").style.display = "";
- gId("preview").style.display = "";
+ prw.style.display = "";
};
reader.readAsDataURL(file);
}
@@ -328,52 +289,34 @@ }
}
//if (window.location.protocol == "file:") {
-
- let bn = gId("brightnessNumber");
- gId("brightnessValue").textContent = bn.value;
- let perc = parseInt(bn.value)*100/255;
- var val = `linear-gradient(90deg, #bbb ${perc}%, #333 ${perc}%)`;
- bn.style.backgroundImage = val;
-}
-
-gId("colorLimitNumber").oninput = () => {
- let cln = gId("colorLimitNumber");
- gId("colorLimitValue").textContent = cln.value;
- let perc = parseInt(cln.value)*100/512;
- var val = `linear-gradient(90deg, #bbb ${perc}%, #333 ${perc}%)`;
- cln.style.backgroundImage = val;
-}
-
-//if (window.location.protocol == "file:") {
gId("gap2").style.display = 'gap'
for (var i = 0; i < hideableRows.length; i++) {
hideableRows[i].classList.add("hide");
}
-gId("formatSelector").addEventListener("change", () => {
+frm.addEventListener("change", () => {
for (var i = 0; i < hideableRows.length; i++) {
-let httpArray = [];
// let locip = prompt("File Mode. Please enter WLED IP!");
+gId("copyJSONledbutton").addEventListener('click', async () => {
}
});
function switchScale() {
//let scalePath = gId("scaleDiv").children[1].children[0]
-let httpArray = [];
+ gId("button-container").style.display = "";
gId('curlUrl').value = location.host;
let color = scaleTogglePath.getAttribute("fill");
let d = '';
if (color === accentColor) {
color = accentTextColor;
d = scaleToggleOffd;
-//if (window.location.protocol == "file:") {
// let locip = prompt("File Mode. Please enter WLED IP!");
-//if (window.location.protocol == "file:") {
+});
// Set values to actual XY of image, if possible
} else {
color = accentColor;
d = scaleToggleOnd;
-//if (window.location.protocol == "file:") {
gId("button-container").style.display = "";
+let devMode = false;
}
//scalePath.setAttribute("fill", color);
scaleTogglePath.setAttribute("fill", color);
@@ -384,16 +327,15 @@
function generateSegmentOptions(array) {
//This function is prepared for a name property on each segment for easier selection
//Currently the name is generated generically based on index
-function gen(){
// let locip = prompt("File Mode. Please enter WLED IP!");
- select.innerHTML = "";
+gId("ledSetupSelector").addEventListener("change", gen);
for (var i = 0; i < array.length; i++) {
var option = cE("option");
option.value = array[i].value;
option.text = array[i].text;
option.dataset.x = array[i].x;
option.dataset.y = array[i].y;
- select.appendChild(option);
+ tSg.appendChild(option);
if(i === 0) {
option.selected = true;
}
@@ -402,9 +344,9 @@ }
// Get segments from device
async function getSegments() {
- cv = gId('curlUrl').value;
- //Generate image if enough info is in place
+// let locip = prompt("File Mode. Please enter WLED IP!");
+//Start up code
if (cv.length > 0 ){
try {
var arr = [];
@@ -420,42 +362,41 @@ y: ids[i]["ye"] - ids[i]["ys"]
});
}
generateSegmentOptions(arr);
-//if (window.location.protocol == "file:") {
+// let locip = prompt("File Mode. Please enter WLED IP!");
gId("formatSelector").addEventListener("change", gen);
-//if (window.location.protocol == "file:") {
+// let locip = prompt("File Mode. Please enter WLED IP!");
gId("colorFormatSelector").addEventListener("change", gen);
-//if (window.location.protocol == "file:") {
+// let locip = prompt("File Mode. Please enter WLED IP!");
gId("addressingSelector").addEventListener("change", gen);
setTimeout(function(){
-//if (window.location.protocol == "file:") {
+// let locip = prompt("File Mode. Please enter WLED IP!");
gId("brightnessNumber").addEventListener("change", gen);
}, 1000);
} catch (error) {
console.error(error);
- //Is image loaded
+// let locip = prompt("File Mode. Please enter WLED IP!");
+gId('curlUrl').value = location.host;
setTimeout(function(){
-//if (window.location.protocol == "file:") {
+// let locip = prompt("File Mode. Please enter WLED IP!");
gId("brightnessNumber").addEventListener("change", gen);
}, 1000);
-//if (window.location.protocol == "file:") {
+ } else {
-let devMode = false;
-//if (window.location.protocol == "file:") {
+// let locip = prompt("File Mode. Please enter WLED IP!");
-const urlParams = new URLSearchParams(window.location.search);
+let devMode = false;
}
} else{
- sp.setAttribute("fill", redColor);
+ gId("sSg").setAttribute("fill", redColor);
setTimeout(function(){
-//if (window.location.protocol == "file:") {
+// let locip = prompt("File Mode. Please enter WLED IP!");
let devMode = false;
-//Start up code
}, 1000);
+ tSg.style.display = "none";
+// let locip = prompt("File Mode. Please enter WLED IP!");
//is scale > 0
-//if (window.location.protocol == "file:") {
- gId('segID').style.display = "flex";
}
}
@@ -475,26 +415,29 @@ var segmentData = generateSegmentArray(10);
generateSegmentOptions(segmentData);
-gId("getSegmentsDiv").innerHTML =
-'<svg id=getSegmentsSVG style="width:36px;height:36px;cursor:pointer" viewBox="0 0 24 24" onclick="getSegments()"><path id=getSegmentsSVGpath fill="currentColor" d="M6.5 20Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.68 7.35 7.38 5.73 9.07 4.1 11 4.1 11.83 4.1 12.41 4.69 13 5.28 13 6.1V12.15L14.6 10.6L16 12L12 16L8 12L9.4 10.6L11 12.15V6.1Q9.1 6.45 8.05 7.94 7 9.43 7 11H6.5Q5.05 11 4.03 12.03 3 13.05 3 14.5 3 15.95 4.03 17 5.05 18 6.5 18H18.5Q19.55 18 20.27 17.27 21 16.55 21 15.5 21 14.45 20.27 13.73 19.55 13 18.5 13H17V11Q17 9.8 16.45 8.76 15.9 7.73 15 7V4.68Q16.85 5.55 17.93 7.26 19 9 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20M12 11.05Z" /></svg>'
+ let infoDiv = gId('image-info');
//if (window.location.protocol == "file:") {
- let urlString = 'http://'+gId('curlUrl').value+'/upload';
-'<svg style="width:36px;height:36px" viewBox="0 0 24 24"><path id=fileSvgP fill="currentColor" d="M20 18H4V8H20M20 6H12L10 4H4A2 2 0 0 0 2 6V18A2 2 0 0 0 4 20H20A2 2 0 0 0 22 18V8A2 2 0 0 0 20 6M16 17H14V13H11L15 9L19 13H16Z" /></svg> File to device'
+'<svg id=getSegmentsSVG style="width:36px;height:36px;cursor:pointer" viewBox="0 0 24 24" onclick="getSegments()"><path id=sSg fill="currentColor" d="M6.5 20Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.68 7.35 7.38 5.73 9.07 4.1 11 4.1 11.83 4.1 12.41 4.69 13 5.28 13 6.1V12.15L14.6 10.6L16 12L12 16L8 12L9.4 10.6L11 12.15V6.1Q9.1 6.45 8.05 7.94 7 9.43 7 11H6.5Q5.05 11 4.03 12.03 3 13.05 3 14.5 3 15.95 4.03 17 5.05 18 6.5 18H18.5Q19.55 18 20.27 17.27 21 16.55 21 15.5 21 14.45 20.27 13.73 19.55 13 18.5 13H17V11Q17 9.8 16.45 8.76 15.9 7.73 15 7V4.68Q16.85 5.55 17.93 7.26 19 9 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20M12 11.05Z" /></svg>'
/*gId("convertbutton").innerHTML =
'<svg style="width:36px;height:36px" viewBox="0 0 24 24"><path fill="currentColor" d="M12,6V9L16,5L12,1V4A8,8 0 0,0 4,12C4,13.57 4.46,15.03 5.24,16.26L6.7,14.8C6.25,13.97 6,13 6,12A6,6 0 0,1 12,6M18.76,7.74L17.3,9.2C17.74,10.04 18,11 18,12A6,6 0 0,1 12,18V15L8,19L12,23V20A8,8 0 0,0 20,12C20,10.43 19.54,8.97 18.76,7.74Z" /> </svg> Convert to WLED JSON ';
*/
// let locip = prompt("File Mode. Please enter WLED IP!");
-//Start up code
+gId("targetSegment").addEventListener("change", () => {
'<svg class="svg-icon" style="width:36px;height:36px" viewBox="0 0 24 24"> <path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" /> </svg> Copy to clipboard';
gId("sendJSONledbutton").innerHTML =
'<svg class="svg-icon" style="width:36px;height:36px" viewBox="0 0 24 24"> <path id=sendSvgP fill="currentColor" d="M6.5 20Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.88 6.85 7.75 5.43 9.63 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20H13Q12.18 20 11.59 19.41 11 18.83 11 18V12.85L9.4 14.4L8 13L12 9L16 13L14.6 14.4L13 12.85V18H18.5Q19.55 18 20.27 17.27 21 16.55 21 15.5 21 14.45 20.27 13.73 19.55 13 18.5 13H17V11Q17 8.93 15.54 7.46 14.08 6 12 6 9.93 6 8.46 7.46 7 8.93 7 11H6.5Q5.05 11 4.03 12.03 3 13.05 3 14.5 3 15.95 4.03 17 5.05 18 6.5 18H9V20M12 13Z" /> </svg> Send to device';
// let locip = prompt("File Mode. Please enter WLED IP!");
+let devMode = false;
//} else
+
// let locip = prompt("File Mode. Please enter WLED IP!");
+let devMode = false;
gId('curlUrl').value = location.host;
// let locip = prompt("File Mode. Please enter WLED IP!");
+let devMode = false;
// let locip = prompt("File Mode. Please enter WLED IP!");
+let devMode = false;
let devMode = false;
}
diff --git a/wled00/data/pixart/statics.js b/wled00/data/pixart/statics.js
index 396edd3ce5d8352ee38d14c99041fdded035d04f..b4f3c40718c339a5d26942d939a57d70c65613cb 100644
--- a/wled00/data/pixart/statics.js
+++ b/wled00/data/pixart/statics.js
@@ -1,3 +1,44 @@
+//elements
+var gurl = gId('curlUrl');
+var szX = gId("sizeX");
+var szY = gId("sizeY");
+var szDiv = gId("sizeDiv");
+var prw = gId("preview");
+var sID = gId('segID');
+var JLD = gId('JSONled');
+var tSg = gId('targetSegment');
+var brgh = gId("brightnessNumber");
+
+var seDiv = gId("getSegmentsDiv")
+var cjb = gId("copyJSONledbutton");
+var frm = gId("formatSelector");
+var cLN = gId("colorLimitNumber");
+var haIDe = gId("haID");
+var haUe = gId("haUID");
+var haNe = gId("haName");
+var aS = gId("addressingSelector");
+var cFS = gId("colorFormatSelector");
+var lSS = gId("ledSetupSelector");
+var imin = gId('image-info');
+var imcn = gId('image-container');
+var bcn = gId("button-container");
+var im = gId('image');
+//var ss = gId("sendSvgP");
+var scDiv = gId("scaleDiv");
+var w = window;
+var canvas = gId('pixelCanvas');
+var brgV = gId("brightnessValue");
+var cLV = gId("colorLimitValue")
+
+//vars
+var httpArray = [];
+var fileJSON = '';
+
+var hideableRows = d.querySelectorAll(".ha-hide");
+for (var i = 0; i < hideableRows.length; i++) {
+ hideableRows[i].classList.add("hide");
+}
+
var accentColor = '#eee';
var accentTextColor = '#777';
var prsCol = '#ccc';
@@ -7,3 +48,4 @@
var scaleToggleOffd = "M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M7,15A3,3 0 0,1 4,12A3,3 0 0,1 7,9A3,3 0 0,1 10,12A3,3 0 0,1 7,15Z";
var scaleToggleOnd = "M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z";
+var sSg = gId("getSegmentsSVGpath");
\ No newline at end of file