enzostvs HF staff commited on
Commit
a382c22
β€’
1 Parent(s): e71d24a

sidebar mobile wip

Browse files
src/lib/components/fields/Radio.svelte CHANGED
@@ -11,7 +11,7 @@
11
  };
12
  </script>
13
 
14
- <div class="w-full flex items-center justify-start">
15
  {#each options as option}
16
  <button
17
  class={`transition-all duration-200 rounded-full px-4 py-2.5 flex items-center justify-center gap-2 text-sm ${option.value === value ? "bg-neutral-800/60 text-white" : "text-neutral-400"}`}
 
11
  };
12
  </script>
13
 
14
+ <div class="flex items-center justify-start">
15
  {#each options as option}
16
  <button
17
  class={`transition-all duration-200 rounded-full px-4 py-2.5 flex items-center justify-center gap-2 text-sm ${option.value === value ? "bg-neutral-800/60 text-white" : "text-neutral-400"}`}
src/lib/components/sidebar/Sidebar.svelte CHANGED
@@ -1,7 +1,18 @@
1
  <script lang="ts">
2
  import Icon from "@iconify/svelte"
 
3
  import Menu from "./Menu.svelte";
4
 
 
 
 
 
 
 
 
 
 
 
5
  const menus = [{
6
  icon: "solar:gallery-bold-duotone",
7
  label: "Gallery",
@@ -17,7 +28,10 @@
17
  }]
18
  </script>
19
 
20
- <aside class="bg-neutral-950 h-screen border-r border-neutral-800 w-full max-w-[344px]">
 
 
 
21
  <header class="text-white px-8 pb-8 pt-10 text-xl tracking-wider font-semibold">
22
  LoRA Studio
23
  </header>
 
1
  <script lang="ts">
2
  import Icon from "@iconify/svelte"
3
+
4
  import Menu from "./Menu.svelte";
5
 
6
+ let isOpen = false;
7
+
8
+ const handleClick = () => {
9
+ const app = document.getElementById("app");
10
+ if (!app) return;
11
+
12
+ app.classList[isOpen ? 'remove' : 'add']("overflow-hidden");
13
+ isOpen = !isOpen;
14
+ }
15
+
16
  const menus = [{
17
  icon: "solar:gallery-bold-duotone",
18
  label: "Gallery",
 
28
  }]
29
  </script>
30
 
31
+ <button class="bg-transparent absolute top-10 right-8 cursor-pointer" on:click="{handleClick}">
32
+ <Icon icon="mdi:hamburger-minus" class="w-7 h-7 text-white" />
33
+ </button>
34
+ <aside class="bg-neutral-950 h-screen border-r border-neutral-800 w-full max-w-[344px] absolute -translate-x-full lg:translate-x-0 transition-all duration-200 lg:relative z-20" class:translate-x-0={isOpen}>
35
  <header class="text-white px-8 pb-8 pt-10 text-xl tracking-wider font-semibold">
36
  LoRA Studio
37
  </header>
src/routes/+layout.svelte CHANGED
@@ -3,9 +3,9 @@
3
  import "$lib/styles/tailwind.css"
4
  </script>
5
 
6
- <div class="app flex items-start">
7
  <Sidebar />
8
- <main class="px-10 pt-12 pb-12 flex-1 h-screen overflow-auto">
9
  <slot />
10
  </main>
11
  </div>
 
3
  import "$lib/styles/tailwind.css"
4
  </script>
5
 
6
+ <div class="flex items-start">
7
  <Sidebar />
8
+ <main id="app" class="px-6 py-10 lg:px-10 lg:py-12 flex-1 h-screen overflow-auto">
9
  <slot />
10
  </main>
11
  </div>
src/routes/+page.svelte CHANGED
@@ -34,7 +34,7 @@
34
  </h1>
35
  <div class="flex items-center justify-between mt-5">
36
  <Radio options={filter_options} value="{form.filter}" onChange={(filter) => form = {...form, filter }} />
37
- <div class="flex items-center justify-end gap-5 w-full">
38
  <Button icon="ic:round-plus" theme="dark" size="lg">Upload own Image</Button>
39
  <Button icon="fluent:glance-horizontal-sparkles-16-filled" href="/generate" theme="pink" size="lg">Generate</Button>
40
  </div>
 
34
  </h1>
35
  <div class="flex items-center justify-between mt-5">
36
  <Radio options={filter_options} value="{form.filter}" onChange={(filter) => form = {...form, filter }} />
37
+ <div class="flex items-center justify-end gap-5">
38
  <Button icon="ic:round-plus" theme="dark" size="lg">Upload own Image</Button>
39
  <Button icon="fluent:glance-horizontal-sparkles-16-filled" href="/generate" theme="pink" size="lg">Generate</Button>
40
  </div>