Alert Marquee
by anoopsuda
HTML
<div class="alert-bar">
<div class="alert-label">
<span class="icon">⚠️ </span> Alerts
</div>
<div class="alert-marquee">
<div class="marquee-track">
<span class="marquee-text">
Due to a planned Postgres upgrade, MyInnovation portal and dashboard metrics will remain non-updated from 9 AM–9 PM IST today. Apologies for the inconvenience.
</span>
<span class="marquee-text">
Due to a planned Postgres upgrade, MyInnovation portal and dashboard metrics will remain non-updated from 9 AM–9 PM IST today. Apologies for the inconvenience.
</span>
</div>
</div>
</div>
CSS
/* Alert bar wrapper */
.alert-bar {
width: 100%;
background: #ffe6e6;
border-top: 1px solid #7d0b0b;
border-bottom: 1px solid #7d0b0b;
display: flex;
align-items: center;
font-family: Arial, sans-serif;height:39px;
}
/* Left label */
.alert-label {
background: #a30e0e;
color: #fff;
padding: 10px 18px;
display: flex;
align-items: center;
font-weight: bold;
font-size: 14px;
white-space: nowrap;border-radius:0 50px 50px 0;
}
.alert-label .icon {
margin-right: 6px;
}
/* Marquee container */
.alert-marquee {
overflow: hidden;
flex: 1;
padding: 0 10px;
white-space: nowrap;
position: relative;
}
/* Track that holds duplicated text */
.marquee-track {
display: inline-flex;
white-space: nowrap;
animation: marquee 18s linear infinite;
}
/* Actual marquee text */
.marquee-text {
color: #7d0b0b;
font-size: 14px;
padding-right: 60px; /* Spacing between repeats */
font-family: Graphik;
font-weight: 500;
font-style: Medium;
font-size: 14px;
}
/* Seamless scroll animation */
@keyframes marquee {
from {
transform: translateX(0);
}
to {
transform: translateX(-50%);
}
}