-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
59 lines (46 loc) · 1.84 KB
/
app.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
// const mic = document.querySelector(".voice");
// const themes = ["dark theme", "light theme"];
// mic.addEventListener("click", () => {
// recognition.start();
// });
// const SpeechRecognition =
// window.SpeechRecognition || window.webkitSpeechRecognition;
// const recognition = new SpeechRecognition();
// recognition.onstart = function() {
// console.log("Voice theme activated");
// };
// recognition.onresult = function(event) {
// const current = event.resultIndex;
// const transcript = event.results[current][0].transcript;
// const speech = new SpeechSynthesisUtterance();
// speech.volume = 1;
// speech.rate = 0.8;
// speech.pitch = 1;
// console.log(speech);
// if (transcript.includes("dark theme")) {
// document.body.classList.remove("light-theme");
// document.body.classList.remove("night-fade");
// document.body.classList.add("dark-theme");
// speech.text = "Dark theme activated";
// } else if (transcript.includes("light theme")) {
// document.body.classList.remove("dark-theme");
// document.body.classList.remove("night-fade");
// document.body.classList.add("light-theme");
// speech.text = "Light theme activated";
// } else if (transcript.includes("night")) {
// document.body.classList.remove("dark-theme");
// document.body.classList.remove("light-theme");
// document.body.classList.add("night-fade");
// speech.text = "Noght fade theme activated";
// }
// window.speechSynthesis.speak(speech);
// };
const blogIcon = document.querySelector(".blog-icon");
const sliderBlog = document.querySelector(".sliding-blog-container-close");
blogIcon.addEventListener("click", e => {
if (sliderBlog.style.display == "none") {
sliderBlog.style.display = "flex";
} else if (sliderBlog.style.display == "flex") {
sliderBlog.style.display = "none";
}
});