diff --git a/cubefx/cubefx.ino b/cubefx/cubefx.ino
index e5a7438..257d40a 100644
--- a/cubefx/cubefx.ino
+++ b/cubefx/cubefx.ino
@@ -38,7 +38,7 @@ static const char htmlIndex[] PROGMEM = R"(
Light Panel
Light Status
Light Switch
-Light NextDemo
+Random Effect
WiFiAP TurnOff
Firmware Update
@@ -63,17 +63,20 @@ Firmware: CubeFX Panel
CubeFX Panel
Made with ❤️ by Cp0204
+lightRng.addEventListener('input', ()=>lightVal.textContent=lightRng.value); btnNext.addEventListener('click', ()=>{ let currentId=parseInt(idSel.value); idSel.value=currentId==5 ? -71 : currentId + 1;
+form.dispatchEvent(new Event('submit'));}); btnRandom.addEventListener('click', ()=>{ getData('/light/random');}); idSel.addEventListener('change', ()=>{ const colorPickers=document.querySelectorAll('.colorPicker');
+for (let i=1; i < colorPickers.length; i++){ colorPickers[i].style.display=idSel.value !=5 ? 'none' : '';}}); form.addEventListener('submit', (event)=>{ event.preventDefault(); const data={ on: onCheck.checked ? 1 : 0,
+id: parseInt(idSel.value), speed: parseInt(speedRng.value), lightness: parseInt(lightRng.value), data: Array.from(document.querySelectorAll('.colorPicker')).map(picker=>picker.value.replace('#', ''))};
+fetch(apiServer + '/post',{ method: 'POST', headers:{ 'Content-Type': 'application/json'}, body: JSON.stringify(data)}) .then(response=>response.json()) .then(response=>log.textContent +="\n/post Success " + JSON.stringify(response)) .catch(err=>log.textContent +='\nError: ' + err);});
+window.addEventListener('load', ()=>{ getData('/get');}); function getData(endpoint){ fetch(apiServer + endpoint) .then(response=>response.json()) .then(data=>{ onCheck.checked=data.on===1; idSel.value=data.id;
+speedRng.value=data.speed; speedVal.textContent=data.speed; lightRng.value=data.lightness; lightVal.textContent=data.lightness; const colorPickers=document.querySelectorAll('.colorPicker');
+for (let i=0; i < data.data.length; i++){ colorPickers[i].value='#' + data.data[i];} idSel.dispatchEvent(new Event('change')); log.textContent +='\n' + endpoint + ' Success';}) .catch(err=>{ log.textContent +='\nError: ' + err;});}