diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index f281fd47..5f8942dc 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -18,6 +18,16 @@ function off(n){ d.getElementsByName(n)[0].value = -1; } + var timeout; + function showToast(text, error = false) + { + var x = gId("toast"); + x.innerHTML = text; + x.className = error ? "error":"show"; + clearTimeout(timeout); + x.style.animation = 'none'; + timeout = setTimeout(function(){ x.className = x.className.replace("show", ""); }, 2900); + } function bLimits(b,p,m) { maxB = b; maxM = m; maxPB = p; } @@ -317,8 +327,8 @@ Reverse (rotated 180°): } function uploadFile() { var req = new XMLHttpRequest(); - //req.addEventListener('load', function(){console.log(this.responseText);}); - req.addEventListener('error', function(e){console.error(e.stack);}); + req.addEventListener('load', function(){showToast(this.responseText)}); + req.addEventListener('error', function(e){showToast(e.stack,true);}); req.open("POST", "/upload"); var formData = new FormData(); formData.append("data", d.Sf.data.files[0], "/ir.json"); @@ -337,7 +347,6 @@ Reverse (rotated 180°): -
@@ -397,6 +406,7 @@ Reverse (rotated 180°):  ×
+
IR info
Relay pin: invert  ×

diff --git a/wled00/data/style.css b/wled00/data/style.css index 60e4b7ce..d1e4aacc 100644 --- a/wled00/data/style.css +++ b/wled00/data/style.css @@ -75,3 +75,32 @@ td { .d5 { width: 4.5em !important; } + +#toast { + opacity: 0; + background-color: #444; + border-radius: 5px; + bottom: 64px; + color: #fff; + font-size: 17px; + padding: 16px; + pointer-events: none; + position: fixed; + text-align: center; + z-index: 5; + transform: translateX(-50%%); /* %% because of AsyncWebServer */ + max-width: 90%%; /* %% because of AsyncWebServer */ + left: 50%%; /* %% because of AsyncWebServer */ +} + +#toast.show { + opacity: 1; + background-color: #264; + animation: fadein 0.5s, fadein 0.5s 2.5s reverse; +} + +#toast.error { + opacity: 1; + background-color: #b21; + animation: fadein 0.5s; +} diff --git a/wled00/html_settings.h b/wled00/html_settings.h index 3df3a22e..6b511d51 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -6,7 +6,7 @@ */ // Autogenerated from wled00/data/style.css, do not edit!! -const char PAGE_settingsCss[] PROGMEM = R"=====()====="; +const char PAGE_settingsCss[] PROGMEM = R"=====()====="; // Autogenerated from wled00/data/settings.htm, do not edit!! @@ -74,12 +74,9 @@ Do not enable if WiFi is working correctly, increases power consumption.
LED Settings