File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed
Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ function timer() {
5353
5454 if ( seconds <= 10 ) {
5555 TIMER_STATUS = TimerStatus . COUNTDOWN ;
56- styleCountdown ( seconds ) ;
56+ styleBlinkCountdown ( seconds ) ;
5757 }
5858
5959 setInputValues ( seconds ) ;
@@ -188,14 +188,27 @@ const styles = {
188188function applyStyles ( ) {
189189 resetStyles ( ) ;
190190 styles [ TIMER_STATUS ] ?. ( ) ;
191- }
191+ } ;
192192
193- function styleCountdown ( seconds = 0 ) {
193+ function styleBlinkCountdown ( seconds = 10 ) {
194194 document . querySelector ( ".input-stopwatch" ) . classList . add ( "hide" ) ;
195195 document . querySelector ( ".js-stopwatch-button" ) . classList . add ( "hide" ) ;
196196 document . getElementById ( "countdown" ) . classList . remove ( "hide" ) ;
197197 document . getElementById ( "countdown-number" ) . textContent = seconds ;
198- }
198+
199+ // Alterna a cor a cada segundo
200+ if ( seconds % 2 === 0 ) {
201+ document . getElementById ( "countdown" ) . style . backgroundColor = "#46ffbe" ;
202+ document . getElementById ( "countdown-number" ) . style . color = "#444444" ;
203+ } else {
204+ document . getElementById ( "countdown" ) . style . backgroundColor = "#242424" ;
205+ document . getElementById ( "countdown-number" ) . style . color = "#46ffbe" ;
206+ }
207+ } ;
208+
209+ // function styleCountdown(seconds = 0) {
210+
211+ // }
199212
200213function styleRunning ( ) {
201214 document . querySelector ( ".js-play-button" ) . classList . add ( "press-start" ) ;
Original file line number Diff line number Diff line change @@ -86,7 +86,13 @@ input::-webkit-inner-spin-button {
8686
8787input [type = number ] {
8888 /* ta aparecendo um warning aqui pra mim, mas não sei arrumar, talvez eu seja burro */
89- -moz-appearance : textfield;
89+ /*
90+ Cara tu não é burro -moz-appearance é específica para Firefox
91+ Para melhorar compatibilidade adicionei duas duas propriedades
92+ */
93+ -moz-appearance : textfield; /* Para Firefox */
94+ -webkit-appearance : none; /* Para Chrome, Safari, Edge */
95+ appearance : none; /* Padrão - navegadores mais modernos */
9096}
9197
9298# countdown {
You can’t perform that action at this time.
0 commit comments