Skip to content

Commit

Permalink
css improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
vascofazza committed Jan 2, 2021
1 parent 12f0d5e commit c967742
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions nixie_firmware/lib/WiFiManager/strings_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const char HTTP_STYLE[] PROGMEM = "<style>"
"input,button,.msg{border-radius:.3rem;width: 100%}"
"button,input[type='button'],input[type='submit']{cursor:pointer;border:0;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%}"
"input[type='file']{border:1px solid #1fa3ec}"
"input[type=radio],input.radio {float: left;clear: none;margin: 2px 0 0 2px;width: auto;}"
".wrap {text-align:left;display:inline-block;min-width:260px;max-width:500px}"
// links
"a{color:#000;font-weight:700;text-decoration:none}a:hover{color:#1fa3ec;text-decoration:underline}"
Expand Down
6 changes: 4 additions & 2 deletions nixie_firmware/src/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Config config{
-1,
"CET",
true,
true,
true,
Expand All @@ -17,7 +16,9 @@ Config config{
true,
true,
CATHODE_POISONING_TRIGGER_TIME,
CLOCK_CYCLE};
CLOCK_CYCLE,
"CET"
};

void printParams()
{
Expand Down Expand Up @@ -68,6 +69,7 @@ void check_params()
config.sleep_hour = config.sleep_hour > 23 || config.sleep_hour < 0 ? 0 : config.sleep_hour;
config.wake_hour = config.wake_hour > 23 || config.wake_hour < 0 ? 7 : config.wake_hour;
config.clock_cycle = config.clock_cycle < 60000 ? CLOCK_CYCLE : config.clock_cycle;
config.depoisoning = config.depoisoning <= CATHODE_POISONING_PREVENTION_TIME ? 0 : config.depoisoning;
}

void setup_configuration()
Expand Down
2 changes: 1 addition & 1 deletion nixie_firmware/src/configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
struct Config
{
int timezone;
char timezone_name[30];
bool h24;
bool leds;
bool celsius;
Expand All @@ -92,6 +91,7 @@ struct Config
bool date;
unsigned int depoisoning;
unsigned int clock_cycle;
char timezone_name[30];
};

extern Config config;
Expand Down
20 changes: 10 additions & 10 deletions nixie_firmware/src/network/wifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ void setup_wifi(ClockDriver *clock, void (*callback)(void))
blink_field = new WiFiManagerParameter(blink_radio_str);
wifiManager.addParameter(blink_field);

auto temp_radio_str = F("<br/><label for='temp_field'>Temperature scale:</label><input type='radio' name='temp_field' value='1' checked>C°<br><input type='radio' name='temp_field' value='0'>F°<br>");
auto temp_radio_str = F("<br/><p>Temperature scale:</p><input type='radio' name='temp_field' value='1' checked> C°<br><input type='radio' name='temp_field' value='0'> F°<br>");
temp_field = new WiFiManagerParameter(temp_radio_str);
wifiManager.addParameter(temp_field);

auto adaptive_radio_str = F("<br/><label for='adaptive_field'>Adaptive Brightness:</label><input type='radio' name='adaptive_field' value='1' checked>ON<br><input type='radio' name='adaptive_field' value='0'>OFF<br>");
auto adaptive_radio_str = F("<br/><p>Adaptive Brightness:</p><input type='radio' name='adaptive_field' value='1' checked> ON<br><input type='radio' name='adaptive_field' value='0'> OFF<br>");
adaptive_field = new WiFiManagerParameter(adaptive_radio_str);
wifiManager.addParameter(adaptive_field);

Expand All @@ -63,29 +63,29 @@ void setup_wifi(ClockDriver *clock, void (*callback)(void))
leds = new WiFiManagerParameter(leds_str);
wifiManager.addParameter(leds);

auto leds_mode_str = F("<br/><p>Leds mode:</p><input type='radio' name='leds_mode_field' value='0' checked><label for='0'>static</label><br><input type='radio' name='leds_mode_field' value='1'><label for='1'>rotating</label><br><input type='radio' name='leds_mode_field' value='2'><label for='2'>random</label><br>");
auto leds_mode_str = F("<br/><p>Leds mode:</p><input type='radio' name='leds_mode_field' value='0' checked><label for='0'>static</label><br><input type='radio' name='leds_mode_field' value='1'><label for='1'>rotating</label><br><input type='radio' name='leds_mode_field' value='2'><label for='2'>random</label><br><br>");
leds_mode = new WiFiManagerParameter(leds_mode_str);
wifiManager.addParameter(leds_mode);

brightness_offset = new WiFiManagerParameter(F("brightness_offset"), F("brightness_offset"), String(config.brightness_offset).c_str(), 4);
brightness_offset = new WiFiManagerParameter(F("brightness_offset"), F("Brightness offset"), String(config.brightness_offset).c_str(), 4);
wifiManager.addParameter(brightness_offset);

shutdown_threshold = new WiFiManagerParameter(F("shutdown_threshold"), F("shutdown_threshold"), String(config.shutdown_threshold).c_str(), 4);
shutdown_threshold = new WiFiManagerParameter(F("shutdown_threshold"), F("Shutdown threshold"), String(config.shutdown_threshold).c_str(), 4);
wifiManager.addParameter(shutdown_threshold);

sleep_hour = new WiFiManagerParameter(F("sleep_hour"), F("sleep_hour"), String(config.sleep_hour).c_str(), 3);
sleep_hour = new WiFiManagerParameter(F("sleep_hour"), F("Sleep hour"), String(config.sleep_hour).c_str(), 3);
wifiManager.addParameter(sleep_hour);

wake_hour = new WiFiManagerParameter(F("wake_hour"), F("wake_hour"), String(config.wake_hour).c_str(), 3);
wake_hour = new WiFiManagerParameter(F("wake_hour"), F("Wake hour"), String(config.wake_hour).c_str(), 3);
wifiManager.addParameter(wake_hour);

shutdown_delay = new WiFiManagerParameter(F("shutdown_delay"), F("shutdown_delay"), String(config.shutdown_delay).c_str(), 7);
shutdown_delay = new WiFiManagerParameter(F("shutdown_delay"), F("Shutdown delay"), String(config.shutdown_delay).c_str(), 7);
wifiManager.addParameter(shutdown_delay);

depoisoning = new WiFiManagerParameter(F("depoisoning_field"), F("depoisoning_field"), String(config.depoisoning / 60000).c_str(), 7);
depoisoning = new WiFiManagerParameter(F("depoisoning_field"), F("Depoisoning trigger time"), String(config.depoisoning / 60000).c_str(), 7);
wifiManager.addParameter(depoisoning);

clock_cycle = new WiFiManagerParameter(F("clock_cycle"), F("clock_cycle"), String(config.clock_cycle / 60000).c_str(), 7);
clock_cycle = new WiFiManagerParameter(F("clock_cycle"), F("Clock cycle time"), String(config.clock_cycle / 60000).c_str(), 7);
wifiManager.addParameter(clock_cycle);

wifiManager.setSaveParamsCallback(saveParamsCallback);
Expand Down

0 comments on commit c967742

Please sign in to comment.