JSFiddle - React, Tailwind, and code Playground
by anoopsuda
HTML
<div class="alert-bar">
<div class="alert-label">
<span class="icon">⚠️</span> Alerts
</div>
<div class="alert-marquee">
<div 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.
</div>
</div>
</div>
CSS
/* 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;
}
/* Label section */
.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;
white-space: nowrap;
padding-left: 15px;
flex: 1;
}
/* Animated scrolling text */
.marquee-text {
display: inline-block;
font-size: 14px;
color: #7d0b0b;
animation: scroll-left 18s linear infinite;
font-family: Graphik;
font-weight: 500;
font-style: Medium;
font-size: 14px;
}
/* Animation */
@keyframes scroll-left {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(-100%);
}
}