{% extends is_mobile.check ? '@templates/Mobile/Shop/layout.html.twig' : '@templates/Front/Shop/layout.html.twig' %}
{% block content %}
<div class="card shadow my-5 mx-5 text-center">
<div class="card-header">
<h2>{{ 'app.ui.maintenance_on'|trans }}</h2>
</div>
<div class="card-body">
<p id="countDown">
</p>
</div>
</div>
<script>
$(document).ready(function () {
let countDownDate = new Date();
if (countDownDate.getHours() !== 0) {
countDownDate.setDate(countDownDate.getDate() + 1);
}
countDownDate.setHours(0,6,0,0);
countDownDate = countDownDate.getTime();
let x = setInterval(function () {
let now = new Date().getTime();
let distance = countDownDate - now;
let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
let seconds = Math.floor((distance % (1000 * 60)) / 1000);
$('#countDown').html(hours + "h "
+ minutes + "m " + seconds + "s ");
if (distance < 0) {
clearInterval(x);
//window.location.href='/';
}
}, 1000);
});
</script>
{% endblock %}