fix: styling

This commit is contained in:
Timothy J. Baek 2024-05-02 00:07:04 -07:00
parent 8fb5e22e43
commit 5613af032d
6 changed files with 33 additions and 12 deletions

View file

@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import Bolt from '$lib/components/icons/Bolt.svelte'; import Bolt from '$lib/components/icons/Bolt.svelte';
import { onMount } from 'svelte';
export let submitPrompt: Function; export let submitPrompt: Function;
export let suggestionPrompts = []; export let suggestionPrompts = [];
@ -12,6 +13,21 @@
// suggestionPrompts.length <= 4 // suggestionPrompts.length <= 4
// ? suggestionPrompts // ? suggestionPrompts
// : suggestionPrompts.sort(() => Math.random() - 0.5).slice(0, 4); // : suggestionPrompts.sort(() => Math.random() - 0.5).slice(0, 4);
onMount(() => {
const containerElement = document.getElementById('suggestions-container');
if (containerElement) {
containerElement.addEventListener('wheel', function (event) {
if (event.deltaY !== 0) {
// If scrolling vertically, prevent default behavior
event.preventDefault();
// Adjust horizontal scroll position based on vertical scroll
containerElement.scrollLeft += event.deltaY;
}
});
}
});
</script> </script>
{#if prompts.length > 0} {#if prompts.length > 0}
@ -22,7 +38,10 @@
{/if} {/if}
<div class="w-full"> <div class="w-full">
<div class="relative w-full flex gap-2 snap-x snap-mandatory overflow-x-auto tabs"> <div
class="relative w-full flex gap-2 snap-x snap-mandatory md:snap-none overflow-x-auto tabs"
id="suggestions-container"
>
{#each prompts as prompt, promptIdx} {#each prompts as prompt, promptIdx}
<div class="snap-center shrink-0"> <div class="snap-center shrink-0">
<button <button

View file

@ -240,7 +240,7 @@
}; };
</script> </script>
<div class="h-full flex"> <div class="h-full flex mb-16">
{#if messages.length == 0} {#if messages.length == 0}
<Placeholder <Placeholder
models={selectedModels} models={selectedModels}

View file

@ -32,7 +32,7 @@
</script> </script>
{#key mounted} {#key mounted}
<div class="m-auto w-full max-w-3xl px-8 pb-32"> <div class="m-auto w-full max-w-3xl px-8 lg:px-0 pb-16">
<div class="flex justify-start"> <div class="flex justify-start">
<div class="flex -space-x-4 mb-1" in:fade={{ duration: 200 }}> <div class="flex -space-x-4 mb-1" in:fade={{ duration: 200 }}>
{#each models as model, modelIdx} {#each models as model, modelIdx}

View file

@ -27,10 +27,7 @@
<ShareChatModal bind:show={showShareChatModal} chatId={$chatId} /> <ShareChatModal bind:show={showShareChatModal} chatId={$chatId} />
<nav id="nav" class=" sticky py-2.5 top-0 flex flex-row justify-center z-30"> <nav id="nav" class=" sticky py-2.5 top-0 flex flex-row justify-center z-30">
<div <div class=" flex max-w-full w-full mx-auto px-6 pt-1">
class=" flex {$settings?.fullScreenMode ?? null ? 'max-w-full' : 'max-w-3xl'}
w-full mx-auto px-5"
>
<div class="flex items-center w-full max-w-full"> <div class="flex items-center w-full max-w-full">
<div class="flex-1 overflow-hidden max-w-full"> <div class="flex-1 overflow-hidden max-w-full">
{#if showModelSelector} {#if showModelSelector}

View file

@ -15,7 +15,8 @@
chatId, chatId,
config, config,
WEBUI_NAME, WEBUI_NAME,
tags as _tags tags as _tags,
showSidebar
} from '$lib/stores'; } from '$lib/stores';
import { copyToClipboard, splitStream } from '$lib/utils'; import { copyToClipboard, splitStream } from '$lib/utils';
@ -838,7 +839,11 @@
</title> </title>
</svelte:head> </svelte:head>
<div class="h-screen max-h-[100dvh] w-full flex flex-col"> <div
class="min-h-screen max-h-screen {$showSidebar
? 'lg:max-w-[calc(100%-260px)]'
: ''} w-full max-w-full flex flex-col"
>
<Navbar <Navbar
{title} {title}
bind:selectedModels bind:selectedModels
@ -849,7 +854,7 @@
/> />
<div class="flex flex-col flex-auto"> <div class="flex flex-col flex-auto">
<div <div
class=" pb-2.5 flex flex-col justify-between w-full flex-auto overflow-auto h-0" class=" pb-2.5 flex flex-col justify-between w-full flex-auto overflow-auto h-0 max-w-full"
id="messages-container" id="messages-container"
bind:this={messagesContainerElement} bind:this={messagesContainerElement}
on:scroll={(e) => { on:scroll={(e) => {

View file

@ -859,8 +859,8 @@
{#if loaded} {#if loaded}
<div <div
class="min-h-screen max-h-screen {$showSidebar class="min-h-screen max-h-screen {$showSidebar
? ' lg:max-w-[calc(100%-260px)]' ? 'lg:max-w-[calc(100%-260px)]'
: ''} max-w-full flex flex-col" : ''} w-full max-w-full flex flex-col"
> >
<Navbar <Navbar
{title} {title}