fix: progressive enhancement - content visible before JS loads
All checks were successful
Deploy / deploy (push) Successful in 1s
All checks were successful
Deploy / deploy (push) Successful in 1s
This commit is contained in:
@@ -303,16 +303,19 @@ main {
|
|||||||
.article-body p {
|
.article-body p {
|
||||||
margin-bottom: 1.8rem;
|
margin-bottom: 1.8rem;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
.js-ready .article-body p {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
animation: fadeInUp 0.8s ease forwards;
|
animation: fadeInUp 0.8s ease forwards;
|
||||||
}
|
}
|
||||||
|
|
||||||
.article-body p:nth-child(1) { animation-delay: 0.1s; }
|
.js-ready .article-body p:nth-child(1) { animation-delay: 0.1s; }
|
||||||
.article-body p:nth-child(2) { animation-delay: 0.2s; }
|
.js-ready .article-body p:nth-child(2) { animation-delay: 0.2s; }
|
||||||
.article-body p:nth-child(3) { animation-delay: 0.3s; }
|
.js-ready .article-body p:nth-child(3) { animation-delay: 0.3s; }
|
||||||
.article-body p:nth-child(4) { animation-delay: 0.4s; }
|
.js-ready .article-body p:nth-child(4) { animation-delay: 0.4s; }
|
||||||
.article-body p:nth-child(5) { animation-delay: 0.5s; }
|
.js-ready .article-body p:nth-child(5) { animation-delay: 0.5s; }
|
||||||
.article-body p:nth-child(n+6) { animation-delay: 0.6s; }
|
.js-ready .article-body p:nth-child(n+6) { animation-delay: 0.6s; }
|
||||||
|
|
||||||
.article-body h2 {
|
.article-body h2 {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
@@ -478,12 +481,17 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.reveal {
|
.reveal {
|
||||||
opacity: 0;
|
opacity: 1;
|
||||||
transform: translateY(30px);
|
transform: none;
|
||||||
transition: opacity 0.8s ease, transform 0.8s ease;
|
transition: opacity 0.8s ease, transform 0.8s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.reveal.visible {
|
.js-ready .reveal {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(30px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.js-ready .reveal.visible {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,6 +141,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
document.body.classList.add('js-ready');
|
||||||
init();
|
init();
|
||||||
setupReveal();
|
setupReveal();
|
||||||
setupParallax();
|
setupParallax();
|
||||||
|
|||||||
Reference in New Issue
Block a user