Merge pull request #254 from ollama-webui/fix-drag-and-drop-overlay

fix: file drag and drop overlay
This commit is contained in:
Timothy Jaeryang Baek 2023-12-19 23:12:53 -05:00 committed by GitHub
commit 8cd93a4e1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View file

@ -132,13 +132,13 @@
{#if dragged} {#if dragged}
<div <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" id="dropzone"
role="region" role="region"
aria-label="Drag and Drop Container" 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="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="max-w-md">
<div class=" text-center text-6xl mb-3">🏞️</div> <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> <div class="text-center dark:text-white text-2xl font-semibold z-50">Add Images</div>

View file

@ -362,9 +362,19 @@
<div class="m-auto text-center max-w-md pb-56 px-2"> <div class="m-auto text-center max-w-md pb-56 px-2">
<div class="flex justify-center mt-8"> <div class="flex justify-center mt-8">
{#if selectedModelfile && selectedModelfile.imageUrl} {#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} {: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} {/if}
</div> </div>
<div class=" mt-2 text-2xl text-gray-800 dark:text-gray-100 font-semibold"> <div class=" mt-2 text-2xl text-gray-800 dark:text-gray-100 font-semibold">
@ -401,12 +411,14 @@
src="{$settings.gravatarUrl ? $settings.gravatarUrl : '/user'}.png" src="{$settings.gravatarUrl ? $settings.gravatarUrl : '/user'}.png"
class=" max-w-[28px] object-cover rounded-full" class=" max-w-[28px] object-cover rounded-full"
alt="User profile" alt="User profile"
draggable="false"
/> />
{:else} {:else}
<img <img
src={$user ? $user.profile_image_url : '/user.png'} src={$user ? $user.profile_image_url : '/user.png'}
class=" max-w-[28px] object-cover rounded-full" class=" max-w-[28px] object-cover rounded-full"
alt="User profile" alt="User profile"
draggable="false"
/> />
{/if} {/if}
{:else if selectedModelfile} {:else if selectedModelfile}
@ -414,12 +426,14 @@
src={selectedModelfile?.imageUrl ?? '/favicon.png'} src={selectedModelfile?.imageUrl ?? '/favicon.png'}
class=" max-w-[28px] object-cover rounded-full" class=" max-w-[28px] object-cover rounded-full"
alt="Ollama profile" alt="Ollama profile"
draggable="false"
/> />
{:else} {:else}
<img <img
src="/favicon.png" src="/favicon.png"
class=" max-w-[28px] object-cover rounded-full" class=" max-w-[28px] object-cover rounded-full"
alt="Ollama profile" alt="Ollama profile"
draggable="false"
/> />
{/if} {/if}
</div> </div>