-
Notifications
You must be signed in to change notification settings - Fork 116
/
index.js
57 lines (47 loc) · 1.83 KB
/
index.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
const toggle = document.getElementById('toggleDark');
const body = document.querySelector('body');
const backtotop = document.getElementById('Bottom');
toggle.addEventListener('click', function(event){
// console.log("toggle button", event.target.checked);
// console.log("toggle button", toggle.checked);
if(this.checked){
// Dark mode is enabled
body.style.background = '#1d212b';
body.style.color = 'white';
backtotop.style.color = 'white'; // Changed the color for 'backtotop' element
body.style.transition = '2s';
}else{
// Dark mode is disable
body.style.background = 'white';
body.style.color = 'black';
backtotop.style.color = 'black'; // Changed the color for 'backtotop' element
body.style.transition = '2s';
}
});
window.onload = function() {
toggle.checked=false;
// console.log("toggle button", toggle.value);
};
function mailto(e) {
e.preventDefault();
const form = e.target;
const data = new FormData(form);
const object = {};
data.forEach((value, key) => (object[key] = value));
var name = object["contact_name"];
var place = object["contact_place"];
var email = "[email protected]";
var subject = `Name: ${name} and Place: ${place}`;
var encodedSubject = encodeURI(subject);
var mailto_link = "mailto:" email `?subject=${encodedSubject}`;
window.location.href = mailto_link;
document.getElementById("contact").reset();
}
document.getElementById('next').onclick = function(){
let lists = document.querySelectorAll('.item');
document.getElementById('slide').appendChild(lists[0]);
}
document.getElementById('prev').onclick = function(){
let lists = document.querySelectorAll('.item');
document.getElementById('slide').prepend(lists[lists.length - 1]);
}