JSFiddle - React, Tailwind, and code Playground
by yash009
HTML
<div class="container">
<div class="row" style="padding-top: 60px">
<div class="col-sm-3"></div>
<div class="col-md-6">
<div style="height:160px;text-align: center;">
<img id="logo" src="images/logo_1.png">
</div>
<br>
<div id="page-wrap" style="height: auto px;">
<div class="row" id="main-content">
<div class="col-sm-12" id="guts">
<h2 style="color: #242424">Contact</h2>
<br>
<div class="row">
<div class="col-sm-6">
<div id="map"></div>
</div>
<div class="col-sm-6">
<br>
<form id="contact-form" method="post" action="contact-form-handler.php">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
CSS
/* Set the size of the div element that contains the map */
#map {
height: 400px; /* The height is 400 pixels */
width: 100%; /* The width is the width of the web page */
}
JavaScript
//JS Countdown
var countDownDate = new Date("Feb 13, 2019 23:59:00");
initializeClock('cd-clock', countDownDate);
function getTimeRemaining(endtime) {
var t = Date.parse(endtime) - Date.parse(new Date());
var seconds = Math.floor((t / 1000) % 60);
var minutes = Math.floor((t / 1000 / 60) % 60);
var hours = Math.floor((t / (1000 * 60 * 60)) % 24);
var days = Math.floor(t / (1000 * 60 * 60 * 24));
return {
'total': t,
'days': days,
'hours': hours,
'minutes': minutes,
'seconds': seconds
};
}
function initializeClock(id, endtime) {
var clock = document.getElementById(id);
var daysSpan = clock.querySelector('.days');
var hoursSpan = clock.querySelector('.hours');
var minutesSpan = clock.querySelector('.minutes');
var secondsSpan = clock.querySelector('.seconds');
function updateClock() {
var t = getTimeRemaining(endtime);
daysSpan.innerHTML = t.days;
hoursSpan.innerHTML = ('0' + t.hours).slice(-2);
minutesSpan.innerHTML = ('0' + t.minutes).slice(-2);
secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);
if (t.total <= 0) {
clearInterval(timeinterval);
}
}
updateClock();
var timeinterval = setInterval(updateClock, 1000);
}