How can I add a shake feature to call to action buttons?

Solved

How can I add a shake feature to call to action buttons?

Kris-Tech
Excursionist
47 0 6

Hi

 

Can someone help me with shaking some call to action buttons for me please

 

I need to add a shake add to cart on all product pages eg: 

 

https://techfirmstore.com/collections/home-tools/products/wired-wireless-gsm-home-burglar-security-a...

 

KrisTech_1-1688512462626.png

 

And also I will like to add the shake feature on the reveal offers button which appears on selected pages

 

KrisTech_2-1688512534064.png

 

Thanks

 

Accepted Solution (1)

Guleria
Shopify Partner
4104 803 1155

This is an accepted solution.

Hello @Kris-Tech ,

 

Follow these steps:

1. Go to Online Store -> Theme -> Edit code

2. Open your theme.css file and paste the following code below:

button.add-to-cart, .ufe-floating__btn { 
  animation-name: shake;
  animation-duration: 5s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in;
  cursor: pointer;
position: relative;
}
button.add-to-cart:hover, .ufe-floating__btn: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}
}

 

Thanks

- Custom themes, UI/UX design, ongoing maintenance & support.
- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder

View solution in original post

Replies 4 (4)

Guleria
Shopify Partner
4104 803 1155

This is an accepted solution.

Hello @Kris-Tech ,

 

Follow these steps:

1. Go to Online Store -> Theme -> Edit code

2. Open your theme.css file and paste the following code below:

button.add-to-cart, .ufe-floating__btn { 
  animation-name: shake;
  animation-duration: 5s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in;
  cursor: pointer;
position: relative;
}
button.add-to-cart:hover, .ufe-floating__btn: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}
}

 

Thanks

- Custom themes, UI/UX design, ongoing maintenance & support.
- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder
Kris-Tech
Excursionist
47 0 6

Thank you, worked perfectly!

Dhwanit
Visitor
1 0 0

In edit code I don't have theme.css file

 

nits
Shopify Partner
2 0 0

Another option is to use shopify app : https://apps.shopify.com/shake-add-to-cart-button