Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion frontend/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<link rel="manifest" href="%sveltekit.assets%/manifest.json" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<style>
@media (prefers-color-scheme: dark) {
* {
scrollbar-color: #dedede #20202000;
}
}
</style>
<body data-sveltekit-preload-data="hover" class="dark:bg-[#202020] dark:text-[#dedede]">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
2 changes: 1 addition & 1 deletion frontend/src/components/file-display.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
</script>

<div bind:this={container} class="w-full md:w-[65%] flex flex-col gap-4 max-h-[300px] md:max-h-[600px] md:min-w-[550px] overflow-auto bg-gray-100 border border-gray-300 rounded px-5 pb-5 pt-2.5">
<div bind:this={container} class="w-full md:w-[65%] flex flex-col gap-4 max-h-[300px] md:max-h-[600px] md:min-w-[550px] overflow-auto bg-gray-100 border border-gray-300 rounded px-5 pb-5 pt-2.5 dark:bg-[#f3f4f60d] dark:border-gray-600">
<h2 class="text-lg md:text-2xl md:py-3 py-2 font-mono font-extrabold">Metadata</h2>
{#if currentFile}
<div class="w-full overflow-auto transition-all duration-300 ease-in-out opacity-0 {fileUrl ? 'opacity-100' : ''} min-h-[200px]">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/file-preview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$: fileType = file?.type.toLowerCase() ?? '';
</script>

<div class="h-[100px] md:h-[200px] min-w-[200px] min-h-[100px] md:min-h-[200px] max-h-[100px] md:max-h-[200px] flex items-center justify-center bg-gray-100 rounded">
<div class="h-[100px] md:h-[200px] min-w-[200px] min-h-[100px] md:min-h-[200px] max-h-[100px] md:max-h-[200px] flex items-center justify-center bg-gray-100 rounded dark:bg-[#f3f4f60d]">
{#if file && url}
{#if fileType.startsWith('image/')}
{#if ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/svg+xml'].includes(fileType)}
Expand Down
16 changes: 6 additions & 10 deletions frontend/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
const droppedFiles = e.dataTransfer?.files;
if (droppedFiles && droppedFiles.length > 0) {
files = [...files, ...Array.from(droppedFiles)];
if (!currentFile) {
await selectFile(files[0]);
}
await selectFile(droppedFiles[0]);
}
}

Expand All @@ -43,9 +41,7 @@
const selectedFiles = target.files;
if (selectedFiles && selectedFiles.length > 0) {
files = [...files, ...Array.from(selectedFiles)];
if (!currentFile) {
await selectFile(files[0]);
}
await selectFile(selectedFiles[0]);
}
// Reset input so the same file can be selected again
target.value = '';
Expand Down Expand Up @@ -99,7 +95,7 @@
{#if files.length === 0}
<div
bind:this={dropzone}
class="h-[200px] min-w-[150px] sm:h-[300px] sm:min-w-[200px] md:h-[400px] md:min-w-[500px] md:max-w-[800px] border-2 border-dashed rounded flex items-center justify-center cursor-pointer transition-colors {isDragging ? 'border-blue-500 bg-blue-50' : 'border-gray-300'}"
class="h-[200px] min-w-[150px] sm:h-[300px] sm:min-w-[200px] md:h-[400px] md:min-w-[500px] md:max-w-[800px] border-2 border-dashed rounded flex items-center justify-center cursor-pointer transition-colors {isDragging ? 'border-blue-500 bg-blue-50 dark:bg-[#1447e618]' : 'border-gray-300'}"
on:dragenter={handleDragEnter}
on:dragleave={handleDragLeave}
on:dragover|preventDefault
Expand All @@ -109,7 +105,7 @@
role="button"
tabindex="0"
>
<p class="text-base md:text-xl">
<p class="text-base md:text-xl pointer-events-none">
<span class="hidden sm:inline">Drop files here or click to select</span>
<span class="sm:hidden">Select a file</span>
</p>
Expand All @@ -123,7 +119,7 @@

<div
bind:this={dropzone}
class="border-2 border-dashed p-4 rounded text-center cursor-pointer transition-colors {isDragging ? 'border-blue-500 bg-blue-50' : 'border-gray-300'}"
class="border-2 border-dashed p-4 rounded text-center cursor-pointer transition-colors {isDragging ? 'border-blue-500 bg-blue-50 dark:bg-[#1447e618]' : 'border-gray-300'}"
on:dragenter={handleDragEnter}
on:dragleave={handleDragLeave}
on:dragover|preventDefault
Expand All @@ -139,7 +135,7 @@
<div class="flex flex-col gap-2 overflow-auto">
{#each files as file}
<button
class="flex flex-col gap-1 p-3 text-left border rounded hover:bg-gray-50 transition-colors {file === currentFile ? 'border-blue-500 bg-blue-50' : 'border-gray-200'}"
class="flex flex-col gap-1 p-3 text-left border rounded hover:bg-gray-50 transition-colors {file === currentFile ? 'border-blue-500 bg-blue-50 dark:bg-[#1447e618]' : 'border-gray-200 dark:border-gray-300'}"
on:click={() => selectFile(file)}
>
<div class="font-mono truncate">{file.name}</div>
Expand Down