Skip to content

Commit

Permalink
Merge branch 'dev' into paint-safe-areas-on-ios
Browse files Browse the repository at this point in the history
  • Loading branch information
stavares843 authored Dec 10, 2024
2 parents 2dbd47a + cebffc6 commit 00a357d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/ui/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
align-items: center;
gap: var(--gap);
position: fixed;
z-index: 4;
z-index: 10;
top: 0;
left: 0;
bottom: 0;
Expand Down
1 change: 1 addition & 0 deletions src/lib/globals/animations.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export let animationDuration: number = 100
export let animationDelay: number = 75
export let sidebarSlideDuration: number = 250
24 changes: 19 additions & 5 deletions src/lib/layouts/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { Appearance, Route, Shape } from "$lib/enums"
import { createEventDispatcher } from "svelte"
import { goto } from "$app/navigation"
import { _ } from "svelte-i18n"
import { get } from "svelte/store"
import { Store } from "$lib/state/Store"
Expand All @@ -15,6 +14,8 @@
import WidgetBar from "$lib/components/widgets/WidgetBar.svelte"
import { SettingsStore, type ISettingsState } from "$lib/state"
import { isAndroidOriOS } from "$lib/utils/Mobile"
import { slide } from "svelte/transition"
import { sidebarSlideDuration } from "$lib/globals/animations"
export let activeRoute: Route = Route.Chat
export let open: boolean = true
Expand Down Expand Up @@ -47,7 +48,7 @@
<Slimbar sidebarOpen={open} on:toggle={handleToggle} activeRoute={activeRoute}></Slimbar>

{#if open}
<div class="sidebar">
<div class="sidebar" in:slide={{ duration: sidebarSlideDuration, axis: "x" }} out:slide={{ duration: sidebarSlideDuration, axis: "x" }}>
<div class="sidebar-pre">
<Input hook="input-sidebar-search" alt autoFocus={false} placeholder={$_("generic.search_placeholder")} bind:value={search} on:enter={handleEnter} on:input={handleSearch}>
<Icon icon={Shape.Search} />
Expand Down Expand Up @@ -91,6 +92,12 @@

<style lang="scss">
.sidebar-layout {
top: 0;
left: 0;
z-index: 5;
height: 100%;
background-color: var(--background);
opacity: 1;
width: fit-content;
display: inline-flex;
flex-direction: row;
Expand Down Expand Up @@ -128,18 +135,25 @@
@media (max-width: 800px) {
.sidebar-layout {
position: absolute;
width: 100vw;
overflow: hidden;
opacity: 1;
transition:
transform 0.3s ease,
opacity 0.3s ease;
.sidebar {
min-width: 0;
}
}
.sidebar-layout.closed {
min-width: 0;
width: 0;
transform: translateX(-100%);
pointer-events: none;
:global(.slimbar) {
display: none;
opacity: 0;
pointer-events: none;
}
}
}
Expand Down

0 comments on commit 00a357d

Please sign in to comment.