-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
36 lines (31 loc) · 1.15 KB
/
Copy pathscript.js
File metadata and controls
36 lines (31 loc) · 1.15 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
function setTextSize(size) {
// Remove selected class from all text size options
document.querySelectorAll('.settings-option:first-child .settings-item').forEach(item => {
item.classList.remove('selected');
});
// Add selected class to clicked option
event.target.classList.add('selected');
// Apply text size
const content = document.querySelector('.content');
if (size === 'small') {
content.style.fontSize = '0.8rem';
} else if (size === 'standard') {
content.style.fontSize = '1rem';
} else if (size === 'large') {
content.style.fontSize = '1.2rem';
}
}
function setColorMode(mode) {
// Remove selected class from all color options
document.querySelectorAll('.settings-option:last-child .settings-item').forEach(item => {
item.classList.remove('selected');
});
// Add selected class to clicked option
event.target.classList.add('selected');
// Apply color mode by toggling class on body
if (mode === 'light') {
document.body.classList.add('light-mode');
} else if (mode === 'dark') {
document.body.classList.remove('light-mode');
}
}