-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathymtweb.js
106 lines (89 loc) · 3.11 KB
/
ymtweb.js
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
function changes(){
changebgColor();
changeheadcolor();
changesizeheader();
changesizefont();
changefontcolor();
}
function changebgColor() {
let color = document.getElementById('backgroundColor').value;
document.body.style.backgroundColor = color;
}
function changeheadcolor() {
let color = document.getElementById('headercolor').value;
let header = document.querySelector('.header');
header.style.color = color;
}
function changesizeheader() {
let size = document.getElementById('headersize').value;
let header = document.querySelector('.header');
header.style.fontSize = size;
}
function changesizefont() {
let size = document.getElementById('fontsize').value;
let detail = document.querySelector('.detail');
detail.style.fontSize = size;
}
function changefontcolor() {
let color = document.getElementById('fontcolor').value;
let detail= document.querySelector('.detail');
detail.style.color = color;
}
document.getElementById('togglebutton').addEventListener('click', function() {
var menu = document.getElementById('menu');
if (menu.style.display === 'none') {
menu.style.display = 'block';
} else {
menu.style.display = 'none';
}
});
// let themeToggler = document.querySelector('.theme-toggler');
// themeToggler.onclick = () => {
// themeToggler.classList.toggle('active');
// if(themeToggler.classList.contains('active')) {
// document.body.classList.add('active');
// } else {
// document.body.classList.remove('active');
// }
// }
// function goBack() {
// window.history.back();
// }
// // Add event listener to "Go Back" button
// document.getElementById('goBackButton').addEventListener('click', goBack);
// let themeToggler = document.querySelector('.theme-toggler');
// themeToggler.onclick = () =>{
// themeToggler.classList.toggle('active');
// if(themeToggler.classList.contains('active')){ document.body.classList.add('active'); }
// else{
// document.body.classList.remove('active');
// }
// }
// let theme = document.querySelector('.themes-container');
// document.querySelector('#theme-open').onclick = () =>{
// theme.classList.add('active');
// document.body.style.paddingRight = '350px';
// }
// document.querySelector('#theme-close').onclick = () =>{
// theme.classList.remove('active');
// document.body.style.paddingRight = '0px';
// }
function resetChanges() {
let header = document.querySelector('.header');
let detail = document.querySelector('.detail');
// Reset color
header.style.color = '';
detail.style.color = '';
document.body.style.backgroundColor = '';
// Reset font size
header.style.fontSize = '';
detail.style.fontSize = '';
}
// Add event listener to "Reset" button
document.getElementById('resetButton').addEventListener('click', resetChanges);
function revealMenu() {
let menu = document.getElementById('menu');
menu.style.maxHeight = menu.scrollHeight + "px";
}
// Add event listener to "Changes" button
document.getElementById('togglebutton').addEventListener('click', revealMenu);