CSS

Animations CSS3 Avancees : Guide Complet

Maitrisez les animations CSS3 pour creer des interfaces web dynamiques et captivantes.

16 Dec 2024 1 min de lecture 34 vues

34

Lectures

1

Minutes

3

Partages

Animations CSS3 Avancees

Les animations CSS permettent de creer des interfaces dynamiques sans JavaScript.

Transitions

.bouton {
  background: #3498db;
  transition: all 0.3s ease;
}

.bouton:hover {
  background: #2980b9;
  transform: scale(1.05);
}

Keyframes

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.element {
  animation: fadeIn 0.5s ease forwards;
}

Animation de chargement

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

.loader {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

Proprietes d'animation

  • animation-name : Nom du keyframe
  • animation-duration : Duree
  • animation-timing-function : Courbe
  • animation-delay : Delai
  • animation-iteration-count : Repetitions
  • animation-fill-mode : Etat final

Performance

Privilegiez transform et opacity pour des animations fluides a 60fps.

Tags

Design CSS3 Animations Transitions

Partagez cet article

Twitter Facebook LinkedIn
JY

Jordane YENO

Developpeur Full Stack passionne par le web et les nouvelles technologies

En savoir plus

Articles similaires