-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathscript.js
More file actions
41 lines (36 loc) · 1.18 KB
/
script.js
File metadata and controls
41 lines (36 loc) · 1.18 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
window.addEventListener('load', (event) => {
let today = new Date();
let time = today.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
displayTime(time);
});
setInterval(function () {
var today = new Date();
var time = today.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
document.getElementById("time").innerHTML = time;
}, 1000);
function displayTime(time) {
document.getElementById("time").innerHTML = time;
}
const search_engines = [{
src: "goog.svg",
placeholder: "Google",
action: "https://www.google.com/search?q="
}, {
src: "ddg.svg",
placeholder: "DuckDuckGo",
action: "https://www.duckduckgo.com/"
}, {
src: "reddit.svg",
placeholder: "Reddit",
action: "https://www.reddit.com/search?q="
}, {
src: "youtube.svg",
placeholder: "YouTube",
action: "https://www.youtube.com/results?q="
}];
const cycleSearchEngines = se => {
const curData = search_engines[(se+1) % search_engines.length];
document.getElementById("se_icon").src = "icons/" + curData.src;
document.getElementById("search").placeholder = "Searching with " + curData.placeholder;
document.getElementById("search_eng_form").action = curData.action;
};