parent
dd9e97016c
commit
c859780f74
26 changed files with 1918 additions and 1900 deletions
@ -1,38 +1,40 @@ |
|||||||
|
// Path navigation on top left
|
||||||
window.addEventListener("load", () => { |
window.addEventListener("load", () => { |
||||||
const terminal = document.getElementById('nav-terminal') |
const terminal = document.getElementById("nav-terminal"); |
||||||
|
|
||||||
const keyDown = (e) => { |
const keyDown = (e) => { |
||||||
if (e.keyCode === 13) { |
if (e.keyCode === 13) { |
||||||
if (document.activeElement !== document.body) return |
if (document.activeElement !== document.body) return; |
||||||
if (terminal.textContent.length === 0) return |
if (terminal.textContent.length === 0) return; |
||||||
|
|
||||||
if (terminal.textContent.includes("~")) terminal.textContent = "" |
if (terminal.textContent.includes("~")) terminal.textContent = ""; |
||||||
|
|
||||||
window.location.href = window.location.origin + "/" + terminal.textContent |
window.location.href = |
||||||
return |
window.location.origin + "/" + terminal.textContent; |
||||||
|
return; |
||||||
} |
} |
||||||
|
|
||||||
if (e.keyCode === 8) { |
if (e.keyCode === 8) { |
||||||
terminal.textContent = terminal.textContent.slice(0, -1) |
terminal.textContent = terminal.textContent.slice(0, -1); |
||||||
return |
return; |
||||||
} |
} |
||||||
|
|
||||||
if (e.keyCode === 192) { |
if (e.keyCode === 192) { |
||||||
if (terminal.textContent.length !== 0) return |
if (terminal.textContent.length !== 0) return; |
||||||
|
|
||||||
terminal.textContent += "~" |
terminal.textContent += "~"; |
||||||
return |
return; |
||||||
} |
} |
||||||
|
|
||||||
if (e.keyCode === 191) { |
if (e.keyCode === 191) { |
||||||
terminal.textContent += "/" |
terminal.textContent += "/"; |
||||||
return |
return; |
||||||
} |
} |
||||||
|
|
||||||
if (e.keyCode < 65 || e.keyCode > 90) return |
if (e.keyCode < 65 || e.keyCode > 90) return; |
||||||
|
|
||||||
terminal.textContent += e.key.toLowerCase() |
terminal.textContent += e.key.toLowerCase(); |
||||||
} |
}; |
||||||
|
|
||||||
document.addEventListener('keydown', keyDown) |
document.addEventListener("keydown", keyDown); |
||||||
}) |
}); |
||||||
|
@ -1,3 +1,3 @@ |
|||||||
@mixin dimmed { |
@mixin dimmed { |
||||||
opacity: .6; |
opacity: 0.6; |
||||||
} |
} |
Loading…
Reference in new issue