Skip to content

Commit

Permalink
Merge pull request #254 from ollama-webui/fix-drag-and-drop-overlay
Browse files Browse the repository at this point in the history
fix: file drag and drop overlay
  • Loading branch information
tjbck authored Dec 20, 2023
2 parents 03dc105 + c57c72c commit 8cd93a4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib/components/chat/MessageInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@

{#if dragged}
<div
class="absolute w-full h-full flex z-50 touch-none pointer-events-none"
class="fixed w-full h-full flex z-50 touch-none pointer-events-none"
id="dropzone"
role="region"
aria-label="Drag and Drop Container"
>
<div class="absolute rounded-xl w-full h-full backdrop-blur bg-gray-800/40 flex justify-center">
<div class="m-auto pt-48 flex flex-col justify-center">
<div class="m-auto pt-64 flex flex-col justify-center">
<div class="max-w-md">
<div class=" text-center text-6xl mb-3">🏞️</div>
<div class="text-center dark:text-white text-2xl font-semibold z-50">Add Images</div>
Expand Down
18 changes: 16 additions & 2 deletions src/lib/components/chat/Messages.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,19 @@
<div class="m-auto text-center max-w-md pb-56 px-2">
<div class="flex justify-center mt-8">
{#if selectedModelfile && selectedModelfile.imageUrl}
<img src={selectedModelfile?.imageUrl} class=" w-20 mb-2 rounded-full" />
<img
src={selectedModelfile?.imageUrl}
alt="modelfile"
class=" w-20 mb-2 rounded-full"
draggable="false"
/>
{:else}
<img src="/ollama.png" class=" w-16 invert-[10%] dark:invert-[100%] rounded-full" />
<img
src="/ollama.png"
class=" w-16 invert-[10%] dark:invert-[100%] rounded-full"
alt="ollama"
draggable="false"
/>
{/if}
</div>
<div class=" mt-2 text-2xl text-gray-800 dark:text-gray-100 font-semibold">
Expand Down Expand Up @@ -401,25 +411,29 @@
src="{$settings.gravatarUrl ? $settings.gravatarUrl : '/user'}.png"
class=" max-w-[28px] object-cover rounded-full"
alt="User profile"
draggable="false"
/>
{:else}
<img
src={$user ? $user.profile_image_url : '/user.png'}
class=" max-w-[28px] object-cover rounded-full"
alt="User profile"
draggable="false"
/>
{/if}
{:else if selectedModelfile}
<img
src={selectedModelfile?.imageUrl ?? '/favicon.png'}
class=" max-w-[28px] object-cover rounded-full"
alt="Ollama profile"
draggable="false"
/>
{:else}
<img
src="/favicon.png"
class=" max-w-[28px] object-cover rounded-full"
alt="Ollama profile"
draggable="false"
/>
{/if}
</div>
Expand Down

0 comments on commit 8cd93a4

Please sign in to comment.