Maison > Questions et réponses > le corps du texte
P粉1112278982023-07-25 14:50:52
<div> {remaining.Time.seconds > X.time?( <div className="countdown-timer"> <span>{remainingTime.hours}</span> <span>:</span> <span>{remainingTime.minutes}</span> <span>:</span> <span>{remainingTime.seconds}</span> </div>):( <div className="countdown-timer2"> <span>{remainingTime.hours}</span> <span>:</span> <span>{remainingTime.minutes}</span> <span>:</span> <span>{remainingTime.seconds}</span> </div> ) } </div>
-----------------------------Fichier CSS----------------- --------- ------------------
.countdown-timer { width: 400px; height: 400px; border: 6px solid white; border-radius: 50%; box-shadow: black; font-family: "DM Sans"; font-size: 72px; display: flex; justify-content: center; align-items: center; margin-top: 10px; margin-left: auto; margin-right: auto; } .countdown-timer2 { width: 400px; height: 400px; border: 6px solid white; border-radius: 50%; box-shadow: black; border-color: red; font-family: "DM Sans"; font-size: 72px; display: flex; justify-content: center; align-items: center; margin-top: 10px; margin-left: auto; margin-right: auto; }
Où X.time est un seuil de temps, au-delà de ce temps, l'anneau environnant doit rester blanc, et en dessous de ce temps, il deviendra rouge.