Akis Giannoukos commited on
Commit
ffa3a03
·
1 Parent(s): 1cbe806

Refine voice bubble styles in demo interface for improved aesthetics and interaction, including hover and active effects, while hiding unnecessary microphone UI elements.

Browse files
Files changed (1) hide show
  1. app.py +25 -11
app.py CHANGED
@@ -582,22 +582,36 @@ def create_demo():
582
  with gr.Blocks(
583
  theme=gr.themes.Soft(),
584
  css='''
585
- /* Voice bubble styles */
586
  #voice-bubble {
587
- width: 240px; height: 240px; border-radius: 9999px; margin: 24px auto;
588
  display: flex; align-items: center; justify-content: center;
589
- background: radial-gradient(100% 100% at 50% 0%, #6ee7b7 0%, #34d399 100%);
590
- box-shadow: 0 10px 20px rgba(16,185,129,0.35), 0 6px 6px rgba(16,185,129,0.30);
591
- transition: transform 150ms ease, box-shadow 150ms ease;
 
 
 
 
 
 
 
 
 
 
 
 
592
  }
593
- #voice-bubble:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(16,185,129,0.40), 0 10px 10px rgba(16,185,129,0.35); }
594
- #voice-bubble.listening { animation: bubble-pulse 1.2s ease-in-out infinite; background: radial-gradient(100% 100% at 50% 0%, #fb7185 0%, #ef4444 100%); }
595
- #voice-bubble button { background: transparent; border: none; font-size: 48px; color: #ffffff; box-shadow: none; }
596
  @keyframes bubble-pulse {
597
- 0% { transform: scale(1.0); box-shadow: 0 0 0 0 rgba(239,68,68,0.45); }
598
- 70% { transform: scale(1.06); box-shadow: 0 0 0 20px rgba(239,68,68,0.0); }
599
- 100% { transform: scale(1.0); box-shadow: 0 0 0 0 rgba(239,68,68,0.0); }
600
  }
 
 
 
 
 
 
601
  /* Hide TTS player UI but keep it in DOM for autoplay */
602
  #tts-player { width: 0 !important; height: 0 !important; opacity: 0 !important; position: absolute; pointer-events: none; }
603
  '''
 
582
  with gr.Blocks(
583
  theme=gr.themes.Soft(),
584
  css='''
585
+ /* Voice bubble styles - clean and centered */
586
  #voice-bubble {
587
+ width: 240px; height: 240px; border-radius: 9999px; margin: 40px auto;
588
  display: flex; align-items: center; justify-content: center;
589
+ background: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
590
+ box-shadow: 0 20px 40px rgba(16,185,129,0.3), 0 0 0 1px rgba(255,255,255,0.1) inset;
591
+ transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
592
+ cursor: pointer;
593
+ position: relative;
594
+ }
595
+ #voice-bubble:hover {
596
+ transform: translateY(-2px) scale(1.02);
597
+ box-shadow: 0 25px 50px rgba(16,185,129,0.4), 0 0 0 1px rgba(255,255,255,0.15) inset;
598
+ }
599
+ #voice-bubble:active { transform: translateY(0px) scale(0.98); }
600
+ #voice-bubble.listening {
601
+ animation: bubble-pulse 1.5s ease-in-out infinite;
602
+ background: linear-gradient(135deg, #fb7185 0%, #ef4444 100%);
603
+ box-shadow: 0 20px 40px rgba(239,68,68,0.4), 0 0 0 1px rgba(255,255,255,0.1) inset;
604
  }
 
 
 
605
  @keyframes bubble-pulse {
606
+ 0%, 100% { transform: scale(1.0); box-shadow: 0 20px 40px rgba(239,68,68,0.4), 0 0 0 0 rgba(239,68,68,0.5); }
607
+ 50% { transform: scale(1.05); box-shadow: 0 25px 50px rgba(239,68,68,0.5), 0 0 0 15px rgba(239,68,68,0.0); }
 
608
  }
609
+ /* Hide all microphone UI chrome except the bubble itself */
610
+ #voice-bubble .mic-dropdown,
611
+ #voice-bubble select,
612
+ #voice-bubble .source-selection,
613
+ #voice-bubble button:not(.record-button) { display: none !important; }
614
+ #voice-bubble .controls { display: none !important; }
615
  /* Hide TTS player UI but keep it in DOM for autoplay */
616
  #tts-player { width: 0 !important; height: 0 !important; opacity: 0 !important; position: absolute; pointer-events: none; }
617
  '''