-
Notifications
You must be signed in to change notification settings - Fork 5
/
clock_libs.h
53 lines (46 loc) · 32 KB
/
clock_libs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef CLOCK_LIBS_H
#define CLOCK_LIBS_H
#include "src/NeoPixelBus_by_Makuna/src/NeoPixelBus.h"
#include "src/NeoPixelBus_by_Makuna/src/NeoPixelAnimator.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/DotStarAvrMethod.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/DotStarColorFeatures.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/DotStarGenericMethod.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/DotStarSpiMethod.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/Esp32_i2s.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/HsbColor.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/HslColor.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/HtmlColor.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/HtmlColorNameStrings.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/Layouts.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoArmMethod.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoAvrMethod.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoBitmapFile.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoBuffer.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoBufferContext.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoBufferMethods.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoColorFeatures.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoDib.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoEase.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoEspRmtMethod.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoGamma.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoHueBlend.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoMosaic.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoRingTopology.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoSpriteSheet.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoTiles.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/NeoTopology.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/RgbColor.h"
#include "src/NeoPixelBus_by_Makuna/src/internal/RgbwColor.h"
#include "src/AsyncTCP/src/AsyncTCP.h"
#include "src/ArduinoJson/src/ArduinoJson.h"
#include "src/ESPAsyncWebServer/src/ESPAsyncWebServer.h"
#include "src/ESPAsyncWebServer/src/AsyncJson.h"
//-------------------------------------------------------------------------------
const char HTML1[] PROGMEM = {"<!doctype html><html><head><meta name=\"apple-mobile-web-app-capable\" content=\"yes\"/><meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\"><meta name=\"format-detection\" content=\"telephone=no\"><meta name=\"viewport\" content=\"width=device-width, user-scalable=no, initial-scale=1.0\"><meta charset=\"utf-8\"><title>K2400 Clock</title><style>body{background-color: white; color: #555555; text-decoration: none; font-family: \"Trebuchet MS\", Helvetica, sans-serif; font-weight: bold; margin-left: 40px; margin-right: 40px;}p{color: #555555; text-indent: 10px; text-transform: uppercase; margin:50px 0px 0px 0px; font-size: 18px; padding-bottom: 10px;}.propertycontainer{width: 100%; min-width: 175px; max-width: 500px; margin: 0 auto; margin-bottom: 50px;}.textcontainer{width: 100%; min-width: 175px; max-width: 500px; margin: 0 auto; text-align: center; margin-top: 30px; margin-bottom: -15px;}.buttoncontainer{width: 100%; text-align: center; margin-top: 30px}.textboxcontainer{width: 100%; text-align: center; margin-top: 30px; color: #555555; font-size: 16px;}.btn{-webkit-border-radius: 30; -moz-border-radius: 30; border-radius: 30px; height: 30px;width: 50%; font-family: Arial; color: #555555; font-size: 16px; background: #dddddd; text-decoration: none; font-family: \"Trebuchet MS\", Helvetica, sans-serif; font-weight: bold; border:none;}.btn:active{color: #dddddd; background: #555555;}.textbox{-webkit-border-radius: 30; -moz-border-radius: 30; box-sizing: border-box; -moz-box-sizing: border-box;-webkit-box-sizing: border-box; border-radius: 30px; width: 100%; height: 30px; font-family: Arial; color: #555555; font-size: 16px; background: #dddddd; text-decoration: none; font-family: \"Trebuchet MS\", Helvetica, sans-serif; font-weight: bold; border:none; padding-left:15px; padding-right:15px;}.text{width: 100%; height: 30px; font-size: 30px; padding-left:10px; padding-right:10px;}.smalltext{width: 100%; height: 30px; font-size: 16px;}.disclaimer{width: 100%; font-size: 10px; z-index: 2000; bottom: 10px; text-align: center; color: #555555;}</style><script>function wifiInputValidation(){var ssid=document.getElementById(\"SSID\").value;var pw=document.getElementById(\"password\").value;var name=document.getElementById(\"name\").value;if ((ssid==\"\") || (pw==\"\") || (name==\"\")){alert('Please complete all the fields before saving.');return false;}if ((ssid.length > 32)){alert('SSID cannot be longer than 32 characters');return false;}if ((pw.length > 63)){alert('Password cannot be longer than 63 characters');return false;}if ((name.length > 16)){alert('Device name cannot be longer than 16 characters');return false;}return true;}function wifisave(){if(wifiInputValidation()){var ssid=document.getElementById(\"SSID\").value;var pw=document.getElementById(\"password\").value;var name=document.getElementById(\"name\").value;var xhr=new XMLHttpRequest();xhr.open('POST', 'wifisave?ssid=' + ssid + '&password=' + pw+ '&name=' + name);xhr.onload=function(){if (xhr.status===200){alert(\"WIFI settings saved and attempting to connect. Connect this device to your wireless network. When using an IOS device go to 'name of device'.local to control to the clock. When using another device use the discover application to find the clock on your network.\");}else{alert(\"ERROR - Please reset the clock and try again.\");}};xhr.send();}}</script></head><body><div class=\"propertycontainer\"><p>Connect to WLAN</p><div class=\"textboxcontainer\"> <input type=\"text\" class=\"textbox\" id=\"SSID\" placeholder=\"Enter SSID\"/> </div><div class=\"textboxcontainer\"> <input type=\"password\" class=\"textbox\" id=\"password\" placeholder=\"Enter PASSWORD\"/> </div><div class=\"textcontainer\"><span class=\"smalltext\" >Name of your device: </span></div><div class=\"textboxcontainer\"> <input type=\"text\" class=\"textbox\" id=\"name\" value=\"K2400\"/> </div><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"wifisave()\" type=\"button\">SAVE</button> </div></div><div class=\"disclaimer\"><span>Copyright © 2018 | Velleman</span></div></body></html>"};
const char HTML2[] PROGMEM = {"<!doctype html><html><head><meta name=\"apple-mobile-web-app-capable\" content=\"yes\"/><meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\"><meta name=\"format-detection\" content=\"telephone=no\"><meta name=\"viewport\" content=\"width=device-width, user-scalable=no, initial-scale=1.0\"><meta charset=\"utf-8\"><title>K2400 Clock</title><style>body{background-color: white; color: #555555; text-decoration: none; font-family: \"Trebuchet MS\", Helvetica, sans-serif; font-weight: bold;}p{color: #555555; text-indent: 10px; text-transform: uppercase; margin:50px 0px 0px 0px; font-size: 18px; padding-bottom: 10px;}.propertycontainersmall{width: 100%; min-width: 175px; max-width: 500px; margin: 0 auto;}.propertycontainer{width: 100%; min-width: 175px; max-width: 500px; margin: 0 auto; margin-bottom: 100px;}.slidecontainer{width: 100%;}.slidecontainersmall{width: 100%; text-align: center;}.buttoncontainer{width: 100%; text-align: center; margin-top: 30px}.textboxcontainer{width: 100%; text-align: center; margin-top: 30px; color: #555555; font-size: 16px;}.slider{width: 100%; -webkit-appearance: none; margin-top:30px;}.slider::-webkit-slider-runnable-track{background: #dddddd; border: none; height: 30px;border-radius: 15px;}.slider::-moz-range-track{background: #dddddd; border: none;height: 30px;border-radius: 15px;}.slider::-ms-track{background: #dddddd; border: none; height: 30px;border-radius: 15px; animate: 0.2s; border-color: transparent; color: transparent;}.slider::-ms-fill-lower{background: none;}.slider::-ms-fill-upper{background: none;}.white::-moz-range-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #555555;}.red::-moz-range-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #ff0000;}.green::-moz-range-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #00ff00;}.blue::-moz-range-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #0000ff;}.grey::-moz-range-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #555555;}.white::-ms-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #555555;}.red::-ms-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #ff0000;}.green::-ms-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #00ff00;}.blue::-ms-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #0000ff;}.grey::-ms-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #555555;}.white::-webkit-slider-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #555555;}.red::-webkit-slider-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #ff0000;}.green::-webkit-slider-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #00ff00;}.blue::-webkit-slider-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #0000ff;}.grey::-webkit-slider-thumb{-webkit-appearance: none;border: none;height: 30px;width: 30px;border-radius: 50%;background: #555555;}.btn{-webkit-border-radius: 30; -moz-border-radius: 30; border-radius: 30px; height: 30px;width: 50%; color: #555555; font-size: 16px; background: #dddddd; text-decoration: none; font-family: \"Trebuchet MS\", Helvetica, sans-serif; font-weight: bold; border:none;}.btn:active{color: #dddddd; background: #555555;}.textbox{-webkit-border-radius: 30; -moz-border-radius: 30; box-sizing: border-box; -moz-box-sizing: border-box;-webkit-box-sizing: border-box; border-radius: 30px; width: 100%; height: 30px; font-family: Arial; color: #555555; font-size: 16px; background: #dddddd; text-decoration: none; font-family: \"Trebuchet MS\", Helvetica, sans-serif; font-weight: bold; border:none; padding-left:15px; padding-right:15px;}.text{width: 100%; height: 30px; font-size: 30px; padding-left:1px; padding-right:1px;}.smalltext{width: 100%; height: 30px; font-size: 16px;}.disclaimer{width: 100%; font-size: 10px; z-index: 2000; bottom: 10px; position: fixed; padding-left: 30px; color: #555555;}/* HAMBURGER MENU */@media all and (-ms-high-contrast:none){html{display: flex;flex-direction: column;}}body{display: flex; flex-direction: row; flex-grow: 1; overflow-x: hidden; min-height: 100vh;}.sidebar{flex: 0 0 200px; order: -1; left: -200px; z-index: 2;}.textcontainer{text-align: center; margin-top: 30px; margin-bottom: -15px;flex: 1;}.clocktextcontainer{text-align: center; margin-top: 12px; margin-right: 60px;flex: 1;}nav{position: fixed; z-index: 1000; width: 200px; /*height: calc(100vh);*/ height: 100%; box-shadow: 0px 0px 20px 0px #dddddd; background-color: #fdfdfd;}.nav-hidden{box-shadow: none;}.content{flex: 1; min-width: 0; display: flex; flex-direction: column; flex-grow: 1;}.header{flex: 0 0 50px;}header{position: fixed; width: calc(100% - 200px); height: 57px; background-color: white; display: flex; flex-direction: row; flex-grow: 1;}.sidebar-hidden header{width: calc(100%);}main{flex: 1; margin-left: 40px; margin-right: 40px;}article{flex: 1; min-width: 0; margin-bottom:100px;}.sidebar-hidden .sidebar{margin-left: -200px;}.line{margin-top:5px; background-color:#555555; width:25px; height:3px; display:block; position:relative; opacity:1.0;}.nav-trigger{flex: 0 0 30px; z-index: 2; height: 30px; width: 30px; cursor: pointer; background-size: contain; margin: 15px;}/* Navigation Menu - Background */nav{list-style: none;}.nav-item{width: 200px;}.nav-item a{display: block; padding: 1em; color: #555555; font-size: 18px; text-decoration: none; font-family: \"Trebuchet MS\", Helvetica, sans-serif; font-weight: bold; text-transform: uppercase; transition: color 0.2s, background 0.5s;}.nav-item a:hover{color: #ffffff; background-color: #555555;}@media (max-width: 576px){.clocktextcontainer{display:none;}.sidebar-hidden .clocktextcontainer{display:inline;}}/* Micro reset */*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;}html, body{height: 100%; width: 100%;}/* HAMBURGER MENU */</style><script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js\"></script><script>$(document).ready(function(){initLoadData(); $(\"input[type=range]\").mousedown(function(){sliderActive=true; console.log(\"mousedown\");}); $(\"input[type=range]\").mouseup(function(){sliderActive=false; console.log(\"mouseup\");}); $(\"input[type=range]\").keydown(function(){sliderActive=true; console.log(\"keydown\");}); $(\"input[type=range]\").keyup(function(){sliderActive=false; console.log(\"keyup\");}); $(\"input[type=range]\").on({'touchstart': function(){sliderActive=true; console.log(\"touchstart\");}}); $(\"input[type=range]\").on({'touchend': function(){sliderActive=false; console.log(\"touchend\");}}); $('.nav-item a').on('click', function(){var target=$(this).attr('rel'); $(\"#\" + target).show().siblings(\"div\").hide();}); $(\".nav-trigger\").click(function(){$(\"body\").toggleClass(\"sidebar-hidden\");$(\"nav\").toggleClass(\"nav-hidden\");}); $(\".nav-item:first a\").click();$(\".nav-item a\").click(function(){if ($(window).width() < 576){$(\"body\").toggleClass(\"sidebar-hidden\");$(\"nav\").toggleClass(\"nav-hidden\");}});if ($(window).width() < 576){$(\"body\").toggleClass(\"sidebar-hidden\");$(\"nav\").toggleClass(\"nav-hidden\");}});var sliderActive=false; window.setInterval(function(){if (!sliderActive){loadData();}}, 1000);function initLoadData(){$.post(\"data\", function (data, status){var jsonData=data; $(\"#brightness\").val(jsonData.brightness);$(\"#hourRed\").val(jsonData.hourRed);$(\"#hourGreen\").val(jsonData.hourGreen);$(\"#hourBlue\").val(jsonData.hourBlue);$(\"#minuteRed\").val(jsonData.minuteRed);$(\"#minuteGreen\").val(jsonData.minuteGreen);$(\"#minuteBlue\").val(jsonData.minuteBlue);$(\"#secondRed\").val(jsonData.secondRed);$(\"#secondGreen\").val(jsonData.secondGreen);$(\"#secondBlue\").val(jsonData.secondBlue);$(\"#pendRed\").val(jsonData.pendRed);$(\"#pendGreen\").val(jsonData.pendGreen);$(\"#pendBlue\").val(jsonData.pendBlue);$(\"#minRed\").val(jsonData.minRed);$(\"#minGreen\").val(jsonData.minGreen);$(\"#minBlue\").val(jsonData.minBlue);$(\"#quarterRed\").val(jsonData.quarterRed);$(\"#quarterGreen\").val(jsonData.quarterGreen);$(\"#quarterBlue\").val(jsonData.quarterBlue);$(\"#mode\").val(jsonData.mode);$(\"#invert\").val(jsonData.invert);$(\"#hour\").text(jsonData.hour);$(\"#min\").text(jsonData.min);$(\"#sec\").text(jsonData.sec);$(\"#hour\").text(jsonData.hour);$(\"#min\").text(jsonData.min);$(\"#sec\").text(jsonData.sec);$(\"#NTPtextbox\").val(jsonData.NTP);$(\"#GMTtextbox\").val(jsonData.GMT);$(\"#DSTtextbox\").val(jsonData.DST);$(\"#devicename\").val(jsonData.devicename);$(\"#alarmOn\").val(jsonData.alarmOn);$(\"#minAlarm\").val(jsonData.minAlarm);$(\"#hourAlarm\").val(jsonData.hourAlarm);$(\"#dimOn\").val(jsonData.dimOn);$(\"#hourStartDim\").val(jsonData.hourStartDim);$(\"#hourStopDim\").val(jsonData.hourStopDim);$(\"#valueDim\").val(jsonData.valueDim);});}function loadData(){$.post(\"data\", function (data, status){var jsonData=data; $(\"#brightness\").val(jsonData.brightness);$(\"#hourRed\").val(jsonData.hourRed);$(\"#hourGreen\").val(jsonData.hourGreen);$(\"#hourBlue\").val(jsonData.hourBlue);$(\"#minuteRed\").val(jsonData.minuteRed);$(\"#minuteGreen\").val(jsonData.minuteGreen);$(\"#minuteBlue\").val(jsonData.minuteBlue);$(\"#secondRed\").val(jsonData.secondRed);$(\"#secondGreen\").val(jsonData.secondGreen);$(\"#secondBlue\").val(jsonData.secondBlue);$(\"#pendRed\").val(jsonData.pendRed);$(\"#pendGreen\").val(jsonData.pendGreen);$(\"#pendBlue\").val(jsonData.pendBlue);$(\"#minRed\").val(jsonData.minRed);$(\"#minGreen\").val(jsonData.minGreen);$(\"#minBlue\").val(jsonData.minBlue);$(\"#quarterRed\").val(jsonData.quarterRed);$(\"#quarterGreen\").val(jsonData.quarterGreen);$(\"#quarterBlue\").val(jsonData.quarterBlue);$(\"#mode\").val(jsonData.mode);$(\"#invert\").val(jsonData.invert);$(\"#hour\").text(jsonData.hour);$(\"#min\").text(jsonData.min);$(\"#sec\").text(jsonData.sec);$(\"#hour\").text(jsonData.hour);$(\"#min\").text(jsonData.min);$(\"#sec\").text(jsonData.sec);});}function ntpreset(){$.post(\"ntpreset\", function(data, status){if(status==\"success\"){alert(\"NTP settings reset\");}else{alert(\"ERROR\");}});$('#NTPtextbox').val('time.google.com');$('#GMTtextbox').val('0'); $('#DSTtextbox').val('0');/*initLoadData();*/}function NTPInputValidation(){if (($('#NTPtextbox').val()==\"\") || ($('#GMTtextbox').val()==\"\") || ($('#DSTtextbox').val()==\"\")){alert('Please complete all the fields before saving.');return false;}if ((parseFloat($('#GMTtextbox').val()) > 23) || (parseFloat($('#GMTtextbox').val()) < -23)){alert('GMT offset cannot be smaller than -23 or bigger than 23');return false;}if ((parseFloat($('#DSTtextbox').val()) > 23) || (parseFloat($('#DSTtextbox').val()) < -23)){alert('DST offset cannot be smaller than -23 or bigger than 23');return false;}return true;}function ntpsave(){if (NTPInputValidation()){$.post(\"ntpsave\",{NTP: $(\"#NTPtextbox\").val(),GMT: $(\"#GMTtextbox\").val(),DST: $(\"#DSTtextbox\").val()},function(data, status){if(status==\"success\"){alert(\"NTP settings saved\");}else{alert(\"ERROR\");}}); /*initLoadData();*/}}function wifiInputValidation(){if (($('#SSID').val()==\"\") || ($('#password').val()==\"\") || ($('#devicename').val()==\"\")){alert('Please complete all the fields before saving.');return false;}if (($('#SSID').val().length > 32)){alert('SSID cannot be longer than 32 characters');return false;}if (($('#password').val().length > 63)){alert('Password cannot be longer than 63 characters');return false;}if (($('#devicename').val().length > 16)){alert('Device name cannot be longer than 16 characters');return false;}var str=$('#devicename').val();if (str.includes(\" \")){alert('Device name cannot contains spaces');return false;}return true;}function wifisave(){if (wifiInputValidation()){$.post(\"wifisave\",{SSID: $(\"#SSID\").val(),password: $(\"#password\").val(),devicename: $(\"#devicename\").val()},function(data, status){if(status==\"success\"){alert(\"WLAN settings saved\");}else{alert(\"ERROR\");}});$('#SSID').val('');$('#password').val('');}}function wifireset(){$.post(\"wifireset\", function(data, status){if(status==\"success\"){alert(\"WLAN settings reset\");}else{alert(\"ERROR\");}});$('#SSID').val('');$('#password').val(''); $('#devicename').val('K2400');/*initLoadData();*/}function alarmInputValidation(){if (($('#hourAlarm').val()==\"\") || ($('#minAlarm').val()==\"\")){alert('Please complete all the fields before saving.');return false;}if((parseInt($('#hourAlarm').val()) < 0) || (parseInt($('#hourAlarm').val()) > 23)){alert('Alarm hour cannot be smaller than 0 or larger than 23.');return false;}if((parseInt($('#minAlarm').val()) < 0) || (parseInt($('#minAlarm').val()) > 59)){alert('Alarm minutes cannot be smaller than 0 or larger than 59.');return false;}return true;}function alarmsave(){if (alarmInputValidation()){$.post(\"alarmsave\",{alarmOn:$(\"#alarmOn\").val(),hourAlarm: $(\"#hourAlarm\").val(),minAlarm: $(\"#minAlarm\").val()},function(data, status){if(status==\"success\"){alert(\"Alarm settings saved\");}else{alert(\"ERROR\");}});}}function alarmreset(){$.post(\"alarmreset\", function(data, status){if(status==\"success\"){alert(\"Alarm settings reset\");}else{alert(\"ERROR\");}});$('#alarmOn').val('0');$('#hourAlarm').val('');$('#minAlarm').val('');/*initLoadData();*/}function dimInputValidation(){if (($('#hourStartDim').val()==\"\") || ($('#hourStopDim').val()==\"\") || ($('#valueDim').val()==\"\")){alert('Please complete all the fields before saving.');return false;}if((parseInt($('#hourStartDim').val()) < 0) || (parseInt($('#hourStartDim').val()) > 23)){alert('Start hour cannot be smaller than 0 or larger than 23.');return false;}if((parseInt($('#hourStopDim').val()) < 0) || (parseInt($('#hourStopDim').val()) > 23)){alert('Stop hour cannot be smaller than 0 or larger than 23.');return false;}return true;}function dimsave(){if (dimInputValidation()){$.post(\"dimsave\",{dimOn:$(\"#dimOn\").val(),hourStartDim:$(\"#hourStartDim\").val(),hourStopDim: $(\"#hourStopDim\").val(),valueDim: $(\"#valueDim\").val()},function(data, status){if(status==\"success\"){alert(\"Dim settings saved\");}else{alert(\"ERROR\");}});}}function dimreset(){$.post(\"dimreset\", function(data, status){if(status==\"success\"){alert(\"Dim settings reset\");}else{alert(\"ERROR\");}});$('#dimOn').val('0');$('#hourStartDim').val('');$('#hourStopDim').val('');$('#valueDim').val('128');/*initLoadData();*/}function globalrestart(){$.post(\"globalrestart\", function(data, status){if(status==\"success\"){alert(\"Device restarting\");}else{alert(\"ERROR\");}});}function globalreset(){$.post(\"globalreset\", function(data, status){if(status==\"success\"){alert(\"Factory defaults restored\");}else{alert(\"ERROR\");}});}function colorsave(){$.post(\"colorsave\", function (data, status){});}function colorload(){$.post(\"colorload\", function (data, status){});}function colorreset(){$.post(\"colorreset\", function (data, status){});}function update(){$.post(\"data\",{brightness: $(\"#brightness\").val(),hourRed: $(\"#hourRed\").val(),hourGreen: $(\"#hourGreen\").val(),hourBlue: $(\"#hourBlue\").val(),minuteRed: $(\"#minuteRed\").val(),minuteGreen: $(\"#minuteGreen\").val(),minuteBlue: $(\"#minuteBlue\").val(),secondRed: $(\"#secondRed\").val(),secondGreen: $(\"#secondGreen\").val(),secondBlue: $(\"#secondBlue\").val(),pendRed: $(\"#pendRed\").val(),pendGreen: $(\"#pendGreen\").val(),pendBlue: $(\"#pendBlue\").val(),minRed: $(\"#minRed\").val(),minGreen: $(\"#minGreen\").val(),minBlue: $(\"#minBlue\").val(),quarterRed: $(\"#quarterRed\").val(),quarterGreen: $(\"#quarterGreen\").val(),quarterBlue: $(\"#quarterBlue\").val(),mode: $(\"#mode\").val(),invert: $(\"#invert\").val()}, function(data, status){});}</script></head><body> <div class=\"sidebar\"> <nav> <li class=\"nav-item\"><a href=\"#\" rel=\"section1\">Color Settings</a></li><li class=\"nav-item\"><a href=\"#\" rel=\"section2\">Time Settings</a></li><li class=\"nav-item\"><a href=\"#\" rel=\"section3\">WLAN Settings</a></li><li class=\"nav-item\"><a href=\"#\" rel=\"section4\">Device Settings</a></li></nav> <span class=\"disclaimer\">Copyright © 2018 | Velleman</span> </div><div class=\"content\"> <div class=\"header\"><header> <span class=\"nav-trigger\"> <span> <span class=\"line\"></span> <span class=\"line\"></span> <span class=\"line\"></span> </span> </span> <span class=\"clocktextcontainer\"> <span class=\"text\" id=\"hour\">00</span> <span class=\"text\">:</span> <span class=\"text\" id=\"min\">00</span> <span class=\"text\">:</span> <span class=\"text\" id=\"sec\">00</span> </span> </header> </div><main> <article> <div id=\"section1\"> <div class=\"propertycontainersmall\"> <p>Brightness</p><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider white\" id=\"brightness\" onChange=\"update()\"> </div></div><div class=\"propertycontainer\"> <p>Display mode</p><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"8\" value=\"0\" class=\"slider white\" id=\"mode\" onChange=\"update()\"> </div></div><div class=\"propertycontainersmall\"> <p>Hour hand</p><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider red\" id=\"hourRed\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider green\" id=\"hourGreen\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider blue\" id=\"hourBlue\" onChange=\"update()\"> </div></div><div class=\"propertycontainersmall\"> <p>Minute hand</p><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider red\" id=\"minuteRed\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider green\" id=\"minuteGreen\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider blue\" id=\"minuteBlue\" onChange=\"update()\"> </div></div><div class=\"propertycontainersmall\"> <p>Second hand</p><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider red\" id=\"secondRed\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider green\" id=\"secondGreen\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider blue\" id=\"secondBlue\" onChange=\"update()\"> </div></div><div class=\"propertycontainersmall\"> <p>Pendulum</p><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider red\" id=\"pendRed\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider green\" id=\"pendGreen\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider blue\" id=\"pendBlue\" onChange=\"update()\"> </div></div><div class=\"propertycontainersmall\"> <p>5 Minute Marks</p><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider red\" id=\"minRed\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider green\" id=\"minGreen\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider blue\" id=\"minBlue\" onChange=\"update()\"> </div></div><div class=\"propertycontainersmall\"> <p>15 Minute Marks</p><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider red\" id=\"quarterRed\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider green\" id=\"quarterGreen\" onChange=\"update()\"> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider blue\" id=\"quarterBlue\" onChange=\"update()\"> </div></div><div class=\"propertycontainersmall\"> <p>Invert colors</p><div class=\"textcontainer\"> <span class=\"smalltext\" >OFF/ON</span> </div><div class=\"slidecontainersmall\"> <input type=\"range\" style=\"width:25%;\" min=\"0\" max=\"1\" value=\"0\" class=\"slider grey\" id=\"invert\" onChange=\"update()\"> </div></div><div class=\"propertycontainer\"> <p>Color Settings</p><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"colorsave()\" type=\"button\">SAVE</button> </div><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"colorload()\" type=\"button\">LOAD</button> </div><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"colorreset()\" type=\"button\">RESET</button> </div></div></div><div id=\"section2\"> <div class=\"propertycontainer\"> <p>NTP server</p><div class=\"textcontainer\"> <span class=\"smalltext\" >NTP server: </span> </div><div class=\"textboxcontainer\"> <input type=\"text\" class=\"textbox\" id=\"NTPtextbox\" placeholder=\"Enter new NTP server here\"/> </div><div class=\"textcontainer\"> <span class=\"smalltext\" >GMT offset (hours): </span> </div><div class=\"textboxcontainer\"> <input type=\"number\" pattern=\"[0-9]+\" class=\"textbox\" id=\"GMTtextbox\" placeholder=\"Enter GMT offset (hours)\"/> </div><div class=\"textcontainer\"> <span class=\"smalltext\" >DST offset (hours): </span> </div><div class=\"textboxcontainer\"> <input type=\"number\" pattern=\"[0-9]+\" class=\"textbox\" id=\"DSTtextbox\" placeholder=\"Enter DST offset (hours)\"/> </div><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"ntpsave()\" type=\"button\">SAVE</button> </div><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"ntpreset()\" type=\"button\">RESET</button> </div></div><div class=\"propertycontainer\"> <p>Alarm</p><div class=\"textcontainer\"> <span class=\"smalltext\" >Hour: </span> </div><div class=\"textboxcontainer\"> <input type=\"number\" pattern=\"[0-9]+\" class=\"textbox\" id=\"hourAlarm\" placeholder=\"Enter hour\"/> </div><div class=\"textcontainer\"> <span class=\"smalltext\" >Minutes: </span> </div><div class=\"textboxcontainer\"> <input type=\"number\" pattern=\"[0-9]+\" class=\"textbox\" id=\"minAlarm\" placeholder=\"Enter minutes\"/> </div><div class=\"textcontainer\"> <span class=\"smalltext\" >Alarm OFF/ON</span> </div><div class=\"slidecontainersmall\"> <input type=\"range\" style=\"width:25%;\" min=\"0\" max=\"1\" value=\"0\" class=\"slider grey\" id=\"alarmOn\"> </div><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"alarmsave()\" type=\"button\">SAVE</button> </div><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"alarmreset()\" type=\"button\">RESET</button> </div></div><div class=\"propertycontainer\"> <p>Auto Dimming</p><div class=\"textcontainer\"> <span class=\"smalltext\" >Start dimming at: (hour) </span> </div><div class=\"textboxcontainer\"> <input type=\"number\" pattern=\"[0-9]+\" class=\"textbox\" id=\"hourStartDim\" placeholder=\"Enter hour\"/> </div><div class=\"textcontainer\"> <span class=\"smalltext\" >Stop dimming at: (hour) </span> </div><div class=\"textboxcontainer\"> <input type=\"number\" pattern=\"[0-9]+\" class=\"textbox\" id=\"hourStopDim\" placeholder=\"Enter hour\"/> </div><div class=\"textcontainer\"> <span class=\"smalltext\" >Dim to: </span> </div><div class=\"slidecontainer\"> <input type=\"range\" min=\"0\" max=\"255\" value=\"128\" class=\"slider white\" id=\"valueDim\"> </div><div class=\"textcontainer\"> <span class=\"smalltext\" >Auto Dimming OFF/ON</span> </div><div class=\"slidecontainersmall\"> <input type=\"range\" style=\"width:25%;\" min=\"0\" max=\"1\" value=\"0\" class=\"slider grey\" id=\"dimOn\"> </div><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"dimsave()\" type=\"button\">SAVE</button> </div><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"dimreset()\" type=\"button\">RESET</button> </div></div></div><div id=\"section3\"> <div class=\"propertycontainer\"> <p>WLAN Settings</p><div class=\"textcontainer\"> <span class=\"smalltext\" >WLAN settings:</span> </div><div class=\"textboxcontainer\"> <input type=\"text\" class=\"textbox\" id=\"SSID\" placeholder=\"Enter SSID\"/> </div><div class=\"textboxcontainer\"> <input type=\"password\" class=\"textbox\" id=\"password\" placeholder=\"Enter PASSWORD\"/> </div><div class=\"textcontainer\"> <span class=\"smalltext\" >Name of your device: </span> </div><div class=\"textboxcontainer\"> <input type=\"text\" class=\"textbox\" id=\"devicename\"/> </div><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"wifisave()\" type=\"button\">SAVE</button> </div><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"wifireset()\" type=\"button\">RESET</button> </div></div></div><div id=\"section4\"><div class=\"propertycontainersmall\"> <p>Device Restart</p><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"globalrestart()\" type=\"button\">RESTART</button> </div></div><div class=\"propertycontainer\"> <p>Factory Defaults</p><div class=\"buttoncontainer\"> <button class=\"btn\" onClick=\"globalreset()\" type=\"button\">RESET</button> </div></div></div></article> </main> </div></body></html>"};
/*
* Minify HTML -> https://www.willpeavy.com/minifier/
* Escape HTML -> http://tomeko.net/online_tools/cpp_text_escape.php?lang=en
*/
//-------------------------------------------------------------------------------
#endif