Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

210
Visualizações
How to do animated gradient on SVG image?

I have implemented a basic animated gradient on text using pure CSS (and some extra DOM elements), as seen here:

.container {
  position: relative;
  display: block;
  width: 300px;
  height: 300px;
  font-size: 60px;
}

.base {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  left: 0px;
  right: 0px;
  top: 0px;
  bottom: 0px;
}

.overlay {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  left: 0px;
  right: 0px;
  top: 0px;
  bottom: 0px;
  background-color: red;
  background: linear-gradient(315deg, red 0%, green 74%);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 2s linear infinite;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  -moz-transition: opacity 1s ease-in-out;
  -webkit-transition: opacity 1s ease-in-out;
}

.overlay:hover {
  opacity: 1;
  transition: opacity 1s ease-in-out;
  -moz-transition: opacity 1s ease-in-out;
  -webkit-transition: opacity 1s ease-in-out;
}


@keyframes shine {
  to {
    background-position: 200% center;
  }
}
<span class="container">
  <span class="base">a</span>
  <span class="overlay">a</span>
</span>

I tried replacing the parts with SVG and using the CSS background-clip property, but it doesn't seem to do anything on SVGs. How can I do this same text gradient effect on SVGs (on hover)?

The SVG I have is a complex hand-drawn owl exported as SVG (looks like a sketch), so it uses lots of complex paths.

Ideally this could be done on a CSS-loaded SVG, rather than using something like this.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda