-
Notifications
You must be signed in to change notification settings - Fork 0
/
logic.js
38 lines (31 loc) · 1000 Bytes
/
logic.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
const searchbar = document.getElementById("searchbar")
let twentyFourHour = true
function googleSearch(input){
var safe = encodeURI(input)
window.location.href = "https://www.google.com/search?q=" + safe
}
searchbar.addEventListener("keyup", function(event) {
// Number 13 is the "Enter" key on the keyboard
if (event.keyCode === 13) {
googleSearch(searchbar.value)
}
})
searchbar.addEventListener("keyup", function(event) {
// Number 27 is the "Escape" key on the keyboard
if (event.keyCode === 27) {
searchbar.blur()
}
})
function openRepo(){
window.location.href = "https://github.com/wayoutware/chimera-browser"
}
function openSettings(){
window.location.href = "../settings/index.html"
}
function openLibrary(){
window.location.href = "../settings/index.html"
}
function imgAnimate(){
document.getElementById("background-img").style.opacity = "0.3"
document.getElementById("background-img").style.transform = "scale(1)"
}