How to change button add to cart to shake ?

Excursionist
44 1 4

hey i have Turbo theme and i try to change the button add to cart to shake.

thanks

 

0 Likes
Shopify Partner
36 7 34

Hi, do you mean you want the button to shake when you hover over it or you want it to say the word 'shake' ?

Personal Shopify Development for $40 an hour. Contact me by private message or by email at info@kenkinneen.com
1 Like
Excursionist
44 1 4
Hey.
I mean just press the button that it will shake
0 Likes
Shopify Partner
36 7 34

Hi,

 

Could you add this code to your theme.scss file and let me know if it works?

 

.add_to_cart:hover {
  animation-name: shakeAnim;
}

@keyframes shakeAnim {
  0% {left: 0}
  1% {left: -3px}
  2% {left: 5px}
  3% {left: -8px}
  4% {left: 8px}
  5% {left: -5px}
  6% {left: 3px}
  7% {left: 0}
}

@keyframes shake {
  0% {left: 0}
  1% {left: -3px}
  2% {left: 5px}
  3% {left: -8px}
  4% {left: 8px}
  5% {left: -5px}
  6% {left: 3px}
  7% {left: 0}
}

If you don't know how to add code to your theme.scss you can follow the guide below.

 

https://help.shopify.com/en/manual/using-themes/change-the-layout/theme-code then find the file 'theme.scss' and add the code above to the bottom of this file.

Personal Shopify Development for $40 an hour. Contact me by private message or by email at info@kenkinneen.com
1 Like
Excursionist
44 1 4

i add this but this is not work ללא שם.png

0 Likes
Highlighted
Shopify Partner
36 7 34

Did you preview this backup theme and not the live one to check if it works?

Personal Shopify Development for $40 an hour. Contact me by private message or by email at info@kenkinneen.com
1 Like
Excursionist
44 1 4
Yes this is beckup theme
0 Likes