Try the below alternative:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Horizontal Scroller</title>
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap" rel="stylesheet">
<style>
* {
box-sizing: border-box;
}
.scroller {
display: flex;
align-items: center;
position: relative;
width: 45%;
margin: 0 auto;
background-color: #990000;
height: 2.4em;
overflow: hidden;
border-radius: 4px;
}
.scrollerText {
position: absolute;
font-family: 'Courier Prime', monospace;
color: #fff;
text-transform: uppercase;
white-space: nowrap;
margin-left: 100%;
padding: 5px 0 5px 0;
}
.scrollerAnimate {
transition: margin 15s linear;
}
</style>
</head>
<body>
<div class="scroller">
<div class="scrollerText">
Due to covid-19 we are closed till May 04 - thankyou for your understanding.
</div>
</div>
<!-- end scroller -->
<script>
const scrollerText = document.querySelector('.scrollerText');
const scrollerTextWidth = scrollerText.offsetWidth;
function scroller() {
setTimeout(function(){
scrollerText.style.marginLeft = '-' + scrollerTextWidth + 'px';
scrollerText.classList.add('scrollerAnimate');
}, 200);
}
setInterval(function(){
scrollerText.style.marginLeft = '100%';
scrollerText.classList.remove('scrollerAnimate');
scroller();
}, 15500);
scroller();
</script>
</body>
</html>