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

189
Visualizações
Passing 'animated' text to js

I have @keyframes text animation is css (text is changing with :after method) I need to pass that text to javascript to chnage the blending mode for each letter (thanks to Mostafa Hassan I know how to do it now!) Not sure how I can grab the text that was altered with :after method in css though. Any help?

<p class="blend text-animate" blend-mode="difference" data="Blend"></p>
.text-animate{
  font-size:280px;
  font-family: sans-serif;
  letter-spacing: -60px;
  text-align: center;
  color: aquamarine;
  animation-name: blending;
  animation-duration: 8s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.text-animate:after{
  animation-name: blending;
  animation-duration: 8s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  content: "";
}

@keyframes blending {
0% {content: "NoBlend"; color: aquamarine;}
50% {content: "Keyframes"; color: royalblue;}
100% {content: "NoBlend"; color: aquamarine;}
}
const element = document.getElementsByClassName("blend");
let text = element[0].getAttribute("data");
let blendMode = element[0].getAttribute("blend-mode");
for(let chr of text) 
  element[0].innerHTML += "<span style='mix-blend-mode: "+blendMode+"' > "+chr+"</span>";
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