Gestionnaire de fichiers - Editer - /home/kridsana/webapp.cm.in.th/673190901/u67319090010/Portfolio/scripts.js
Arrière
document.addEventListener("DOMContentLoaded", function () { const myInfo = document.querySelector(".my_info"); const observer = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { myInfo.classList.add("fade-in"); // เพิ่ม class ให้เกิดแอนิเมชัน } }); }, { threshold: 0.3 }); // เมื่อ .my_info ปรากฏ 30% Animation จะทำงาน observer.observe(myInfo); }); document.addEventListener("DOMContentLoaded", function () { const skillCards = document.querySelectorAll(".skill-card"); function revealSkills() { const triggerBottom = window.innerHeight * 0.85; skillCards.forEach((card) => { const cardTop = card.getBoundingClientRect().top; if (cardTop < triggerBottom) { card.classList.add("visible"); } }); } window.addEventListener("scroll", revealSkills); revealSkills(); // Run once in case already in view }); document.addEventListener("DOMContentLoaded", function () { const contactItems = document.querySelectorAll(".contact-item"); function revealContacts() { const triggerBottom = window.innerHeight * 0.85; contactItems.forEach((item) => { const itemTop = item.getBoundingClientRect().top; if (itemTop < triggerBottom) { item.classList.add("visible"); } }); } window.addEventListener("scroll", revealContacts); revealContacts(); // Run once in case already in view }); document.addEventListener("DOMContentLoaded", function () { const certificates = document.querySelectorAll(".certificate"); function revealCertificates() { const triggerBottom = window.innerHeight * 0.85; let delay = 0.2; // หน่วงเวลาต่ออัน certificates.forEach((certificate, index) => { const certificateTop = certificate.getBoundingClientRect().top; if (certificateTop < triggerBottom && !certificate.classList.contains("visible")) { setTimeout(() => { certificate.classList.add("visible"); }, index * delay * 1000); // ทำให้แต่ละอันขึ้นช้ากว่าอันก่อน } }); } window.addEventListener("scroll", revealCertificates); revealCertificates(); // เช็กตอนโหลดเผื่อมีอันที่อยู่ในจอแล้ว });
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Génération de la page: 0.09 |
proxy
|
phpinfo
|
Réglages