mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2026-06-10 11:16:48 +00:00
frontend cleanup
This commit is contained in:
@@ -16,22 +16,22 @@
|
|||||||
"@lokalise/node-api": "^13.2.1",
|
"@lokalise/node-api": "^13.2.1",
|
||||||
"@sveltejs/adapter-static": "^3.0.10",
|
"@sveltejs/adapter-static": "^3.0.10",
|
||||||
"@sveltejs/kit": "^2.61.1",
|
"@sveltejs/kit": "^2.61.1",
|
||||||
"@sveltejs/vite-plugin-svelte": "^5.1.1",
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
||||||
"@zerodevx/svelte-toast": "^0.9.6",
|
"@zerodevx/svelte-toast": "^0.9.6",
|
||||||
"adm-zip": "^0.5.17",
|
"adm-zip": "^0.5.17",
|
||||||
"dotenv": "^16.6.1",
|
"dotenv": "^17.4.2",
|
||||||
"svelte": "^5.55.9",
|
"svelte": "^5.55.9",
|
||||||
"svelte-check": "^4.4.8",
|
"svelte-check": "^4.4.8",
|
||||||
"svelte-intl-precompile": "^0.12.3",
|
"svelte-intl-precompile": "^0.12.3",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^6.0.3",
|
||||||
"vite": "^6.4.2"
|
"vite": "^8.0.14"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/fira-mono": "^5.2.7",
|
"@fontsource/fira-mono": "^5.2.7",
|
||||||
"cryptgeon": "workspace:*",
|
"cryptgeon": "workspace:*",
|
||||||
"occulto": "^2.0.6",
|
"occulto": "^2.0.6",
|
||||||
"pretty-bytes": "^6.1.1",
|
"pretty-bytes": "^7.1.0",
|
||||||
"qrious": "^4.0.2"
|
"uqr": "^0.1.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
// @ts-ignore
|
|
||||||
import QR from 'qrious'
|
|
||||||
import { t } from 'svelte-intl-precompile'
|
|
||||||
|
|
||||||
import { getCSSVariable } from '$lib/utils'
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
value: string
|
|
||||||
}
|
|
||||||
|
|
||||||
let { value }: Props = $props()
|
|
||||||
|
|
||||||
let canvas: HTMLCanvasElement | null = $state(null)
|
|
||||||
|
|
||||||
$effect(() => {
|
|
||||||
new QR({
|
|
||||||
value,
|
|
||||||
level: 'Q',
|
|
||||||
size: 800,
|
|
||||||
background: getCSSVariable('--ui-bg-0'),
|
|
||||||
foreground: getCSSVariable('--ui-text-0'),
|
|
||||||
element: canvas,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<small>{$t('common.qr_code')}</small>
|
|
||||||
<div>
|
|
||||||
<canvas bind:this={canvas}></canvas>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
div {
|
|
||||||
padding: 0.5rem;
|
|
||||||
width: fit-content;
|
|
||||||
border: 2px solid var(--ui-bg-1);
|
|
||||||
background-color: var(--ui-bg-0);
|
|
||||||
margin-top: 0.125rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
canvas {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
import { status } from '$lib/stores/status'
|
import { status } from '$lib/stores/status'
|
||||||
import Button from '$lib/ui/Button.svelte'
|
import Button from '$lib/ui/Button.svelte'
|
||||||
import TextInput from '$lib/ui/TextInput.svelte'
|
import TextInput from '$lib/ui/TextInput.svelte'
|
||||||
import Canvas from './Canvas.svelte'
|
import QR from './QR.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
result: NoteResult
|
result: NoteResult
|
||||||
@@ -18,8 +18,11 @@
|
|||||||
|
|
||||||
let { result }: Props = $props()
|
let { result }: Props = $props()
|
||||||
|
|
||||||
let url = $state(`${window.location.origin}/note/${result.id}`)
|
let url = $derived.by(() => {
|
||||||
if (result.password) url += `#${result.password}`
|
let url = `${window.location.origin}/note/${result.id}`
|
||||||
|
if (result.password) url += `#${result.password}`
|
||||||
|
return url
|
||||||
|
})
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
@@ -36,7 +39,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Canvas value={url} />
|
<QR value={url} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if $status?.theme_new_note_notice}
|
{#if $status?.theme_new_note_notice}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
let files: FileDTO[] = $state([])
|
let files: FileDTO[] = $state([])
|
||||||
|
|
||||||
async function downloadFile(file: FileDTO) {
|
async function downloadFile(file: FileDTO) {
|
||||||
|
// @ts-ignore
|
||||||
const f = new File([file.contents], file.name, {
|
const f = new File([file.contents], file.name, {
|
||||||
type: file.type,
|
type: file.type,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
...rest
|
...rest
|
||||||
}: HTMLInputAttributes & Props = $props()
|
}: HTMLInputAttributes & Props = $props()
|
||||||
|
|
||||||
|
// svelte-ignore state_referenced_locally
|
||||||
const initialType = $state(rest.type)
|
const initialType = $state(rest.type)
|
||||||
const isPassword = initialType === 'password'
|
const isPassword = initialType === 'password'
|
||||||
let hidden = $state(true)
|
let hidden = $state(true)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
let { data }: Props = $props()
|
let { data }: Props = $props()
|
||||||
|
|
||||||
let id = data.id
|
let id = $derived(data.id)
|
||||||
let password: string | null = $state<string | null>(null)
|
let password: string | null = $state<string | null>(null)
|
||||||
let note: DecryptedNote | null = $state(null)
|
let note: DecryptedNote | null = $state(null)
|
||||||
let exists = $state(false)
|
let exists = $state(false)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"extends": "./.svelte-kit/tsconfig.json",
|
"extends": "./.svelte-kit/tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"allowSyntheticDefaultImports": true
|
"allowSyntheticDefaultImports": true,
|
||||||
}
|
"skipLibCheck": true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+511
-457
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user