Migrate more stuff

This commit is contained in:
Jon Staab
2025-02-03 16:37:14 -08:00
parent 0f705c459a
commit 8d3433b167
150 changed files with 2001 additions and 1205 deletions
+12 -10
View File
@@ -4,23 +4,25 @@
import Button from "@lib/components/Button.svelte"
import {clip} from "@app/toast"
export let code
let {code} = $props()
let canvas: Element
let wrapper: Element
let scale = 0.1
let height: number
let canvas: Element | undefined = $state()
let wrapper: Element | undefined = $state()
let scale = $state(0.1)
let height = $state(0)
const copy = () => clip(code)
onMount(() => {
QRCode.toCanvas(canvas, code)
if (canvas && wrapper) {
QRCode.toCanvas(canvas, code)
const wrapperRect = wrapper.getBoundingClientRect()
const canvasRect = canvas.getBoundingClientRect()
const wrapperRect = wrapper.getBoundingClientRect()
const canvasRect = canvas.getBoundingClientRect()
scale = wrapperRect.width / (canvasRect.width * 10)
height = canvasRect.width * 10 * scale
scale = wrapperRect.width / (canvasRect.width * 10)
height = canvasRect.width * 10 * scale
}
})
</script>