Repository navigation
Expand file tree
/
Copy pathscript_fixed.js
More file actions
52 lines (43 loc) · 1.9 KB
/
Copy pathscript_fixed.js
File metadata and controls
52 lines (43 loc) · 1.9 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const pages = document.querySelectorAll('.page');
const homeLink = document.getElementById('homeLink');
const aboutLink = document.getElementById('aboutLink');
const musicLink = document.getElementById('musicLink');
const backBtn = document.getElementById('backBtn');
const yearEl = document.getElementById('footerYear');
const register = document.getElementById('Registration');
const done = document.getElementById('Finish');
const articles = [
{
title: "The Art of Simplicity",
content: "<p>Simplicity is the ultimate sophistication... As the more simple it is the better you are at the world and its not easy for anyone to live in this world with complexity, so choose simplicity</p>"
},
{
title: "Focus in a Distracted World",
content: "<p>In a world filled with noise, true focus is rare... Focus can be done with the help of Music and heart love dedication and that what makes us unique....</p>"
},
{
title: "Designing Without Color",
content: "<p>Sometimes grayscale can speak louder than colors... We must let out heart design our life and be colourful within and that whats the main thing we have to do in this life</p>"
}
]
if (yearEl) {
yearEl.textContent = new Date().getFullYear();
}
function showPage(id) {
pages.forEach(page => {
page.classList.add('hidden');
});
document.getElementById(id).classList.remove('hidden');
}
homeLink.onclick = () => showPage('homePage');
aboutLink.onclick = () => showPage('aboutPage');
musicLink.onclick = () => showPage('musicPage');
backBtn.onclick = () => showPage('homePage');
register.onclick = () => showPage('Register');
done.onclick = () => showPage('Done');
function openArticle(index) {
const article = articles[index];
const content = document.getElementById('articleContent');
content.innerHTML = `<h2>${article.title}</h2>${article.content}`;
showPage('articlePage');
}