-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
36 lines (29 loc) · 1.03 KB
/
Copy pathscript.js
File metadata and controls
36 lines (29 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const snowContainer = document.getElementById("snow-container");
function createSnowflake() {
const snowflake = document.createElement("div");
snowflake.classList.add("snowflake");
snowflake.style.left = Math.random() * window.innerWidth + "px";
snowflake.style.animationDuration = Math.random() * 3 + 2 + "s";
snowflake.style.fontSize = Math.random() * 10 + 10 + "px";
snowflake.innerHTML = "❄";
snowContainer.appendChild(snowflake);
setTimeout(() => {
snowflake.remove();
}, 5000);
}
setInterval(createSnowflake, 100);
// BAR
function showPage(pageId) {
// ซ่อนทุกหน้าก่อน
const pages = document.querySelectorAll('.page');
pages.forEach(page => {
page.style.display = 'none';
});
// แสดงหน้าที่ต้องการ
const activePage = document.getElementById(pageId);
if (activePage) {
activePage.style.display = 'block';
}
}
// Add interactivity if needed
console.log("Website is loaded!");