Shopify themes, liquid, logos, and UX
Can someone show me how to add a moving announcement bar exactly like this website?
This is my website and you can see the static announcement bar: https://ariasound.co/
To add this you need to add marquee code in announcement bar
Can you give me the exact code?
Here's a step-by-step guide to help you out:
- From your Shopify admin, go to "Online Store" and then click on "Themes."
- Find the "Motion with Installments" theme and click on the "Actions" button, then select "Edit code" from the dropdown menu.
- In the list of theme files on the left-hand side, locate and click on "theme.liquid" to open it.
- Scroll down the code until you find the <header> section, which represents the header of your website.
- In this section, you'll need to add the code for the announcement bar slider. You can use HTML, CSS, and JavaScript to achieve the desired effect. Here's an example of the code structure you can use:
<div id="announcement-slider">
<ul>
<li>Announcement 1</li>
<li>Announcement 2</li>
<li>Announcement 3</li>
</ul>
</div>
<style>
#announcement-slider {
overflow: hidden;
white-space: nowrap;
}
#announcement-slider ul {
list-style: none;
padding: 0;
margin: 0;
animation: marquee 15s linear infinite;
}
#announcement-slider li {
display: inline-block;
padding: 0 10px;
}
@keyframes marquee {
0% { transform: translateX(100%); }
100% { transform: translateX(-100%); }
}
</style>
- Once you've added the code, click on the "Save" button to apply the changes.
This worked as a guide but as I do not know any code I don't know how to make it the way I want it to be. As given in the reference (https://sonix.audio/), I want the announcements to be evenly spaced from each other and move at a slower rate. Could you give me the exact code needed for this?
Try the below one:
<div class="announcement__text">
<ul>
<li>Announcement 1</li>
<li>Announcement 2</li>
<li>Announcement 3</li>
</ul>
</div>
<style>
.announcement__text {
overflow: hidden;
white-space: nowrap;
}
.announcement__text ul {
list-style: none;
padding: 0;
margin: 0;
animation: marquee 50s linear infinite;
}
.announcement__text li {
display: inline-block;
padding: 0 10px;
width:33.33%;
}
@keyframes marquee {
0% { transform: translateX(100%); }
100% { transform: translateX(-100%); }
}
@media(max-width:991px){
.announcement__text li{width:100%;}
.announcement__text ul{animation: marquee 30s linear infinite;}
}
</style>
User | RANK |
---|---|
143 | |
96 | |
76 | |
70 | |
69 |
This blog post is a recap of the webinar Getting Ready For BFCM: How To Run A Flash Sal...
By Jacqui Oct 3, 2023Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023