Heim > Fragen und Antworten > Hauptteil
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>
---------------------------CSS File----------------------------------------
.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; }
其中,X.time是一个时间阈值,超过这个时间,环绕的环应该保持白色,而在小于这个时间时,它将变为红色。