adamelliotfields commited on
Commit
ef33bcd
1 Parent(s): f24703f

Navbar and menu improvements

Browse files
Files changed (4) hide show
  1. app.css +49 -31
  2. app.js +0 -2
  3. app.py +5 -7
  4. partials/intro.html +14 -10
app.css CHANGED
@@ -34,7 +34,7 @@
34
  }
35
  .gallery, .gallery .grid-wrap {
36
  height: calc(100vh - 360px);
37
- max-height: calc(100vh - 360px);
38
  }
39
 
40
  .icon-button {
@@ -45,6 +45,50 @@
45
  max-height: calc(100vh - 480px);
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  .popover {
49
  position: relative;
50
  }
@@ -70,39 +114,9 @@
70
  content: 'Clear gallery';
71
  }
72
  .popover#refresh:hover::after {
73
- /* see config.py for default seed */
74
  content: var(--seed, "-1");
75
  }
76
 
77
- #intro {
78
- margin-bottom: 8px !important;
79
- }
80
- #intro > div {
81
- display: flex;
82
- }
83
- #intro > div > h1 > span {
84
- font-style: italic;
85
- color: #047857 !important;
86
- }
87
- #intro > div > h1 > span:is(.dark *) {
88
- color: #10b981 !important;
89
- }
90
- #intro > div > svg {
91
- width: 1.5rem;
92
- height: 1.5rem;
93
- margin-top: 0.25rem;
94
- margin-left: 0.5rem;
95
- align-self: center;
96
- fill: #047857 !important;
97
- animation: spin 3s linear infinite reverse;
98
- }
99
- #intro > div > svg:is(.dark *) {
100
- fill: #10b981 !important;
101
- }
102
- @keyframes spin {
103
- 100% { transform: rotate(360deg); }
104
- }
105
-
106
  .tabs, .tabitem, .tab-nav, .tab-nav > .selected {
107
  border-width: 0px;
108
  }
@@ -118,3 +132,7 @@
118
  .tab-nav > button {
119
  padding-bottom: 8px;
120
  }
 
 
 
 
 
34
  }
35
  .gallery, .gallery .grid-wrap {
36
  height: calc(100vh - 360px);
37
+ max-height: none;
38
  }
39
 
40
  .icon-button {
 
45
  max-height: calc(100vh - 480px);
46
  }
47
 
48
+ #intro {
49
+ margin-bottom: 8px !important;
50
+ }
51
+ #intro > div {
52
+ display: flex;
53
+ }
54
+ #intro > div > h1 > span {
55
+ font-style: italic;
56
+ color: #047857 !important;
57
+ }
58
+ #intro > div > h1 > span:is(.dark *) {
59
+ color: #10b981 !important;
60
+ }
61
+ #intro > div > svg {
62
+ width: 1.5rem;
63
+ height: 1.5rem;
64
+ margin-top: 0.25rem;
65
+ margin-left: 0.5rem;
66
+ align-self: center;
67
+ fill: #047857 !important;
68
+ animation: spin 3s linear infinite reverse;
69
+ }
70
+ #intro > div > svg:is(.dark *) {
71
+ fill: #10b981 !important;
72
+ }
73
+ #intro nav {
74
+ display: flex;
75
+ column-gap: 0.5rem;
76
+ }
77
+ #intro nav a, #intro nav span {
78
+ white-space: nowrap;
79
+ font-family: monospace;
80
+ }
81
+ #intro nav span {
82
+ font-weight: 500;
83
+ color: var(--body-text-color);
84
+ }
85
+ #intro nav a {
86
+ color: var(--body-text-color-subdued);
87
+ }
88
+ #intro nav a:hover {
89
+ color: var(--body-text-color);
90
+ }
91
+
92
  .popover {
93
  position: relative;
94
  }
 
114
  content: 'Clear gallery';
115
  }
116
  .popover#refresh:hover::after {
 
117
  content: var(--seed, "-1");
118
  }
119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  .tabs, .tabitem, .tab-nav, .tab-nav > .selected {
121
  border-width: 0px;
122
  }
 
132
  .tab-nav > button {
133
  padding-bottom: 8px;
134
  }
135
+
136
+ @keyframes spin {
137
+ 100% { transform: rotate(360deg); }
138
+ }
app.js CHANGED
@@ -1,12 +1,10 @@
1
  () =>{
2
  const menu = document.querySelector("#menu");
3
  const menuButton = menu.querySelector("button");
4
- const menuSpan = menuButton.querySelector("span:first-child");
5
  const content = document.querySelector("#content");
6
 
7
  const updateMenu = () => {
8
  const isOpen = menuButton.classList.contains("open");
9
- menuSpan.textContent = isOpen ? "Hide menu" : "Show menu";
10
  content.style.display = isOpen ? "none" : "flex";
11
  };
12
 
 
1
  () =>{
2
  const menu = document.querySelector("#menu");
3
  const menuButton = menu.querySelector("button");
 
4
  const content = document.querySelector("#content");
5
 
6
  const updateMenu = () => {
7
  const isOpen = menuButton.classList.contains("open");
 
8
  content.style.display = isOpen ? "none" : "flex";
9
  };
10
 
app.py CHANGED
@@ -128,7 +128,7 @@ with gr.Blocks(
128
  with gr.Accordion(
129
  elem_classes=["accordion"],
130
  elem_id="menu",
131
- label="Show menu",
132
  open=False,
133
  ):
134
  with gr.Tabs():
@@ -324,28 +324,26 @@ with gr.Blocks(
324
  value=False,
325
  )
326
 
327
- with gr.TabItem("ℹ️ Usage"):
328
- gr.Markdown(read_file("usage.md"), elem_classes=["markdown"])
329
-
330
  # Main content
331
  with gr.Column(elem_id="content"):
332
  with gr.Group():
333
  output_images = gr.Gallery(
334
  elem_classes=["gallery"],
335
  show_share_button=False,
 
336
  interactive=False,
337
  show_label=False,
338
- object_fit="cover",
339
  label="Output",
340
  format="png",
341
  columns=2,
342
  )
343
  prompt = gr.Textbox(
344
  placeholder="corgi, beach, 8k",
 
345
  show_label=False,
346
  label="Prompt",
347
- value=None,
348
- lines=2,
349
  )
350
 
351
  # Buttons
 
128
  with gr.Accordion(
129
  elem_classes=["accordion"],
130
  elem_id="menu",
131
+ label="Menu",
132
  open=False,
133
  ):
134
  with gr.Tabs():
 
324
  value=False,
325
  )
326
 
 
 
 
327
  # Main content
328
  with gr.Column(elem_id="content"):
329
  with gr.Group():
330
  output_images = gr.Gallery(
331
  elem_classes=["gallery"],
332
  show_share_button=False,
333
+ object_fit="cover",
334
  interactive=False,
335
  show_label=False,
 
336
  label="Output",
337
  format="png",
338
  columns=2,
339
  )
340
  prompt = gr.Textbox(
341
  placeholder="corgi, beach, 8k",
342
+ autoscroll=False,
343
  show_label=False,
344
  label="Prompt",
345
+ max_lines=3,
346
+ lines=3,
347
  )
348
 
349
  # Buttons
partials/intro.html CHANGED
@@ -7,14 +7,18 @@
7
  <path d="M7.48877 6.75C7.29015 6.75 7.09967 6.82902 6.95923 6.96967C6.81879 7.11032 6.73989 7.30109 6.73989 7.5C6.73989 7.69891 6.81879 7.88968 6.95923 8.03033C7.09967 8.17098 7.29015 8.25 7.48877 8.25C7.68738 8.25 7.87786 8.17098 8.0183 8.03033C8.15874 7.88968 8.23764 7.69891 8.23764 7.5C8.23764 7.30109 8.15874 7.11032 8.0183 6.96967C7.87786 6.82902 7.68738 6.75 7.48877 6.75ZM7.8632 0C11.2331 0 11.3155 2.6775 9.54818 3.5625C8.80679 3.93 8.47728 4.7175 8.335 5.415C8.69446 5.565 9.00899 5.7975 9.24863 6.0975C12.0195 4.5975 15 5.19 15 7.875C15 11.25 12.3265 11.325 11.4428 9.5475C11.0684 8.805 10.2746 8.475 9.57813 8.3325C9.42836 8.6925 9.19621 9 8.89665 9.255C10.3869 12.0225 9.79531 15 7.11433 15C3.74438 15 3.67698 12.315 5.44433 11.43C6.17823 11.0625 6.50774 10.2825 6.65751 9.5925C6.29056 9.4425 5.96855 9.2025 5.72891 8.9025C2.96555 10.3875 0 9.8025 0 7.125C0 3.75 2.666 3.6675 3.54967 5.445C3.92411 6.1875 4.71043 6.51 5.40689 6.6525C5.54918 6.2925 5.78882 5.9775 6.09586 5.7375C4.60559 2.97 5.1972 0 7.8632 0Z"></path>
8
  </svg>
9
  </div>
10
- <p>
11
- Image generation studio on 🤗
12
- <a href="https://huggingface.co/spaces/zero-gpu-explorers/README" target="_blank" rel="noopener noreferrer">ZeroGPU</a>
13
- <a href="https://adamelliotfields-diffusion.hf.space" target="_blank" rel="noopener noreferrer">
14
- <svg style="display: inline-block" width="16px" height="16px" viewBox="0 0 12 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet">
15
- <path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 1.75H9.75C9.88807 1.75 10 1.86193 10 2V4.25C10 4.38807 9.88807 4.5 9.75 4.5C9.61193 4.5 9.5 4.38807 9.5 4.25V2.60355L6.42678 5.67678C6.32915 5.77441 6.17085 5.77441 6.07322 5.67678C5.97559 5.57915 5.97559 5.42085 6.07322 5.32322L9.14645 2.25H7.5C7.36193 2.25 7.25 2.13807 7.25 2C7.25 1.86193 7.36193 1.75 7.5 1.75Z" fill="currentColor"></path>
16
- <path fill-rule="evenodd" clip-rule="evenodd" d="M6 2.5C6 2.22386 5.77614 2 5.5 2H2.69388C2.50985 2 2.33336 2.07311 2.20323 2.20323C2.0731 2.33336 2 2.50986 2 2.69389V8.93885C2 9.12288 2.0731 9.29933 2.20323 9.42953C2.33336 9.55963 2.50985 9.63273 2.69388 9.63273H8.93884C9.12287 9.63273 9.29941 9.55963 9.42951 9.42953C9.55961 9.29933 9.63271 9.12288 9.63271 8.93885V6.5C9.63271 6.22386 9.40885 6 9.13271 6C8.85657 6 8.63271 6.22386 8.63271 6.5V8.63273H3V3H5.5C5.77614 3 6 2.77614 6 2.5Z" fill="currentColor" fill-opacity="0.3"></path>
17
- </svg>
18
- </a>
19
- </p>
 
 
 
 
20
  </div>
 
7
  <path d="M7.48877 6.75C7.29015 6.75 7.09967 6.82902 6.95923 6.96967C6.81879 7.11032 6.73989 7.30109 6.73989 7.5C6.73989 7.69891 6.81879 7.88968 6.95923 8.03033C7.09967 8.17098 7.29015 8.25 7.48877 8.25C7.68738 8.25 7.87786 8.17098 8.0183 8.03033C8.15874 7.88968 8.23764 7.69891 8.23764 7.5C8.23764 7.30109 8.15874 7.11032 8.0183 6.96967C7.87786 6.82902 7.68738 6.75 7.48877 6.75ZM7.8632 0C11.2331 0 11.3155 2.6775 9.54818 3.5625C8.80679 3.93 8.47728 4.7175 8.335 5.415C8.69446 5.565 9.00899 5.7975 9.24863 6.0975C12.0195 4.5975 15 5.19 15 7.875C15 11.25 12.3265 11.325 11.4428 9.5475C11.0684 8.805 10.2746 8.475 9.57813 8.3325C9.42836 8.6925 9.19621 9 8.89665 9.255C10.3869 12.0225 9.79531 15 7.11433 15C3.74438 15 3.67698 12.315 5.44433 11.43C6.17823 11.0625 6.50774 10.2825 6.65751 9.5925C6.29056 9.4425 5.96855 9.2025 5.72891 8.9025C2.96555 10.3875 0 9.8025 0 7.125C0 3.75 2.666 3.6675 3.54967 5.445C3.92411 6.1875 4.71043 6.51 5.40689 6.6525C5.54918 6.2925 5.78882 5.9775 6.09586 5.7375C4.60559 2.97 5.1972 0 7.8632 0Z"></path>
8
  </svg>
9
  </div>
10
+ <div>
11
+ <nav>
12
+ <span>1.5</span>
13
+ <a href="https://huggingface.co/spaces/adamelliotfields/diffusion-xl" target="_blank" rel="noopener noreferrer">XL</a>
14
+ <a href="https://huggingface.co/spaces/adamelliotfields/diffusion-flux" target="_blank" rel="noopener noreferrer">FLUX.1</a>
15
+ <a href="https://huggingface.co/spaces/adamelliotfields/diffusion/blob/main/DOCS.md" target="_blank" rel="noopener noreferrer">Docs</a>
16
+ <a href="https://adamelliotfields-diffusion.hf.space" target="_blank" rel="noopener noreferrer">
17
+ <svg style="display: inline-block" width="14px" height="14px" viewBox="0 0 12 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet">
18
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 1.75H9.75C9.88807 1.75 10 1.86193 10 2V4.25C10 4.38807 9.88807 4.5 9.75 4.5C9.61193 4.5 9.5 4.38807 9.5 4.25V2.60355L6.42678 5.67678C6.32915 5.77441 6.17085 5.77441 6.07322 5.67678C5.97559 5.57915 5.97559 5.42085 6.07322 5.32322L9.14645 2.25H7.5C7.36193 2.25 7.25 2.13807 7.25 2C7.25 1.86193 7.36193 1.75 7.5 1.75Z" fill="currentColor"></path>
19
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6 2.5C6 2.22386 5.77614 2 5.5 2H2.69388C2.50985 2 2.33336 2.07311 2.20323 2.20323C2.0731 2.33336 2 2.50986 2 2.69389V8.93885C2 9.12288 2.0731 9.29933 2.20323 9.42953C2.33336 9.55963 2.50985 9.63273 2.69388 9.63273H8.93884C9.12287 9.63273 9.29941 9.55963 9.42951 9.42953C9.55961 9.29933 9.63271 9.12288 9.63271 8.93885V6.5C9.63271 6.22386 9.40885 6 9.13271 6C8.85657 6 8.63271 6.22386 8.63271 6.5V8.63273H3V3H5.5C5.77614 3 6 2.77614 6 2.5Z" fill="currentColor" fill-opacity="0.3"></path>
20
+ </svg>
21
+ </a>
22
+ </nav>
23
+ </div>
24
  </div>