init
This commit is contained in:
parent
25b0ead8b1
commit
d7a96baa4b
|
|
@ -1,5 +1,10 @@
|
||||||
import { cmdTextbox } from "./dom.js"
|
import { cmdTextbox } from "./dom.js"
|
||||||
|
|
||||||
|
export function initFocus() {
|
||||||
|
window.addEventListener("click", focusHandler)
|
||||||
|
focusTextbox()
|
||||||
|
}
|
||||||
|
|
||||||
export function focusTextbox() {
|
export function focusTextbox() {
|
||||||
cmdTextbox.focus()
|
cmdTextbox.focus()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
import { resize } from "./resize.js"
|
import { initResize } from "./resize.js"
|
||||||
import { focusTextbox, focusHandler } from "./focus.js"
|
import { initFocus } from "./focus.js"
|
||||||
import { startVramCounter } from "./vram.js"
|
import { startVramCounter } from "./vram.js"
|
||||||
|
import { startConnection } from "./websocket.js"
|
||||||
|
|
||||||
window.addEventListener("click", focusHandler)
|
initFocus()
|
||||||
focusTextbox()
|
initResize()
|
||||||
|
|
||||||
window.addEventListener("resize", resize)
|
|
||||||
resize()
|
|
||||||
|
|
||||||
|
startConnection()
|
||||||
startVramCounter()
|
startVramCounter()
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
const content = document.getElementById("content")!
|
const content = document.getElementById("content")!
|
||||||
|
|
||||||
|
export function initResize() {
|
||||||
|
window.addEventListener("resize", resize)
|
||||||
|
resize()
|
||||||
|
}
|
||||||
|
|
||||||
export function resize() {
|
export function resize() {
|
||||||
if (document.body.dataset.mode === "tall") {
|
if (document.body.dataset.mode === "tall") {
|
||||||
resizeTall()
|
resizeTall()
|
||||||
|
|
|
||||||
|
|
@ -11,15 +11,13 @@ export const startVramCounter = () => {
|
||||||
const count = parseInt(vramCounter.textContent!) + 1
|
const count = parseInt(vramCounter.textContent!) + 1
|
||||||
let val = count + "KB"
|
let val = count + "KB"
|
||||||
if (count < 10)
|
if (count < 10)
|
||||||
val = "00" + val
|
|
||||||
else if (count < 100)
|
|
||||||
val = "0" + val
|
val = "0" + val
|
||||||
|
|
||||||
vramCounter.textContent = val
|
vramCounter.textContent = val
|
||||||
|
|
||||||
if (count >= 640) {
|
if (count >= 64) {
|
||||||
vramCounter.textContent += " OK"
|
vramCounter.textContent += " OK"
|
||||||
clearInterval(timer)
|
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