LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
CSS
html {
  background-color: #4472C4;
}

#root {
  font-family: "Fjalla One", sans-serif;
}

#calendar {
  background-color: #ed7057;
  width: 200px;
  height: 300px;
  padding: 20px;
  margin: 0 auto;
  margin-top: 50px;
  box-shadow: 8px 8px 0.01px #444444;
  border-radius: 3px;
  border-top: 25px solid #355999;
  color: white;
}

#day {
  width: 100px;
  padding: 10px 25%;
  color: #525151;
  text-align: center;
  color: white;
}

#weekday {
  margin: -25px 25% 30px 25%;
  color: white;
  text-align: center;
}

#date {
  width: 150px;
  height: 120px;
  font-size: 80px;
  background-color: #F4F6F5;
  box-shadow: 2px 2px 5px #444444;
  color: #525151;
  border-radius: 5px;
  margin: 0 auto;
  text-align: center;
  padding-top: 30px;
}

#time_now {
  color: #525151;
  border-radius: 5px;
  font-size: 20px;
  padding: 10px;
  margin-top: -20px;
  background-color: #E4E1E1;
  text-align: center;
}

h1 {
  font-size: 50px;
  font-weight: 700;
  color: white;
  text-align: center;
}
JS
function tick(){
        var week = new Array("Sunday","Monday","Tuesday","Wednesday",
                                    "Thursday","Friday","Saturday")
        const element = (
          

Cherish EVERY MOMENT!

{new Date().getDate()}

{new Date().getFullYear()} / {new Date().getMonth()+1}

{week[new Date().getDay()]}

{new Date().toLocaleTimeString().split("上午")}

) ReactDOM.render( element, document.getElementById('root') ); } setInterval(tick, 1000);

Description

rendering out date and time with reactJS
Term
Wed, 12/27/2017 - 06:56

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv