243
243
}
244
244
245
245
.show {
246
- height : 200 px ;
246
+ height : 230 px ;
247
247
transition : height 1s ;
248
248
}
249
249
@@ -276,6 +276,10 @@ <h1 id="headline">WORDCLOCK 2.0</h1>
276
276
< label for ="brightness "> Brightness:</ label >
277
277
< input type ="range " id ="brightness " name ="volume " min ="10 " max ="255 ">
278
278
</ div >
279
+ < div class ="number-container ">
280
+ < label for ="colorshiftspeed "> Color shift speed:</ label >
281
+ < input type ="range " id ="colorshiftspeed " name ="volume " min ="0 " max ="50 ">
282
+ </ div >
279
283
< div class ="number-container ">
280
284
< label for ="nm_start " style ="align-self: flex-start "> Nightmode start time: </ label >
281
285
< input type ="time " id ="nm_start " name ="nm_start " min ="00:00 " max ="23:59 ">
@@ -317,7 +321,12 @@ <h1 id="headline">WORDCLOCK 2.0</h1>
317
321
< div >
318
322
< input name = "AutoChange " id ="AutoChange " type ="checkbox " class ="toggle ">
319
323
</ div >
320
-
324
+ </ div >
325
+ < div class ="checkbox-container " id = "colorshiftcontainer ">
326
+ < label for ="ColorShift " style ="align-self: flex-start "> DynamicColorShift</ label >
327
+ < div >
328
+ < input name = "ColorShift " id ="ColorShift " type ="checkbox " class ="toggle ">
329
+ </ div >
321
330
</ div >
322
331
323
332
< div class ="main-container hidden " id ="colorcontainer ">
@@ -480,10 +489,28 @@ <h1 id="headline">WORDCLOCK 2.0</h1>
480
489
sendCommand ( "./cmd?stateautochange=0" ) ;
481
490
}
482
491
} ) ;
492
+
493
+ var ckb_colorshift = document . querySelector ( 'input[id="ColorShift"]' ) ;
494
+ if ( myVar . colorshift == "1" ) {
495
+ console . log ( "colorshift == 1" ) ;
496
+ ckb_colorshift . checked = true ;
497
+ }
498
+ else {
499
+ console . log ( "colorshift == 0" ) ;
500
+ ckb_colorshift . checked = false ;
501
+ }
502
+ ckb_colorshift . addEventListener ( 'change' , ( ) => {
503
+ if ( ckb_colorshift . checked ) {
504
+ sendCommand ( "./cmd?colorshift=1" ) ;
505
+ } else {
506
+ sendCommand ( "./cmd?colorshift=0" ) ;
507
+ }
508
+ } ) ;
483
509
484
510
document . getElementById ( "nm_start" ) . value = myVar . nightModeStart . replace ( "-" , ":" ) ;
485
511
document . getElementById ( "nm_end" ) . value = myVar . nightModeEnd . replace ( "-" , ":" ) ;
486
512
document . getElementById ( "brightness" ) . value = parseInt ( myVar . brightness ) ;
513
+ document . getElementById ( "colorshiftspeed" ) . value = parseInt ( myVar . colorshiftspeed ) ;
487
514
488
515
updateDisplay ( parseInt ( myVar . modeid ) ) ;
489
516
console . log ( myVar ) ;
@@ -513,20 +540,26 @@ <h1 id="headline">WORDCLOCK 2.0</h1>
513
540
switch ( modeid ) {
514
541
case 0 : // clock
515
542
document . getElementById ( "colorcontainer" ) . classList . remove ( "hidden" ) ;
543
+ document . getElementById ( "colorshiftcontainer" ) . classList . remove ( "hidden" ) ;
516
544
break ;
517
545
case 1 : // diclock
518
546
document . getElementById ( "colorcontainer" ) . classList . remove ( "hidden" ) ;
547
+ document . getElementById ( "colorshiftcontainer" ) . classList . add ( "hidden" ) ;
519
548
break ;
520
549
case 2 : // spiral
550
+ document . getElementById ( "colorshiftcontainer" ) . classList . add ( "hidden" ) ;
521
551
break ;
522
552
case 3 : // tetris
523
553
document . getElementById ( "tetriscontainer" ) . classList . remove ( "hidden" ) ;
554
+ document . getElementById ( "colorshiftcontainer" ) . classList . add ( "hidden" ) ;
524
555
break ;
525
556
case 4 : // snake
526
557
document . getElementById ( "snakecontainer" ) . classList . remove ( "hidden" ) ;
558
+ document . getElementById ( "colorshiftcontainer" ) . classList . add ( "hidden" ) ;
527
559
break ;
528
560
case 5 : // pingping
529
561
document . getElementById ( "pongcontainer" ) . classList . remove ( "hidden" ) ;
562
+ document . getElementById ( "colorshiftcontainer" ) . classList . add ( "hidden" ) ;
530
563
break ;
531
564
532
565
}
@@ -543,14 +576,17 @@ <h1 id="headline">WORDCLOCK 2.0</h1>
543
576
function saveSettings ( ) {
544
577
var nmStart = document . getElementById ( "nm_start" ) ;
545
578
var nmEnd = document . getElementById ( "nm_end" ) ;
546
- var brightnessElmt = document . getElementById ( "brightness" ) ;
579
+ var sld_brightness = document . getElementById ( "brightness" ) ;
580
+ var sld_colorshiftspeed = document . getElementById ( "colorshiftspeed" ) ;
547
581
var ckb_resetWifi = document . querySelector ( 'input[id="ResetWifi"]' ) ;
548
582
var cmdstr = "./cmd?setting=" ;
549
583
cmdstr += nmStart . value . replace ( ":" , "-" ) ;
550
584
cmdstr += "-" ;
551
585
cmdstr += nmEnd . value . replace ( ":" , "-" ) ;
552
586
cmdstr += "-" ;
553
- cmdstr += brightnessElmt . value ;
587
+ cmdstr += sld_brightness . value ;
588
+ cmdstr += "-" ;
589
+ cmdstr += sld_colorshiftspeed . value ;
554
590
console . log ( cmdstr ) ;
555
591
sendCommand ( cmdstr ) ;
556
592
if ( ckb_resetWifi . checked ) {
0 commit comments