Rumah > Soal Jawab > teks badan
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>
--------------------------------Fail 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; }
Di mana, X.time ialah ambang masa, selepas masa ini, cincin di sekeliling harus kekal putih, dan di bawah masa ini, ia akan bertukar menjadi merah.