New style and added ContextWizard pages

This commit is contained in:
qingjie.du
2025-11-18 21:49:23 +09:00
parent db88848660
commit 531021ff6d
15 changed files with 2208 additions and 551 deletions

View File

@@ -34,3 +34,28 @@ function getI18NText(i18n_map, key){
return msg
}
function initRevealAnimations(){
const animated = document.querySelectorAll('.reveal, [data-animate]');
if(!animated || animated.length === 0){
return;
}
if(!('IntersectionObserver' in globalThis)){
for (const el of animated) {
el.classList.add('is-visible');
}
return;
}
const observer = new IntersectionObserver(function(entries){
for (const entry of entries) {
if(entry.isIntersecting){
entry.target.classList.add('is-visible');
observer.unobserve(entry.target);
}
}
}, {threshold: 0.18});
for (const el of animated) {
el.classList.add('reveal');
observer.observe(el);
}
}