How to make inventory status icon animated?

How to make inventory status icon animated?

Lucas1200
Tourist
25 0 4

I see in multiple shopify stores that the icon at inventory status is animated. It looks like the icon is alive and moving. Do you have any idea how I can make it like that?
My store id is2e208a.myshopify.com


Scherm­afbeelding 2024-08-30 om 11.45.04.png

Replies 7 (7)

Hamza_Hussain
Shopify Partner
50 4 13

Can you provide your Shop URL

 

Honey G Hamza
Lucas1200
Tourist
25 0 4

https://www.vedettemaison.com/ here you go 🙂

Hamza_Hussain
Shopify Partner
50 4 13

Now there are two ways to this the most easy one is just replace the SVG code with the one below

<svg width="15" height="15" aria-hidden="true">
  <circle cx="7.5" cy="7.5" r="7.5" fill="rgba(238,148,65, 0.3)">
    <!-- Animate scaling (pulsing) -->
    <animateTransform attributeName="transform" type="scale"
      values="1;1.2;1" keyTimes="0;0.5;1"
      dur="1.5s" repeatCount="indefinite"/>
    <!-- Animate opacity -->
    <animate attributeName="opacity"
      values="1;0.6;1" keyTimes="0;0.5;1"
      dur="1.5s" repeatCount="indefinite"/>
  </circle>
  
  <circle cx="7.5" cy="7.5" r="5" stroke="rgb(255, 255, 255)" stroke-width="1" fill="rgb(238,148,65)">
    <!-- Animate scaling for the inner circle -->
    <animateTransform attributeName="transform" type="scale"
      values="1;1.2;1" keyTimes="0;0.5;1"
      dur="1.5s" repeatCount="indefinite"/>
  </circle>
</svg>

 

If you don't like the above code then you can add a class to the SVG tag and add CSS to animate it like below

 

<svg width="15" height="15" aria-hidden="true" class="beeping-heart">
  <circle cx="7.5" cy="7.5" r="7.5" fill="rgba(238,148,65, 0.3)"></circle>
  <circle cx="7.5" cy="7.5" r="5" stroke="rgb(255, 255, 255)" stroke-width="1" fill="rgb(238,148,65)"></circle>
</svg>

<style>
  .beeping-heart {
    animation: pulse 1.5s infinite;
  }

  @keyframes pulse {
    0%, 100% {
      transform: scale(1);
      opacity: 1;
    }
    50% {
      transform: scale(1.2);
      opacity: 0.6;
    }
  }
</style>

 

Honey G Hamza
Lucas1200
Tourist
25 0 4

Where can I change the SVG of this icon?

Hamza_Hussain
Shopify Partner
50 4 13

You can probably find this in main-product,liquid or product.liquid file just -> click on the three dots on your desired theme

 

go to Online storeHamza_Hussain_0-1725999306040.png

 

Click the three dots and go to edit theme Hamza_Hussain_1-1725999360322.png

 

search main-product and go to the file in the sections folderHamza_Hussain_2-1725999421026.png

when you have opened the file find the product__inventory class in the file inside that tag will be a svg tag or a render tag looking something like this {% render "a name of the icon" %} 

 

remove {% render "a name of the icon" %}  and paste the svg tag I gave you.

 

 

 

 

To change the font size of the text just the below code in the base.css file or custom.css file 

p.product__inventory {
    font-size: 14px !important;
}
Honey G Hamza
Lucas1200
Tourist
25 0 4

Do you also know how to make the text smaller next to the icon?

Hamza_Hussain
Shopify Partner
50 4 13

Can you provide your Shop URL.

 

Honey G Hamza