enzostvs HF staff commited on
Commit
c16a39b
·
1 Parent(s): 0d2d95b

responsive stuffs

Browse files
src/lib/components/Button.svelte CHANGED
@@ -25,7 +25,15 @@ import { goto } from '$app/navigation';
25
 
26
  </script>
27
 
28
- <button on:click={handleClick} class="button {theme} {size} relative whitespace-nowrap" class:!bg-neutral-400={loading} class:!border-neutral-400={loading}>
 
 
 
 
 
 
 
 
29
  {#if icon && iconPosition === "left"}
30
  <p class:opacity-0={loading}>
31
  <Icon icon={icon} class="w-[20px] h-[20px]" />
@@ -68,5 +76,10 @@ import { goto } from '$app/navigation';
68
  &:hover {
69
  @apply brightness-125
70
  }
 
 
 
 
 
71
  }
72
  </style>
 
25
 
26
  </script>
27
 
28
+ <button
29
+ class="button {theme} {size} relative whitespace-nowrap {disabled ? 'disabled' : ''}"
30
+ class:!bg-neutral-400={loading}
31
+ class:!border-neutral-400={loading}
32
+ class:!grayscale={disabled}
33
+ class:!cursor-not-allowed={disabled}
34
+ class:!text-neutral-700={disabled}
35
+ on:click={handleClick}
36
+ >
37
  {#if icon && iconPosition === "left"}
38
  <p class:opacity-0={loading}>
39
  <Icon icon={icon} class="w-[20px] h-[20px]" />
 
76
  &:hover {
77
  @apply brightness-125
78
  }
79
+ &.disabled {
80
+ &:hover {
81
+ @apply brightness-100
82
+ }
83
+ }
84
  }
85
  </style>
src/lib/components/generate/Banner.svelte CHANGED
@@ -4,7 +4,7 @@
4
  import Button from "$lib/components/Button.svelte";
5
  </script>
6
 
7
- <div class="w-full rounded-xl mb-8 relative p-6 xl:p-8 flex flex-col xl:flex-row items-start xl:items-center justify-between gap-4 ring-4 ring-white/20">
8
  <div
9
  class="bg-cover bg-center brightness-75 absolute left-0 top-0 h-full w-full rounded-xl"
10
  style={`
 
4
  import Button from "$lib/components/Button.svelte";
5
  </script>
6
 
7
+ <div class="w-full rounded-xl relative p-6 xl:p-8 flex flex-col xl:flex-row items-start xl:items-center justify-between gap-4 ring-4 ring-white/20">
8
  <div
9
  class="bg-cover bg-center brightness-75 absolute left-0 top-0 h-full w-full rounded-xl"
10
  style={`
src/lib/components/generate/Response.svelte CHANGED
@@ -33,7 +33,7 @@
33
 
34
  </script>
35
 
36
- <div class="w-full border-l border-neutral-800 h-full col-span-2" class:!border-black={!response}>
37
  {#if response}
38
  {#if typeof response === "string"}
39
  <img src={response} alt="Generation" class="w-full mx-auto object-contain" />
 
33
 
34
  </script>
35
 
36
+ <div class="w-full border-t xl:border-t-0 xl:border-l border-neutral-800 h-full col-span-5 xl:col-span-2" class:!border-black={!response}>
37
  {#if response}
38
  {#if typeof response === "string"}
39
  <img src={response} alt="Generation" class="w-full mx-auto object-contain" />
src/lib/components/sidebar/Sidebar.svelte CHANGED
@@ -26,7 +26,7 @@
26
  </script>
27
 
28
  <button class="bg-transparent absolute top-10 right-8 cursor-pointer xl:hidden" on:click="{handleClick}">
29
- <Icon icon="{isOpen ? "mdi:hamburger-remove" : "mdi:hamburger-plus"}" class="w-7 h-7 text-white" />
30
  </button>
31
  <aside class="bg-neutral-950 h-screen border-r border-neutral-800 w-full max-w-[344px] absolute -translate-x-full xl:translate-x-0 transition-all duration-200 xl:relative z-20 xl:z-0 flex flex-col justify-between" class:translate-x-0={isOpen}>
32
  <div class="w-full">
 
26
  </script>
27
 
28
  <button class="bg-transparent absolute top-10 right-8 cursor-pointer xl:hidden" on:click="{handleClick}">
29
+ <Icon icon="{isOpen ? "mdi:hamburger-remove" : "mdi:hamburger-plus"}" class="w-7 h-7 text-white relative z-10" />
30
  </button>
31
  <aside class="bg-neutral-950 h-screen border-r border-neutral-800 w-full max-w-[344px] absolute -translate-x-full xl:translate-x-0 transition-all duration-200 xl:relative z-20 xl:z-0 flex flex-col justify-between" class:translate-x-0={isOpen}>
32
  <div class="w-full">
src/routes/+page.svelte CHANGED
@@ -9,7 +9,7 @@
9
  import GoTop from "$lib/components/GoTop.svelte";
10
  import Dialog from "$lib/components/dialog/Dialog.svelte";
11
  import SubmitModel from "$lib/components/models/Submit.svelte";
12
- import UserIsLogged from "$lib/components/UserIsLogged.svelte";
13
 
14
  export let data
15
 
@@ -61,29 +61,31 @@
61
  <Radio options={MODELS_FILTER_OPTIONS} value="{form.filter}" onChange={handleChangeFilter} />
62
  <div class="items-center justify-end gap-5 hidden lg:flex">
63
  <Button href="https://huggingface.co/new/stable-diffusion-lora" target="_blank" icon="ic:round-plus" theme="dark" size="lg">Create</Button>
64
- <UserIsLogged>
65
  <Button
66
  icon="octicon:upload-16"
67
  theme="blue"
68
  size="lg"
 
69
  onClick={() => submitModelDialog = true}
70
  >
71
  Upload model
72
  </Button>
73
- </UserIsLogged>
74
  </div>
75
  <div class="items-center justify-end gap-3 flex lg:hidden">
76
  <Button href="https://huggingface.co/new/stable-diffusion-lora" target="_blank" icon="ic:round-plus" theme="dark" size="md">Create</Button>
77
- <UserIsLogged>
78
  <Button
79
  icon="octicon:upload-16"
80
  theme="blue"
81
  size="md"
 
82
  onClick={() => submitModelDialog = true}
83
  >
84
  Upload model
85
  </Button>
86
- </UserIsLogged>
87
  </div>
88
  </div>
89
  <div class="mt-5 max-w-sm">
 
9
  import GoTop from "$lib/components/GoTop.svelte";
10
  import Dialog from "$lib/components/dialog/Dialog.svelte";
11
  import SubmitModel from "$lib/components/models/Submit.svelte";
12
+ // import UserIsLogged from "$lib/components/UserIsLogged.svelte";
13
 
14
  export let data
15
 
 
61
  <Radio options={MODELS_FILTER_OPTIONS} value="{form.filter}" onChange={handleChangeFilter} />
62
  <div class="items-center justify-end gap-5 hidden lg:flex">
63
  <Button href="https://huggingface.co/new/stable-diffusion-lora" target="_blank" icon="ic:round-plus" theme="dark" size="lg">Create</Button>
64
+ <!-- <UserIsLogged> -->
65
  <Button
66
  icon="octicon:upload-16"
67
  theme="blue"
68
  size="lg"
69
+ disabled={true}
70
  onClick={() => submitModelDialog = true}
71
  >
72
  Upload model
73
  </Button>
74
+ <!-- </UserIsLogged> -->
75
  </div>
76
  <div class="items-center justify-end gap-3 flex lg:hidden">
77
  <Button href="https://huggingface.co/new/stable-diffusion-lora" target="_blank" icon="ic:round-plus" theme="dark" size="md">Create</Button>
78
+ <!-- <UserIsLogged> -->
79
  <Button
80
  icon="octicon:upload-16"
81
  theme="blue"
82
  size="md"
83
+ disabled={true}
84
  onClick={() => submitModelDialog = true}
85
  >
86
  Upload model
87
  </Button>
88
+ <!-- </UserIsLogged> -->
89
  </div>
90
  </div>
91
  <div class="mt-5 max-w-sm">
src/routes/gallery/+page.svelte CHANGED
@@ -8,7 +8,7 @@
8
  import Radio from "$lib/components/fields/Radio.svelte";
9
  import { COMMUNITY_FILTER_OPTIONS } from "$lib/utils/index.js";
10
  import GoTop from "$lib/components/GoTop.svelte";
11
- import UserIsLogged from "$lib/components/UserIsLogged.svelte";
12
 
13
  export let data
14
 
@@ -55,15 +55,15 @@
55
  <div class="flex items-center justify-between mt-5">
56
  <Radio options={COMMUNITY_FILTER_OPTIONS} value="{form.filter}" onChange={handleChangeFilter} />
57
  <div class="items-center justify-end gap-5 hidden lg:flex">
58
- <UserIsLogged>
59
- <Button icon="ic:round-plus" theme="dark" size="lg">Upload own Image</Button>
60
- </UserIsLogged>
61
  <Button icon="fluent:glance-horizontal-sparkles-16-filled" href="/generate" theme="pink" size="lg">Generate</Button>
62
  </div>
63
  <div class="items-center justify-end gap-3 flex lg:hidden">
64
- <UserIsLogged>
65
- <Button icon="ic:round-plus" theme="dark" size="md">Upload own Image</Button>
66
- </UserIsLogged>
67
  <Button icon="fluent:glance-horizontal-sparkles-16-filled" href="/generate" theme="pink" size="md">Generate</Button>
68
  </div>
69
  </div>
 
8
  import Radio from "$lib/components/fields/Radio.svelte";
9
  import { COMMUNITY_FILTER_OPTIONS } from "$lib/utils/index.js";
10
  import GoTop from "$lib/components/GoTop.svelte";
11
+ // import UserIsLogged from "$lib/components/UserIsLogged.svelte";
12
 
13
  export let data
14
 
 
55
  <div class="flex items-center justify-between mt-5">
56
  <Radio options={COMMUNITY_FILTER_OPTIONS} value="{form.filter}" onChange={handleChangeFilter} />
57
  <div class="items-center justify-end gap-5 hidden lg:flex">
58
+ <!-- <UserIsLogged> -->
59
+ <Button icon="ic:round-plus" disabled={true} theme="dark" size="lg">Upload own Image</Button>
60
+ <!-- </UserIsLogged> -->
61
  <Button icon="fluent:glance-horizontal-sparkles-16-filled" href="/generate" theme="pink" size="lg">Generate</Button>
62
  </div>
63
  <div class="items-center justify-end gap-3 flex lg:hidden">
64
+ <!-- <UserIsLogged> -->
65
+ <Button icon="ic:round-plus" disabled={true} theme="dark" size="md">Upload own Image</Button>
66
+ <!-- </UserIsLogged> -->
67
  <Button icon="fluent:glance-horizontal-sparkles-16-filled" href="/generate" theme="pink" size="md">Generate</Button>
68
  </div>
69
  </div>
src/routes/generate/+page.svelte CHANGED
@@ -54,12 +54,14 @@
54
  }
55
  </script>
56
 
57
- <main class="grid grid-cols-5 w-full h-full gap-10">
58
- <div class="w-full px-6 py-10 lg:px-10 lg:py-12 col-span-3">
59
- <Banner />
60
- <h1 class="text-white font-semibold text-2xl">
61
- Start generating
62
- </h1>
 
 
63
  <div class="mt-5 grid grid-cols-1 gap-6">
64
  <div>
65
  <p class="text-neutral-300 mb-2.5 text-base">Models</p>
 
54
  }
55
  </script>
56
 
57
+ <main class="grid grid-cols-5 w-full h-full gap-5 xl:gap-10">
58
+ <div class="w-full px-6 py-10 lg:px-10 lg:py-12 col-span-5 xl:col-span-3">
59
+ <div class="w-full flex gap-8 flex-col-reverse xl:flex-col">
60
+ <Banner />
61
+ <h1 class="text-white font-semibold text-2xl">
62
+ Start generating
63
+ </h1>
64
+ </div>
65
  <div class="mt-5 grid grid-cols-1 gap-6">
66
  <div>
67
  <p class="text-neutral-300 mb-2.5 text-base">Models</p>