What's your biggest current challenge? Have your say in Community Polls along the right column.

Animation du Bouton d'achat

Animation du Bouton d'achat

Sofia555
Visitor
1 0 0

Bonjour,

 

J'aimerais savoir s'il y a un CSS ou un code pour animer le bouton d'achat d'ajout au panier pour qu'il bouge et qu'il soit mis en évidence.

 

Pourriez-vous m'aider svp ?

Replies 2 (2)

Moeed
Shopify Partner
6359 1723 2084

Hey @Sofia555 

 

Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Boost Your Sales with Affiliate Marketing - UpPromote: Affiliate & Referral


santosh-kori
Shopify Partner
2 0 2

Please adding below css code into your current theme code linked Stylesheet CSS file.
Let me know, if need specific CSS code.

form[action="/cart/add"] button[type="submit"] {
  background-color: #28a745; /* Green color */
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  outline: none;
}

/* Button Hover Effect */
form[action="/cart/add"] button[type="submit"]:hover {
  background-color: #218838; /* Darker green */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Animation Keyframes */
@keyframes moveAndHighlight {
  0% {
    transform: translateX(0);
    box-shadow: 0 0 0 rgba(255, 255, 0, 0);
  }
  25% {
    transform: translateX(-10px);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.7);
  }
  50% {
    transform: translateX(10px);
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.7);
  }
  75% {
    transform: translateX(-10px);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.7);
  }
  100% {
    transform: translateX(0);
    box-shadow: 0 0 0 rgba(255, 255, 0, 0);
  }
}

/* Applying the Animation */
form[action="/cart/add"] button[type="submit"]:active {
  animation: moveAndHighlight 0.6s ease-in-out;
}