tianfengping.tfp commited on
Commit
0c4a3eb
·
1 Parent(s): 9d5a4ea

beatify profile

Browse files
Files changed (1) hide show
  1. app.py +122 -55
app.py CHANGED
@@ -397,53 +397,95 @@ body {
397
  padding: 0 1rem;
398
  }
399
 
400
- .header {
401
- padding: 0 !important;
402
- border-radius: 10px; /* 整个 Header 的圆角 */
403
- overflow: hidden; /* 隐藏超出圆角部分的内容,非常重要! */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
404
  }
405
 
406
- /* 2. 行容器:使用 Flex 布局,让左右两部分等高 */
407
- #header-row {
 
 
 
 
 
 
408
  display: flex;
409
- align-items: stretch; /* 让子项高度自动拉伸以填满容器 */
 
 
 
410
  }
411
 
412
- /* 3. Logo 容器:移除 Gradio 默认的所有样式,让它变成一个纯净的盒子 */
413
- #logo-container {
414
- padding: 0 !important;
 
 
415
  border: none !important;
416
- background: none !important;
417
- box-shadow: none !important;
418
- min-width: 150px; /* 给 Logo 区域一个固定的最小宽度 */
419
- flex-shrink: 0; /* 防止在空间不足时被压缩 */
420
  }
421
 
422
- /* 4. Logo 图片本身:让图片填满它的容器,就像背景图一样 */
423
- #logo-container img {
424
- width: 100%;
425
- height: 100%;
426
- object-fit: cover; /* 裁剪并填充,保持宽高比,确保填满容器 */
427
- display: block; /* 移除图片底部的微小空隙 */
428
  }
429
 
430
- /* 5. 标题区域:设置背景、内边距和文本对齐 */
431
- #title-area {
432
- background: linear-gradient(to right, #5e57c2, #42a5f5); /* 右侧的渐变背景 */
433
- padding: 20px 25px; /* 给标题文本留出足够的空间 */
434
- display: flex;
435
- flex-direction: column;
436
- justify-content: center; /* 垂直居中标题 */
437
- flex-grow: 1; /* 占据所有剩余空间 */
438
  }
439
 
440
- /* 6. title */
441
- #header-title h1 {
442
- color: white;
443
- font-size: 28px;
444
- margin: 0;
445
- font-weight: 600;
446
- text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
 
 
447
  }
448
 
449
  .tabs {
@@ -651,12 +693,26 @@ input[type="text"]:focus, textarea:focus {
651
  }
652
 
653
  @media (max-width: 768px) {
654
- .header h1 {
655
- font-size: 2.2rem;
 
 
 
 
 
 
 
 
656
  }
657
 
658
- .header p {
659
- font-size: 1rem;
 
 
 
 
 
 
660
  }
661
 
662
  .gradio-container {
@@ -672,22 +728,33 @@ input[type="text"]:focus, textarea:focus {
672
 
673
 
674
  with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
675
- with gr.Column(elem_classes="header"):
676
- with gr.Row(elem_id="header-row", variant="compact"):
677
- # Load logo if available, otherwise hide the component to avoid showing upload interface
678
- # Note: gr.Image with value=None shows upload interface, so we use visible=False if no logo
679
- logo_exists = logo_path is not None and os.path.exists(logo_path) if logo_path else False
680
- logo_image = gr.Image(
681
- value=logo_path if logo_exists else None,
682
- elem_id="logo-container",
683
- show_label=False,
684
- show_download_button=False,
685
- show_share_button=False,
686
- visible=logo_exists
687
- )
688
-
689
- with gr.Column(elem_id="title-area"):
690
- gr.Markdown("# 🎤 Marco-Voice ", elem_id="header-title")
 
 
 
 
 
 
 
 
 
 
 
691
 
692
  with gr.Tabs(elem_classes="tabs") as tabs:
693
  with gr.TabItem("😄 Control of emotion", id=0):
 
397
  padding: 0 1rem;
398
  }
399
 
400
+ /* Main header with blue background */
401
+ #main-header {
402
+ background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%) !important;
403
+ padding: 60px 40px !important;
404
+ border-radius: 0 !important;
405
+ margin-bottom: 2rem !important;
406
+ text-align: center;
407
+ }
408
+
409
+ #header-content {
410
+ max-width: 1200px;
411
+ margin: 0 auto;
412
+ }
413
+
414
+ /* Main title */
415
+ #main-title {
416
+ color: white !important;
417
+ font-size: 48px !important;
418
+ font-weight: 700 !important;
419
+ margin: 0 0 10px 0 !important;
420
+ text-align: center;
421
+ letter-spacing: -1px;
422
+ }
423
+
424
+ #main-title h1 {
425
+ color: white !important;
426
+ font-size: 48px !important;
427
+ font-weight: 700 !important;
428
+ margin: 0 !important;
429
+ text-align: center;
430
+ letter-spacing: -1px;
431
+ }
432
+
433
+ /* Subtitle */
434
+ #subtitle {
435
+ color: rgba(255, 255, 255, 0.9) !important;
436
+ font-size: 18px !important;
437
+ font-weight: 400 !important;
438
+ margin: 0 0 40px 0 !important;
439
+ text-align: center;
440
  }
441
 
442
+ #subtitle p {
443
+ color: rgba(255, 255, 255, 0.9) !important;
444
+ font-size: 18px !important;
445
+ margin: 0 !important;
446
+ }
447
+
448
+ /* Button row */
449
+ #button-row {
450
  display: flex;
451
+ justify-content: center;
452
+ gap: 12px;
453
+ flex-wrap: wrap;
454
+ margin-top: 30px;
455
  }
456
 
457
+ .header-btn {
458
+ padding: 12px 24px !important;
459
+ border-radius: 6px !important;
460
+ font-weight: 600 !important;
461
+ font-size: 14px !important;
462
  border: none !important;
463
+ cursor: pointer;
464
+ transition: all 0.3s ease !important;
465
+ min-width: 120px;
 
466
  }
467
 
468
+ .header-btn-secondary {
469
+ background: rgba(255, 255, 255, 0.15) !important;
470
+ color: white !important;
471
+ backdrop-filter: blur(10px);
 
 
472
  }
473
 
474
+ .header-btn-secondary:hover {
475
+ background: rgba(255, 255, 255, 0.25) !important;
476
+ transform: translateY(-2px);
477
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
 
 
 
 
478
  }
479
 
480
+ .header-btn-primary {
481
+ background: #fbbf24 !important;
482
+ color: #1e3a8a !important;
483
+ }
484
+
485
+ .header-btn-primary:hover {
486
+ background: #f59e0b !important;
487
+ transform: translateY(-2px);
488
+ box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4) !important;
489
  }
490
 
491
  .tabs {
 
693
  }
694
 
695
  @media (max-width: 768px) {
696
+ #main-header {
697
+ padding: 40px 20px !important;
698
+ }
699
+
700
+ #main-title h1 {
701
+ font-size: 32px !important;
702
+ }
703
+
704
+ #subtitle p {
705
+ font-size: 16px !important;
706
  }
707
 
708
+ #button-row {
709
+ gap: 8px;
710
+ }
711
+
712
+ .header-btn {
713
+ padding: 10px 16px !important;
714
+ font-size: 12px !important;
715
+ min-width: 100px;
716
  }
717
 
718
  .gradio-container {
 
728
 
729
 
730
  with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
731
+ # Header section with blue background
732
+ gr.HTML(
733
+ """
734
+ <div align="center" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Microsoft YaHei', sans-serif; padding: 60px 20px; background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%); margin-bottom: 2rem;">
735
+ <h1 style="font-weight: 700; color: #FFFFFF; margin-bottom: 0.25rem; font-size: 2.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.2);">
736
+ Marco-Voice-TTS
737
+ </h1>
738
+ <p style="margin-top: 0; margin-bottom: 1.5rem;">
739
+ <a href="https://www.aidc-ai.com" style="font-size: 1.25rem; color: #FBBF24; text-decoration: none; font-weight: 500; text-shadow: 0 1px 2px rgba(0,0,0,0.2);">
740
+ Alibaba International Digital Commerce
741
+ </a>
742
+ </p>
743
+
744
+ <div style="display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;">
745
+ <a href="https://github.com/AIDC-AI/Marco-Voice" target="_blank">
746
+ <img src="https://img.shields.io/badge/GitHub-Repository-181717?logo=github&style=for-the-badge" alt="GitHub">
747
+ </a>
748
+ <a href="https://huggingface.co/AIDC-AI/Marco-Voice" target="_blank">
749
+ <img src="https://img.shields.io/badge/Hugging%20Face-Model-FFC107?logo=huggingface&style=for-the-badge" alt="Hugging Face Model">
750
+ </a>
751
+ <a href="https://huggingface.co/spaces/AIDC-AI/Marco-Voice-TTS" target="_blank">
752
+ <img src="https://img.shields.io/badge/Demo-HF%20Space-E67E22?logo=huggingface&style=for-the-badge" alt="Demo HF Space">
753
+ </a>
754
+ </div>
755
+ </div>
756
+ """
757
+ )
758
 
759
  with gr.Tabs(elem_classes="tabs") as tabs:
760
  with gr.TabItem("😄 Control of emotion", id=0):