Exercice 7 : Transitions et animations

7.1 Bouton animé

.button {
  background-color: blue;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

button:hover {
  background-color: darkblue;
  transform: scale(1.05);
}

7.2 Animation de chargement

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f5f5f5;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
Retour à l’accueil