my theme doesn’t support a marquee animated announcement bar. i’ve also had a look at numerous other discussion posts and attempted to add, delete or replace code in the announcement-bar.liquid file. none of them have worked, and work to avail.
i had a previous set of code that was attached however, the text would flicker once the phrases reach a certain point in the announcement bar. i do no want this, and would like it to be an infinite scrolling type text animation where it transitions to off screen then back on screen.
the code that was previously attached:
.hd-AnnouncementBar{max-height:40px;width:100vw;background-color:#000;overflow:hidden;transition:max-height .3s ease}.hd-Banner-fixed .hd-AnnouncementBar{max-height:0}.hd-AnnouncementBar_Ticker{display:flex;padding-top:6px;padding-bottom:7px;font-size:10px;font-weight:400;letter-spacing:.3px;line-height:12px;text-transform:uppercase;background-color:#000;color:#fff}@media only screen and (min-width: 768px){.hd-AnnouncementBar_Ticker{width:200vw}}.hd-AnnouncementBar_Items{flex:1 1 100%;display:flex;animation:Ticker var(--Animation_Duration, 15s) infinite linear}.hd-AnnouncementBar:hover .hd-AnnouncementBar_Items{animation-play-state:paused}.hd-AnnouncementBar_Item{align-items:center;flex:1 1 10%;display:flex;padding-right:50px;text-align:center}@media only screen and (min-width: 768px){.hd-AnnouncementBar_Item{padding-right:0}}.hd-AnnouncementBar_Text{white-space:nowrap;overflow:hidden}@keyframes Ticker{to{transform:translate(-100%)}}
UX Caveat: Always a/b test things like this and be aware of accessibility prefers-reduced-motion preferences. Moreso when a sites frontpage already has a ton of UI noise all competing for the customers visual attention.
Marquees can be an anti-pattern there is a reason they were removed completely from html just like the tag. Read increase bounce rates and decrease conversions.
With UI changes like this when looking at discussions pay attention to the low amount of time professionals contribute to it or their lack of shared live samples vs the number of merchants doing it because they saw another site doing but have no real data or logic backing a desire to add it to a page and the complete lack of follow up that it increased conversions or other metrics.
It’s the same problem as slideshows trying to cram more into limited real estate hoping something from of a set of things stands out in relevance instead of properly prioritizing single high value messaging that’s been vetted to stand alone like a hero image. Then theirs the performance impact of having animations right out the gate at the very top of a page.
An indication this can be an annoying anti-pattern for a business customers is if it does not already have developers on hand to both create the change and vet it through a/b testing.
If despite warnings you still want to try and fix this:
This is typically because the animations are not overlapping properly and abruptly ending or related javascript isn’t pre-emptively duplicating elements before deletion and all types of other reasones, etc.
A common fix is to just duplicate all the text related elements so the scroll width is technically bigger than the page being viewed but hidden offpage. Or faking the duplication of text by using CSS text shadows with very large horizontal offsets. Alternatively using a mid way cross-fade transition to hide any flicker from the scroll resetting to origin.