This is my small code for a „infinite scroll looped announcement bar“:
{%- if template.name != ‘product’ -%}
.custom-scrolling-banner { background-color: {{ section.settings.bg_color }}; color: {{ section.settings.text_color }}; overflow: hidden; position: absolute; top: 0; left: 0; width: 100%; height: 40px; display: flex; align-items: center; z-index: 1001; box-sizing: border-box; } .custom-scrolling-banner__viewport { width: 100%; overflow: hidden; display: flex; } .custom-scrolling-banner__content { display: flex; flex-wrap: nowrap; animation: marquee {{ section.settings.speed }}s linear infinite; will-change: transform; /* This ensures the content doesn't shrink */ min-width: fit-content; } .custom-scrolling-banner__track { display: flex; align-items: center; flex-shrink: 0; } .custom-scrolling-banner__item-wrapper { display: flex; align-items: center; white-space: nowrap; } .custom-scrolling-banner__item { font-family: 'GeistMono-Light', 'Gramatika', Arial, Helvetica, sans-serif !important; font-weight: 300 !important; letter-spacing: .02em !important; font-size: 13px; padding: 0 4.5rem; white-space: nowrap; } .custom-scrolling-banner__image { height: 25.2px; width: auto; object-fit: contain; display: block; flex-shrink: 0; } @keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }{% assign icon_url = “https://cdn.shopify.com/s/files/1/0905/3110/3066/files/IMG_5962.png?v=1783437862” %}
{%- endif -%}
{% schema %}
{
“name”: “Scrolling Announcement”,
“settings”: [
{ “type”: “range”, “id”: “speed”, “min”: 20, “max”: 200, “step”: 5, “unit”: “s”, “label”: “Scrolling Speed”, “default”: 60 },
{ “type”: “color”, “id”: “bg_color”, “label”: “Background Color”, “default”: “#000000” },
{ “type”: “color”, “id”: “text_color”, “label”: “Text Color”, “default”: “#ffffff” }
],
“blocks”: [
{ “type”: “announcement”, “name”: “Announcement”, “settings”: [{ “type”: “text”, “id”: “text”, “label”: “Text”, “default”: “Welcome” }] }
],
“presets”: [{ “name”: “Scrolling Announcement” }]
}
{% endschema %}
Problem is that after having run once (everytime) through all the announcements, there is a black flash before re-starting the loop. And i cannot fix that flash. Can someone help me remove that flash everytime?

