Back to Shopify Liquid
Image with Infinite sliding text
Shopify Liquid

Image with Infinite sliding text

A structured ingredient showcase section featuring a grid layout, custom gradient backgrounds, and a technical specification modal. It includes specialized typography for health/supplement brands and a responsive horizontal-scroll layout for mobile devices.

MediumProduct PageTrustCROIngredientsSales
360 lines · 13.8 KB
Setup 15–25 minutes 5 min read 360 lines
Key features
  • Responsive grid-to-scroll ingredient cards
  • Ingredient modal popup for nutritional facts
  • Custom linear-gradient background styling
  • Icon-supported feature list/badges
  • Optimized mobile touch interface
Best use cases
  • Showcasings vitamin or supplement ingredients and dosages
  • Highlighting product features with technical details
  • Displaying manufacturing standards and dietary certifications
Compatibility
  • Shopify Online Store 2.0
  • Most Shopify themes

The code

Shopify Liquid
1<div id="shopify-section-template--17614983364791__0b4106fb-2713-4c64-9736-b2bf143fc8d7" class="shopify-section">
2 <style>
3 #ingre_c8d7 {
4 position: relative;
5 background: transparent linear-gradient(180deg, #E5F2F6 0%, #FEDCEC 51%, #EDD7FE 100%) 0% 0% no-repeat padding-box;
6 }
7
8 #ingre_c8d7 .section_holder {
9 position: relative;
10 margin: auto;
11 max-width: 1208px;
12 padding: 80px 40px;
13 }
14
15 #ingre_c8d7 .heading {
16 font-family: 'TAN - MEMORIES';
17 font-size: 42px;
18 font-weight: 400;
19 line-height: 45px;
20 margin-bottom: 21px;
21 text-align: center;
22 }
23
24 #ingre_c8d7 .descs {
25 display: flex;
26 justify-content: center;
27 margin-bottom: 42px;
28 }
29
30 #ingre_c8d7 .description a,
31 #ingre_c8d7 .description p,
32 #ingre_c8d7 .description {
33 font: normal normal normal 18px/22px Apercu Pro;
34 letter-spacing: 0px;
35 color: #000000;
36 }
37
38 #ingre_c8d7 .s_desc {
39 font: normal normal normal 18px/22px Apercu Pro;
40 letter-spacing: 0px;
41 margin: 0 28px;
42 padding: 3px 0 3px 33px;
43 background-repeat: no-repeat;
44 background-size: 25px;
45 background-position: left;
46 background-image: url(//spacegoods.com/cdn/shop/t/346/assets/check-violet.svg?v=121176336516853493291722621936);
47 }
48
49 #ingre_c8d7 .description {
50 text-align: center;
51 max-width: 1024px;
52 margin: 0 auto 21px;
53 }
54
55 #ingre_c8d7 .ingre_holder {
56 display: grid;
57 grid-template-columns: 1fr 1fr;
58 gap: 16px;
59 margin-bottom: 32px;
60 }
61
62 #ingre_c8d7 .s_ingre {
63 min-width: 1px;
64 display: flex;
65 background: white;
66 border-radius: 8px;
67 align-items: center;
68 }
69
70 #ingre_c8d7 .ingre_h {
71 font: normal normal bold 21px/16px Apercu Pro;
72 letter-spacing: 0px;
73 color: #1E1E1E;
74 margin-bottom: 5px;
75 }
76
77 #ingre_c8d7 .ingre_w {
78 font: italic normal normal 17px/16px Apercu Pro;
79 letter-spacing: 0px;
80 color: #1E1E1E;
81 margin-bottom: 11px;
82 }
83
84 #ingre_c8d7 .ingre_desc {
85 font: normal normal normal 17px/18px Apercu Pro;
86 letter-spacing: 0px;
87 color: #1E1E1E;
88 }
89
90 #ingre_c8d7 .txt_part {
91 padding: 29px 25px;
92 width: calc(100% - 162px);
93 }
94
95 #ingre_c8d7 .img_part {
96 width: 162px;
97 }
98
99 #ingre_c8d7 .ingre_btn {
100 width: 100%;
101 max-width: 363px;
102 height: 70px;
103 margin: auto;
104 border-radius: 5px;
105 padding: 5px;
106 cursor: pointer;
107 user-select: none;
108 background: linear-gradient(102deg, rgba(114, 76, 233, 1) 0%, rgba(255, 34, 119, 1) 100%);
109 }
110
111 #ingre_c8d7 .ingre_btn>div {
112 display: flex;
113 align-items: center;
114 width: 100%;
115 background: white;
116 border-radius: 5px;
117 height: 60px;
118 padding: 0 15px;
119 }
120
121 #ingre_c8d7 img.nutrition_arrow {
122 margin-left: auto;
123 filter: brightness(0);
124 }
125
126 #ingre_c8d7 .ingre_btn span {
127 font: normal normal normal 21px/26px Apercu Pro;
128 letter-spacing: 0px;
129 color: #000000;
130 }
131
132 #ingre_c8d7 img.nu_icon {
133 width: 28px;
134 margin-right: 8px;
135 }
136
137 #ingre_c8d7 .ingre_table_overlay {
138 position: fixed;
139 left: 0;
140 top: 0;
141 width: 100vw;
142 height: 100vh;
143 background: black;
144 opacity: 0.5;
145 z-index: 2;
146 display: none;
147 }
148
149 #ingre_c8d7 .ingredient_modal {
150 position: fixed;
151 left: 50%;
152 top: 60%;
153 transform: translate(-50%, -50%);
154 width: calc(100% - 25px);
155 max-width: 300px;
156 z-index: 2;
157 display: none;
158 }
159
160 #ingre_c8d7 .ingredient_modal:before {
161 content: '';
162 position: absolute;
163 left: 50%;
164 transform: translateX(-50%);
165 top: -42px;
166 width: 32px;
167 height: 32px;
168 filter: invert(1);
169 background-size: 100%;
170 pointer-events: none;
171 background-image: url(//spacegoods.com/cdn/shop/t/346/assets/black_close.svg?v=21011354507018251241722621935);
172 }
173
174 #ingre_c8d7 .ingredient_modal img {
175 width: 100%;
176 }
177
178 @media screen and (max-width: 900px) {
179 #ingre_c8d7 .section_holder {
180 padding: 45px 15px;
181 }
182 #ingre_c8d7 .heading {
183 font: normal normal 400 24px/32px 'TAN - MEMORIES';
184 margin-bottom: 14px;
185 }
186 #ingre_c8d7 .descs {
187 flex-wrap: wrap;
188 margin-bottom: 16px;
189 }
190 #ingre_c8d7 .description a,
191 #ingre_c8d7 .description p,
192 #ingre_c8d7 .description {
193 font: normal normal 500 13px/15px Apercu Pro;
194 }
195 #ingre_c8d7 .description {
196 margin-bottom: 16px;
197 }
198 #ingre_c8d7 .s_desc {
199 font: normal normal 500 13px/15px Apercu Pro;
200 background-size: 13px;
201 padding: 0 0 0 17px;
202 margin: 0 15px 12px 0;
203 }
204 #ingre_c8d7 .s_desc:last-of-type {
205 margin-right: 0;
206 }
207 #ingre_c8d7 .ingre_holder {
208 display: flex;
209 overflow: auto;
210 gap: unset;
211 margin-right: -15px;
212 }
213 #ingre_c8d7 .s_ingre {
214 min-width: 283px;
215 margin-right: 11px;
216 }
217 #ingre_c8d7 .txt_part {
218 padding: 21px 0px 21px 15px;
219 width: calc(100% - 109px);
220 }
221 #ingre_c8d7 .ingre_h {
222 font: normal normal bold 16px/16px Apercu Pro;
223 }
224 #ingre_c8d7 .ingre_w {
225 font: normal normal normal 14px/16px Apercu Pro;
226 }
227 #ingre_c8d7 .ingre_desc {
228 font: normal normal normal 13px/16px Apercu Pro;
229 }
230 #ingre_c8d7 .img_part {
231 width: 109px;
232 }
233 #ingre_c8d7 .ingre_btn {
234 height: 50px;
235 padding: 4px;
236 }
237 #ingre_c8d7 .ingre_btn>div {
238 height: 42px;
239 padding: 0 14px;
240 }
241 #ingre_c8d7 .ingre_btn span {
242 font: normal normal normal 16px/19px Apercu Pro;
243 }
244 #ingre_c8d7 img.nu_icon {
245 width: 17px;
246 margin-right: 4px;
247 }
248 }
249 </style>
250 <div id="ingre_c8d7">
251 <div class="section_holder">
252 <div class="heading">it's what's inside that counts -</div>
253 <div class="descs">
254 <div class="s_desc">quality ingredients - made in england</div>
255 <div class="s_desc">vegan &amp; keto friendly</div>
256 <div class="s_desc">big dosages: 2-3x stronger</div>
257 </div>
258 <div class="ingre_holder">
259 <div class="s_ingre">
260 <div class="txt_part">
261 <div class="ingre_h">Maitake mushroom</div>
262 <div class="ingre_w">1000 mg</div>
263 <div class="ingre_desc">The 'longevity mushroom' known to be a powerful antioxidant and immune support</div>
264 </div>
265 <div class="img_part"><img src="//spacegoods.com/cdn/shop/files/maitake_web_crop_500x.jpg?v=1697120766" alt="ingredient" class="ingre_img"></div>
266 </div>
267 <div class="s_ingre">
268 <div class="txt_part">
269 <div class="ingre_h">Reishi mushroom</div>
270 <div class="ingre_w">1000 mg</div>
271 <div class="ingre_desc">The 'calm mushroom' - known to reduce stress &amp; is also a powerful immune support</div>
272 </div>
273 <div class="img_part"><img src="//spacegoods.com/cdn/shop/files/reishi_web_square_f314a979-1302-43fd-b62d-4ddb20b03b22_500x.jpg?v=1692173679" alt="ingredient" class="ingre_img"></div>
274 </div>
275 <div class="s_ingre">
276 <div class="txt_part">
277 <div class="ingre_h">Tremella mushroom</div>
278 <div class="ingre_w">1000 mg</div>
279 <div class="ingre_desc">The 'beauty mushroom' - known to support healthy skin, hair &amp; nails</div>
280 </div>
281 <div class="img_part"><img src="//spacegoods.com/cdn/shop/files/tremella_web_crop_500x.jpg?v=1697120950" alt="ingredient" class="ingre_img"></div>
282 </div>
283 <div class="s_ingre">
284 <div class="txt_part">
285 <div class="ingre_h">Magnesium</div>
286 <div class="ingre_w">169 mg</div>
287 <div class="ingre_desc">Essential mineral used to maintain normal blood pressure &amp; reduce inflammation</div>
288 </div>
289 <div class="img_part"><img src="//spacegoods.com/cdn/shop/files/magnesium_web_square_aba7fb31-4bbe-4308-ad06-3ee8a68e7c1e_500x.jpg?v=1692173842" alt="ingredient" class="ingre_img"></div>
290 </div>
291 <div class="s_ingre">
292 <div class="txt_part">
293 <div class="ingre_h">Ashwagandha</div>
294 <div class="ingre_w">500 mg</div>
295 <div class="ingre_desc">An ancient medicinal herb, scientifically proven to reduce stress &amp; anxiety levels</div>
296 </div>
297 <div class="img_part"><img src="//spacegoods.com/cdn/shop/files/02-ingredient_1_500x.png?v=1662967567" alt="ingredient" class="ingre_img"></div>
298 </div>
299 <div class="s_ingre">
300 <div class="txt_part">
301 <div class="ingre_h">Jujube</div>
302 <div class="ingre_w">150 mg</div>
303 <div class="ingre_desc">Fruit ingredient that's been used in traditional medicine for centuries - super high in antioxidants</div>
304 </div>
305 <div class="img_part"><img src="//spacegoods.com/cdn/shop/files/jujube_web_square_copy_5ea29eac-716d-4eb3-b277-c35c952cf7b3_500x.jpg?v=1692173725" alt="ingredient" class="ingre_img"></div>
306 </div>
307 <div class="s_ingre">
308 <div class="txt_part">
309 <div class="ingre_h">L-Glycine</div>
310 <div class="ingre_w">3000 mg</div>
311 <div class="ingre_desc">Amino acid that has a calming effect on the brain &amp; can improve sleep quality</div>
312 </div>
313 <div class="img_part"><img src="//spacegoods.com/cdn/shop/files/L-glycine_web_square_bab2c823-fcf9-421e-bed9-39a1a1a6c838_500x.jpg?v=1692173761" alt="ingredient" class="ingre_img"></div>
314 </div>
315 <div class="s_ingre">
316 <div class="txt_part">
317 <div class="ingre_h">Passion flower</div>
318 <div class="ingre_w">150 mg</div>
319 <div class="ingre_desc">Plant extract commonly used to reduce anxiety and increase feelings of calm</div>
320 </div>
321 <div class="img_part"><img src="//spacegoods.com/cdn/shop/files/blu_flower_884722fa-8c4f-4ae6-8eaa-c8541aed2131_500x.jpg?v=1692173799" alt="ingredient" class="ingre_img"></div>
322 </div>
323 <div class="s_ingre">
324 <div class="txt_part">
325 <div class="ingre_h">Chamomile</div>
326 <div class="ingre_w">100 mg</div>
327 <div class="ingre_desc">Traditional plant ingredient widely used to help the body relax</div>
328 </div>
329 <div class="img_part"><img src="//spacegoods.com/cdn/shop/files/cham_web_square_new_b3eaaa0f-a00c-43f2-b7fb-f577d06f7f35_500x.jpg?v=1692173894" alt="ingredient" class="ingre_img"></div>
330 </div>
331 <div class="s_ingre">
332 <div class="txt_part">
333 <div class="ingre_h">L-Tryptophan</div>
334 <div class="ingre_w">220 mg</div>
335 <div class="ingre_desc">Amino acid known to improve mood &amp; support sleep</div>
336 </div>
337 <div class="img_part"><img src="//spacegoods.com/cdn/shop/files/L-tryptophan_web_square_944b8883-1b15-4a58-b1e7-2e54c94e4143_500x.jpg?v=1692173874" alt="ingredient" class="ingre_img"></div>
338 </div>
339 </div>
340 </div>
341 </div>
342 <script>
343 $('#ingre_c8d7 .ingre_btn').click(function() {
344 show_ingre_popup();
345 });
346 $('#ingre_c8d7 .ingre_table_overlay').click(function() {
347 hide_ingre_popup();
348 });
349
350 function show_ingre_popup() {
351 $('#ingre_c8d7 .ingre_table_overlay').fadeIn(400);
352 $('#ingre_c8d7 .ingredient_modal').fadeIn(300);
353 }
354
355 function hide_ingre_popup() {
356 $('#ingre_c8d7 .ingre_table_overlay').fadeOut(400);
357 $('#ingre_c8d7 .ingredient_modal').fadeOut(300);
358 }
359 </script>
360</div>

How to install Image with Infinite sliding text on your Shopify theme

This snippet belongs in sections/main-product.liquid, directly under the Add to cart button, where it reinforces the purchase decision. Expect the whole job to take about 15–25 minutes.

  1. 1From your Shopify admin, open Online Store → Themes, click the button on your live theme and choose Duplicate. Always work on a copy so you can roll back instantly.
  2. 2On the duplicated theme, click … → Edit code to open the theme code editor.
  3. 3Open sections/main-product.liquid in the file tree. If your theme uses different file names, search for the template that renders the area where you want the block to show up.
  4. 4Click Copy code on this page, then paste the snippet directly under the Add to cart button, where it reinforces the purchase decision.
  5. 5The snippet ships with its own scoped <style> block, so you do not need to touch base.css or theme.css. If you prefer to keep CSS centralised, move the contents of the style tag into your theme stylesheet and delete the inline block.
  6. 6Keep the <script> tag at the end of the snippet. It only runs once the surrounding markup exists in the DOM, so moving it higher up the file can break the behaviour.
  7. 7Click Save, then hit Preview and check the block on desktop, tablet and mobile widths.
  8. 8When you are happy with the result, publish the duplicated theme from Online Store → Themes → Actions → Publish.

How to customise it

Every value below lives inside the snippet, so you can adapt Image with Infinite sliding text to your brand without touching the rest of the theme.

  • Colours — the snippet uses #E5F2F6, #FEDCEC, #EDD7FE, #000000. Replace those values inside the style block with your brand palette, keeping at least a 4.5:1 contrast ratio between text and background so the block stays accessible.
  • Gradient — swap the linear-gradient(...) declaration for a flat background colour if you want a more minimal, theme-native look.
  • Typography — the block declares font-family: 'TAN - MEMORIES'. Delete that line to inherit your theme font instead, which usually looks better integrated.
  • Sizing — adjust the font-size values (42px) and the padding so the block carries the same visual weight as the elements around it.
  • Cornersborder-radius: 8px controls the roundness. Set it to 0 for a sharper editorial look, or increase it for a softer, app-like feel.
  • Images — replace the placeholder image URLs with your own assets. Upload them under Content → Files in Shopify admin and use the generated CDN URL, or reference a theme asset with {{ 'my-image.png' | asset_url }}.
  • Copy — rewrite the hard-coded text (for example “it's what's inside that counts -”) in your own brand voice, and translate it if you sell in more than one language.
  • Responsive behaviour — the @media query defines the mobile breakpoint. Adjust the pixel value if your theme uses a different breakpoint scale.

Common mistakes to avoid

These are the issues merchants run into most often when installing a snippet like this one.

  • Editing the live theme directly. Duplicate it first — a single unbalanced Liquid tag can take a storefront down mid-campaign.
  • Pasting the code into the wrong file. Dropped into layout/theme.liquid instead of sections/main-product.liquid, this block will render on every page of the store, including ones where it makes no sense.
  • Renaming the CSS classes in the markup but not in the style block, or vice versa. The class names have to match exactly or the styling silently disappears.
  • Adding the snippet twice on the same page. The script targets its selector, so two copies can conflict or double-fire.
  • Publishing without testing on a real phone. Most Shopify traffic is mobile, and layout problems almost always surface there first.

Performance notes

What this block costs you in load time, and how to keep that cost at zero.

  • The CSS is inline and scoped to this block, so it adds no extra network request. At a few kilobytes it has no measurable effect on your Lighthouse score.
  • The JavaScript is vanilla — no jQuery, no external library, no additional request. Keep it after the markup so it never blocks rendering.
  • Add loading="lazy" plus explicit width and height attributes to every image in the snippet. That prevents Cumulative Layout Shift, which is a Core Web Vitals ranking factor.
  • Run PageSpeed Insights before and after you add the block so you have a concrete number rather than a guess.

SEO & accessibility

How to add this block without damaging your on-page structure or your rich results.

  • Nothing in this snippet should replace your page <h1>. Keep product and page headings intact and use <h2> or <h3> for the block's own heading so the document outline stays clean.
  • Write a descriptive alt attribute for every image. Empty or generic alt text is one of the most common accessibility and SEO issues on Shopify stores.
  • If the block shows review or rating content, keep it consistent with the structured data your review app already outputs. Duplicating or contradicting rating markup can cost you the rich result entirely.
  • The block does not create a new URL, so there is no canonical or indexing change to make. It improves on-page engagement signals rather than crawlability.
Frequently asked questions

Image with Infinite sliding text — questions merchants ask

Will this snippet work with my theme?

It is built with standard Liquid, HTML and CSS, so it works with Dawn and virtually every Online Store 2.0 theme, as well as most vintage themes. The only thing that changes between themes is the file you paste it into — if yours has no sections/main-product.liquid, look for the equivalent template that renders the same area.

Do I need an app to use it?

No. This is theme code you own outright: no monthly fee, no third-party script tag, and no app that can break your storefront the next time it updates.

How long does it take to add “Image with Infinite sliding text” to a store?

Most merchants have it live in under fifteen minutes — duplicate the theme, paste the code, adjust the colours and copy, preview on mobile, publish.

The block appears but nothing happens. What is wrong?

That is almost always a script-order problem. Check that the script tag is still at the bottom of the snippet and that the markup was not pasted inside another script or a Liquid comment block. Open your browser console and look for an error naming the snippet's selector.

The styling looks broken after pasting. How do I fix it?

Confirm you copied the whole snippet including the closing style tag, then check whether one of your theme's own CSS rules is overriding it. If a theme rule wins, increase the specificity of the snippet's selector rather than scattering !important through the file.

Will it slow my store down?

Not meaningfully. It is inline markup with scoped CSS and at most a few lines of vanilla JavaScript — no external libraries, no extra HTTP request. Optimising your product images will always have a far bigger impact on load time.

Can I use it on a client store or a commercial project?

Yes. Every snippet in the MCO Hub library is free to copy, modify and ship on any store, including client work. Attribution is appreciated but not required.

Related snippets

Keep exploring