init
This commit is contained in:
parent
25b0ead8b1
commit
d7a96baa4b
|
|
@ -1,5 +1,10 @@
|
|||
import { cmdTextbox } from "./dom.js"
|
||||
|
||||
export function initFocus() {
|
||||
window.addEventListener("click", focusHandler)
|
||||
focusTextbox()
|
||||
}
|
||||
|
||||
export function focusTextbox() {
|
||||
cmdTextbox.focus()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import { resize } from "./resize.js"
|
||||
import { focusTextbox, focusHandler } from "./focus.js"
|
||||
import { initResize } from "./resize.js"
|
||||
import { initFocus } from "./focus.js"
|
||||
import { startVramCounter } from "./vram.js"
|
||||
import { startConnection } from "./websocket.js"
|
||||
|
||||
window.addEventListener("click", focusHandler)
|
||||
focusTextbox()
|
||||
|
||||
window.addEventListener("resize", resize)
|
||||
resize()
|
||||
initFocus()
|
||||
initResize()
|
||||
|
||||
startConnection()
|
||||
startVramCounter()
|
||||
|
|
@ -1,5 +1,10 @@
|
|||
const content = document.getElementById("content")!
|
||||
|
||||
export function initResize() {
|
||||
window.addEventListener("resize", resize)
|
||||
resize()
|
||||
}
|
||||
|
||||
export function resize() {
|
||||
if (document.body.dataset.mode === "tall") {
|
||||
resizeTall()
|
||||
|
|
|
|||
|
|
@ -11,15 +11,13 @@ export const startVramCounter = () => {
|
|||
const count = parseInt(vramCounter.textContent!) + 1
|
||||
let val = count + "KB"
|
||||
if (count < 10)
|
||||
val = "00" + val
|
||||
else if (count < 100)
|
||||
val = "0" + val
|
||||
|
||||
vramCounter.textContent = val
|
||||
|
||||
if (count >= 640) {
|
||||
if (count >= 64) {
|
||||
vramCounter.textContent += " OK"
|
||||
clearInterval(timer)
|
||||
}
|
||||
}, 5)
|
||||
}, 15)
|
||||
}
|
||||
3
src/js/websocket.ts
Normal file
3
src/js/websocket.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export function startConnection() {
|
||||
console.log("whee")
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user