chrisvoncsefalvay commited on
Commit
bd4e378
Β·
1 Parent(s): 1e3577a

Final UI polish: social icons and button functionality

Browse files

- Renamed 'Dental Education Assistant' to 'Response'
- Added inline social icons for model author (GitHub, LinkedIn)
- Added inline social icons for space creator (GitHub, X, Website)
- Fixed question button functionality with proper JavaScript event handling
- Improved icon styling with hover effects
- Removed redundant social links section

Files changed (1) hide show
  1. app.py +33 -27
app.py CHANGED
@@ -183,25 +183,19 @@ custom_css = """
183
  text-decoration: underline;
184
  }
185
 
186
- .social-links {
187
- display: flex;
188
- justify-content: center;
189
- gap: 16px;
190
- margin-top: 12px;
191
- }
192
-
193
- .social-link {
194
- color: #e0e7ff;
195
  text-decoration: none;
196
- font-size: 14px;
197
- padding: 4px 8px;
198
- border-radius: 6px;
199
- transition: all 0.2s;
200
  }
201
 
202
- .social-link:hover {
203
- background: rgba(255,255,255,0.1);
204
- color: white;
205
  }
206
 
207
  /* Mini model card - skeuomorphic design */
@@ -634,8 +628,8 @@ custom_css = """
634
  grid-template-columns: repeat(2, 1fr);
635
  }
636
 
637
- .social-links {
638
- flex-wrap: wrap;
639
  }
640
 
641
  .citation-boxes {
@@ -672,13 +666,14 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, js=question_js) as demo:
672
  <h1 class="header-title">🦷 DentaInstruct-1.2B Demo</h1>
673
  <p class="header-subtitle">Advanced AI assistant for dental education and oral health information</p>
674
  <div class="header-credits">
675
- Model by <a href="https://huggingface.co/yasserrmd" target="_blank">yasserrmd</a> /
 
 
 
676
  Space by <a href="https://huggingface.co/chrisvoncsefalvay" target="_blank">Chris von Csefalvay</a>
677
- </div>
678
- <div class="social-links">
679
- <a href="https://github.com/chrisvoncsefalvay" target="_blank" class="social-link">GitHub</a>
680
- <a href="https://twitter.com/epichrisis" target="_blank" class="social-link">X/Twitter</a>
681
- <a href="https://chrisvoncsefalvay.com" target="_blank" class="social-link">Website</a>
682
  </div>
683
  </div>
684
  """
@@ -739,7 +734,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, js=question_js) as demo:
739
  with gr.Column(scale=2, elem_classes="chat-container"):
740
  chatbot = gr.Chatbot(
741
  height=500,
742
- label="Dental Education Assistant",
743
  show_label=True,
744
  avatar_images=None,
745
  bubble_full_width=False,
@@ -771,9 +766,20 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, js=question_js) as demo:
771
  <div class="carousel-card">
772
  <div class="carousel-card-title">{category}</div>
773
  """
774
- for question in questions:
 
 
775
  carousel_html += f"""
776
- <button class="question-button" type="button">{question}</button>
 
 
 
 
 
 
 
 
 
777
  """
778
  carousel_html += "</div>"
779
 
 
183
  text-decoration: underline;
184
  }
185
 
186
+ .social-icon {
187
+ display: inline-block;
188
+ margin-left: 8px;
 
 
 
 
 
 
189
  text-decoration: none;
190
+ font-size: 18px;
191
+ opacity: 0.85;
192
+ transition: all 0.2s ease;
193
+ vertical-align: middle;
194
  }
195
 
196
+ .social-icon:hover {
197
+ opacity: 1;
198
+ transform: translateY(-2px);
199
  }
200
 
201
  /* Mini model card - skeuomorphic design */
 
628
  grid-template-columns: repeat(2, 1fr);
629
  }
630
 
631
+ .social-icon {
632
+ font-size: 16px;
633
  }
634
 
635
  .citation-boxes {
 
666
  <h1 class="header-title">🦷 DentaInstruct-1.2B Demo</h1>
667
  <p class="header-subtitle">Advanced AI assistant for dental education and oral health information</p>
668
  <div class="header-credits">
669
+ Model by <a href="https://huggingface.co/yasserrmd" target="_blank">yasserrmd</a>
670
+ <a href="https://github.com/YASSERRMD" target="_blank" class="social-icon" title="GitHub">πŸ”—</a>
671
+ <a href="https://www.linkedin.com/in/moyasser" target="_blank" class="social-icon" title="LinkedIn">πŸ’Ό</a>
672
+ <span style="margin: 0 10px;">/</span>
673
  Space by <a href="https://huggingface.co/chrisvoncsefalvay" target="_blank">Chris von Csefalvay</a>
674
+ <a href="https://github.com/chrisvoncsefalvay" target="_blank" class="social-icon" title="GitHub">πŸ”—</a>
675
+ <a href="https://twitter.com/epichrisis" target="_blank" class="social-icon" title="X">𝕏</a>
676
+ <a href="https://chrisvoncsefalvay.com" target="_blank" class="social-icon" title="Website">🌐</a>
 
 
677
  </div>
678
  </div>
679
  """
 
734
  with gr.Column(scale=2, elem_classes="chat-container"):
735
  chatbot = gr.Chatbot(
736
  height=500,
737
+ label="Response",
738
  show_label=True,
739
  avatar_images=None,
740
  bubble_full_width=False,
 
766
  <div class="carousel-card">
767
  <div class="carousel-card-title">{category}</div>
768
  """
769
+ for i, question in enumerate(questions):
770
+ # Escape quotes in the question for JavaScript
771
+ escaped_question = question.replace("'", "\\'")
772
  carousel_html += f"""
773
+ <button class="question-button" type="button"
774
+ onclick="
775
+ const textarea = document.querySelector('textarea');
776
+ if (textarea) {{
777
+ textarea.value = '{escaped_question}';
778
+ textarea.dispatchEvent(new Event('input', {{bubbles: true}}));
779
+ }}
780
+ ">
781
+ {question}
782
+ </button>
783
  """
784
  carousel_html += "</div>"
785