QuickSnip LogoA light blue logo with a thunderbolt in bracketsQuickSnip

Hover to Reveal Color

A card with an image that transitions from grayscale to full color on hover.

  • hover
  • image
  • effects

Code

.card {
  height: 300px;
  width: 200px;
  border-radius: 5px;
  overflow: hidden;
}

.card img{
  height: 100%;
  width: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: all 0.3s;
  transition-duration: 200ms;
  cursor: pointer;
}

.card:hover img {
  filter: grayscale(0%);
  scale: 1.05;
}