Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

223
Vistas
CSS animation On ReactJS Project Unable to make it work

Im new to React, Im trying to make my background animated on my home section but apparently the animation on the linear-gradient background does not work. Any help is appreciated.;)

const gradient = keyframes` //ANIMATION
0% {
  background-position: 0% 50%;
}
50% {
  background-position: 100% 50%;
}
100% {
  background-position: 0% 50%;
}
`

const Section = styled.section ` 
// min-height: ${props => `calc(100vh ${props.theme.navHeight})` };
width: 100vw;
position: relative;
// background-color: ${props => props.theme.body};
animation: gradient 15s ease infinite;
background: linear-gradient(-45deg, #000, #211725, #2f0a3d, #6f1e8e); //LINEAR
animation: ${gradient} 15s ease infinite; //ANIMATION
`

What I have imported :

import React from 'react'
import TypeWriterText from '../TypeWriterText'
import styled, { keyframes } from 'styled-components'
import CoverVideo from '../CoverVideo'
import RoundTextBlack from '../../assets/Rounded-Text-White.png';
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think you are missing background-size

    const Section = styled.section ` 
      // min-height: ${props => `calc(100vh ${props.theme.navHeight})` };
      width: 100vw;
      height: 100vh
      position: relative;
      // background-color: ${props => props.theme.body};
      // this line might be for nothing  animation: gradient 15s ease infinite;
      background: linear-gradient(-45deg, #000, #211725, #2f0a3d, #6f1e8e);   //LINEAR   
      background-size: 500% 500%;

      animation: ${gradient} 15s ease infinite; //ANIMATION
    `

Here is a working example https://codesandbox.io/s/react-playground-forked-5lcm5v?file=/index.js

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda