Self repeating countdown timer In webflow

webfloe
<style type="text/css">
#clockdiv{
  font-family: sans-serif;
  color: #fff;
  display: inline-block;
  font-weight: 100;
  text-align: center;
  font-size: 6vw;
}

#clockdiv > div
{
  padding: 2vw;
  border-radius: 3px;
  background: rgb(25,207,144);
  background: linear-gradient(149deg, rgba(25,207,144,1) 0%, rgba(2,175,171,1) 100%);
  display: inline-block;
}

#clockdiv div > span
{
  padding: 15px;
  border-radius: 3px;
  display: inline-block;
}

.smalltext
{
  padding-top: 10px;
  font-size: 16px;
}

    
  </style>

<body>
<div id="clockdiv">
  <div>
    <span class="days"></span>
    <div class="smalltext">Days</div>
  </div>
  <div>
    <span class="hours"></span>
    <div class="smalltext">HRS</div>
  </div>
  <div>
    <span class="minutes"></span>
    <div class="smalltext">MIN</div>
  </div>
  <div>
    <span class="seconds"></span>
    <div class="smalltext">SEC</div>
  </div>
</div>


<script type="text/javascript">
function getTimeRemaining(endtime) {
  const total = Date.parse(endtime) - Date.parse(new Date());
  const seconds = Math.floor((total / 1000) % 60);
  const minutes = Math.floor((total / 1000 / 60) % 60);
  const hours = Math.floor((total / (1000 * 60 * 60)) % 24);
  const days = Math.floor(total / (1000 * 60 * 60 * 24));
  
  return {
    total,
    days,
    hours,
    minutes,
    seconds
  };
}

function initializeClock(id, endtime) {
  const clock = document.getElementById(id);
  const daysSpan = clock.querySelector('.days');
  const hoursSpan = clock.querySelector('.hours');
  const minutesSpan = clock.querySelector('.minutes');
  const secondsSpan = clock.querySelector('.seconds');

  function updateClock() {
    const 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();
  const timeinterval = setInterval(updateClock, 1000);
}

const deadline = new Date(Date.parse(new Date()) + 15 * 24 * 60 * 60 * 1000);
initializeClock('clockdiv', deadline);
</script>