Linktree/js/loading-animation.js
2024-10-06 00:07:25 +08:00

25 lines
800 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

document.addEventListener('DOMContentLoaded', () => {
const loading = document.querySelector('.loading');
const container = document.querySelector('.container');
const profileContent = document.querySelector('.profile-content');
const links = document.querySelectorAll('.link');
// 隱藏載入動畫
setTimeout(() => {
loading.classList.add('hide');
container.classList.add('show');
}, 1000); // 延遲1秒後開始顯示內容
// 顯示個人資料
setTimeout(() => {
profileContent.classList.add('show');
}, 1500); // 再延遲0.5秒後顯示個人資料
// 逐個顯示鏈接
links.forEach((link, index) => {
setTimeout(() => {
link.classList.add('show');
}, 2000 + index * 200); // 從2秒後開始每隔0.2秒顯示一個鏈接
});
});