Refactor codebase
- Support file drag-and-drop - Fix wrong usage of tooltips - Add tailwind shorthands for layouting - Complete ARIA annotating
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$lib/components/ui/button'
|
||||
import { getBitmapContext } from '$lib/contexts/bitmap.svelte'
|
||||
import { getDeviceContext } from '$lib/contexts/device.svelte'
|
||||
|
||||
import { toast } from 'svelte-sonner'
|
||||
import { getDeviceContext } from '$lib/contexts/device.svelte'
|
||||
import { getRenderedContext } from '$lib/contexts/rendered.svelte'
|
||||
|
||||
interface Props {
|
||||
onprogress: (inPropgress: boolean) => void
|
||||
@@ -13,13 +14,13 @@
|
||||
let inProgress = $state(false)
|
||||
|
||||
const deviceCtx = getDeviceContext()
|
||||
const bitmapCtx = getBitmapContext()
|
||||
const renderedCtx = getRenderedContext()
|
||||
|
||||
let disabled = $derived(deviceCtx.device === null || bitmapCtx.rendered === null || inProgress)
|
||||
let disabled = $derived(deviceCtx.device === null || renderedCtx.rendered === null || inProgress)
|
||||
let secondary = $derived(deviceCtx.device === null)
|
||||
|
||||
async function connectAndWrite() {
|
||||
if (deviceCtx.device === null || bitmapCtx.rendered === null) return
|
||||
if (deviceCtx.device === null || renderedCtx.rendered === null) return
|
||||
|
||||
if (!deviceCtx.device.opened) {
|
||||
try {
|
||||
@@ -36,7 +37,7 @@
|
||||
let cell = 0x0
|
||||
for (let xStroll = 0; xStroll < 8; xStroll++) {
|
||||
const index = y * 200 + xStride * 8 + xStroll
|
||||
cell |= bitmapCtx.rendered[index] << xStroll
|
||||
cell |= renderedCtx.rendered[index] << xStroll
|
||||
}
|
||||
buffer[y * 25 + xStride] = cell
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user