Background and Font Color: Tailor the background and font colors to match your store's branding.
Scrolling Speed: Adjust the scroll time to control how fast or slow the text moves across the screen.
Font Size: Fine-tune the font size to ensure optimal readability on different devices.
Pause on Hover: Choose whether the text pauses when a user hovers over it, adding interactivity to the marquee.
Scroll Direction: Select whether the text moves from left to right or right to left, depending on your preference.
Padding: Customize the padding to ensure the marquee text fits seamlessly within your store's layout.
Implementation
To implement this advanced marquee text effect in your Shopify store:
Access Theme Code: Navigate to your Shopify admin dashboard and access your theme code editor.
Insert Custom Code: Add the provided HTML, CSS, and Liquid code to the appropriate theme files. Ensure to replace any existing marquee text code with the new advanced version.
Customize Settings: Within the Shopify editor, customize the marquee text settings using the intuitive interface provided.
Preview and Publish: Preview your changes to ensure everything looks as expected. Once satisfied, publish your theme to make the advanced marquee text live on your store.
<style>
#id-{{ section.id }}.marquee-text-wrapper {
--space: 2rem;
display: grid;
align-content: center;
overflow: hidden;
gap: var(--space);
width: 100%;
font-size: 1.5rem;
line-height: 1.5;
padding-top:{{ section.settings.padding_top}}px;
padding-bottom:{{ section.settings.padding_bottom }}px;
background-color: {{ section.settings.bg_color }};
}
#id-{{ section.id }} .marquee {
--duration: 10s;
--gap: var(--space);
display: flex;
overflow: hidden;
user-select: none;
gap: var(--gap);
}
#id-{{ section.id }} .marquee__group {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: space-around;
gap: var(--gap);
min-width: 100%;
animation: scroll var(--duration) linear infinite;
}
#id-{{ section.id }} .marquee__group p{
margin-top: 0;
margin-bottom: 0;
}
#id-{{ section.id }} .marquee__group p {
color: {{ section.settings.font_color }};
font-size: {{ section.settings.font_size}}px;
}
#id-{{ section.id }} .marquee--borders {
padding-block: 0.75rem;
}
#id-{{ section.id }} .marquee--reverse .marquee__group {
animation-direction: reverse;
animation-delay: calc(var(--duration) / -2);
}
@keyframes scroll {
0% {
transform: translateX(0);
}
100% {
transform: translateX(calc(-100% - var(--gap)));
}
}
#id-{{ section.id }} .marquee:hover .marquee__group {
animation-play-state: {{ section.settings.pause_text }};
}
@media (max-width: 600px) {
#id-{{ section.id }}.marquee-text-wrapper {
padding-top:{{ section.settings.m_padding_top}}px;
padding-bottom:{{ section.settings.m_padding_bottom }}px;
}
}
</style>
<section class="marquee-text-wrapper" id=id-{{ section.id }}>
<div class="marquee marquee--borders {{ section.settings.scroll_text_move }}" style="--duration: {{ section.settings.scroll_time }}s">
<div class="marquee__group">
{% for block in section.blocks %}
<p>{{ block.settings.text }}</p>
{% endfor %}
</div>
<div class="marquee__group">
{% for block in section.blocks %}
<p>{{ block.settings.text }}</p>
{% endfor %}
</div>
</div>
</section>
{% schema %}
{
"name": "Marquee Text",
"settings": [
{
"type": "color",
"id": "bg_color",
"label": "Background Color"
},
{
"type": "color",
"id": "font_color",
"label": "Font color",
"default": "#000000"
},
{
"type": "text",
"label": "Scroll Time",
"id": "scroll_time",
"default": "10"
},
{
"type": "range",
"id": "font_size",
"min": 8,
"max": 50,
"step": 1,
"unit": "px",
"label": "Font size",
"default": 14
},
{
"type": "select",
"id": "scroll_text_move",
"label": "Scroll text move from",
"options": [
{
"value": "marquee-left",
"label": "Left"
},
{
"value": "marquee--reverse",
"label": "Right"
}
],
"default": "marquee-left"
},
{
"type": "select",
"id": "pause_text",
"label": "Pause text on mouse hover",
"options": [
{
"value": "paused",
"label": "Yes"
},
{
"value": "initial",
"label": "No"
}
],
"default": "paused"
},
{
"type":"header",
"content":"Padding for desktop"
},
{
"type": "range",
"id": "padding_top",
"min": 0,
"max": 50,
"step": 1,
"unit": "px",
"label": "Padding Top",
"default": 16
},
{
"type": "range",
"id": "padding_bottom",
"min": 0,
"max": 50,
"step": 1,
"unit": "px",
"label": "Padding Bottom",
"default": 16
},
{
"type":"header",
"content":"Padding for mobile"
},
{
"type": "range",
"id": "m_padding_top",
"min": 0,
"max": 50,
"step": 1,
"unit": "px",
"label": "Padding Top",
"default": 16
},
{
"type": "range",
"id": "m_padding_bottom",
"min": 0,
"max": 50,
"step": 1,
"unit": "px",
"label": "Padding Bottom",
"default": 16
}
],
"blocks": [
{
"name": "mMarquee text",
"type": "block",
"settings": [
{
"type": "text",
"label": "Add Text",
"id": "text",
"default":"Marquee"
}
]
}
],
"presets":[
{
"name":"Marquee Text",
"blocks": [
{
"type": "block"
},
{
"type": "block"
},
{
"type": "block"
},
{
"type": "block"
},
{
"type": "block"
}
]
}
]
}
{% endschema %}
thanku so much , i am asia iqbal i followd yod on youtube as biglogo marketing you solved my problem can i contact you when i need your services foe shopify i am a shopify developer often i need help in codin kindly drop your whatapp so i can contact you
ReplyDeleteHi Asia iqbal
DeleteNice to meet you. 😊
Please text me on my email id shopifycheatcode@gmail.com.
Your post added a refreshing perspective to my day! Keep up the great work, looking forward to more!
ReplyDeleteThank you.. 😊
DeleteI have received a lot of help by watching your video. The task that someone was doing for money, you have done it for me for free. I am following you. You have truly provided a lot of assistance.thankyou so much
ReplyDeleteThanku so much.... ☺☺
DeleteHello ! How can I make it responsive for mobile device ? Thank you :)
ReplyDeleteI think it's responsive for mobile.
DeleteEvery time I visit, I learn something new and exciting. Keep up the fantastic work!
ReplyDeletethank you so much.
ReplyDeleteWelcome :)
Deleteit dose not let me backspace
ReplyDeleteI didn't quite understand what you're referring to. Could you please explain it with a screenshot in an email? That will help me assist you better!
Deletehey text is going from left to write but no repeating
ReplyDeleteThank you so much! Is it possible to change the font too?
ReplyDeleteYes it is possible.. Please message me on my email id. 😊
Delete