He hecho un video de como animar contenido con el efecto Parallax en WordPress sin plugins.
CSS usado
.article-section {
opacity: 0;
transform: translateY(50px);
transition: all 0.8s ease-in-out; /* Aumenta la duración para más suavidad */
margin: 20px 0; /* Reduce el margen para menos separación */
padding: 20px;
min-height: 300px;
}
.article-section.visible {
opacity: 1;
transform: translateY(0);
}
.article-section.from-left {
transform: translateX(-50px);
}
.article-section.from-left.visible {
transform: translateX(0);
}
.article-section.from-right {
transform: translateX(50px);
}
.article-section.from-right.visible {
transform: translateX(0);
}
.article-section.from-diagonal {
transform: translate(50px, 50px);
}
.article-section.from-diagonal.visible {
transform: translate(0, 0);
}
.article-section:not(.visible) {
visibility: hidden;
height: 0;
overflow: hidden;
margin: 0;
transition: all 0.8s ease-in-out; /* Asegura que la desaparición también sea suave */
}
.text-bodyL {
font-size: 1.2rem;
line-height: 1.6;
font-family: Arial, sans-serif;
}
/* Responsivo para móviles */
@media (max-width: 768px) {
.article-section {
min-height: 200px;
margin: 10px 0;
padding: 10px;
}
}
Java
document.addEventListener('DOMContentLoaded', function () {
const sections = document.querySelectorAll('.article-section');
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add('visible'); // Añade clase cuando entra en el viewport
} else {
entry.target.classList.remove('visible'); // Quita clase cuando sale del viewport
}
});
},
{
threshold: 0.3, // Activa cuando el 30% de la sección es visible
rootMargin: '-30% 0px -30% 0px' // Ajusta para que la sección se oculte antes de salir completamente
}
);
sections.forEach((section) => {
observer.observe(section);
});
});About me and this blog
My name is Luis Nieto and I consider myself a dynamic and entrepreneurial individual with a deep passion for technology. From time to time I write about technology (some posts might be in Spanish as it is my nativelanguage.)
Request a free quote
I offer professional web development services that help business increase their presence in the internet, also I like to develop solutions for companies, so let´s think out of the box together.
Subscribe to our newsletter!
More from our blog
See all posts
Otro video desarrollando funcionalidades inspiradas en la web de Charles Leclerc. Esta…
El formato HEVC es el formato sustituto del AVC. Estamos hablando del…
Es posible que tu copia de seguridad se quede en Google Drive,…
Lo cierto es que es complicado hoy en dia recordar todas las…
Diez años trabajando en cualquier sector u oficio otorga una capacidad suficiente…
Hay muchos hostings que ya regalan el encriptado SSL con la compra…
Si estas viajando quizás te sea muy interesante poder tener toda la…
Sin comentarios
Entradas recientes
- Texto Parallax con animación 3 de agosto de 2025
- Parallax: Contenido (CSS y Código) 3 de agosto de 2025
- Conversor de video HEVC 15 de mayo de 2022
All Website Tags
beneficios del dropshipping
bots
captcha
conversor
convertir hevc
copia de seguridad
cuanto se gana con dropshipping
da dinero el dropshipping
descargar office
descargar office 365
dropshipping
encender pc
encender pc desde cualquier parte del mundo
encendido remoto
google
google drive
hacer dropshipping
hevc
hosting
hosting gratis
hosting para estudiantes
mejor hosting
office
office365
SSL
SSL en wordpress gratis
SSL gratis
SSL Wrodpress
trabajar
video
Whapa
whatsapp
winx HD
wordpress







