Isk5434 commited on
Commit
9aa3a30
·
verified ·
1 Parent(s): ecd9a57

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +40 -17
app.py CHANGED
@@ -611,18 +611,20 @@ input[type="range"]::-webkit-slider-runnable-track {
611
  /* ========================================
612
  Radioボタン: ダイヤモンド◆スタイル
613
  ======================================== */
614
- [data-testid="radio-group"] {
615
  background: rgba(255,255,255,0.5) !important;
616
  border: 1.25px solid #a8c8a8 !important;
617
  border-radius: 0 !important;
618
  padding: 14px 16px !important;
619
  box-shadow: 3px 3px 0px 0px #c0d8c0 !important;
620
  }
621
- [data-testid="radio-group"] label {
 
 
622
  display: flex !important;
623
  align-items: center !important;
624
  gap: 10px !important;
625
- padding: 8px 12px !important;
626
  cursor: pointer !important;
627
  transition: all 0.2s ease !important;
628
  border-bottom: 1px solid rgba(138,170,138,0.15) !important;
@@ -631,40 +633,61 @@ input[type="range"]::-webkit-slider-runnable-track {
631
  font-weight: 500 !important;
632
  letter-spacing: 0.08em !important;
633
  }
634
- [data-testid="radio-group"] label:last-child {
635
  border-bottom: none !important;
636
  }
637
- [data-testid="radio-group"] label:hover {
638
  background: rgba(178,216,210,0.15) !important;
639
  }
640
- /* ラジオ丸を隠してダイヤモンド */
641
- [data-testid="radio-group"] input[type="radio"] {
 
 
642
  -webkit-appearance: none !important;
643
  appearance: none !important;
 
 
 
644
  width: 14px !important;
645
  height: 14px !important;
646
  min-width: 14px !important;
647
  border: 1.5px solid #8aaa8a !important;
648
- border-radius: 0 !important;
649
  background: #ffffff !important;
650
  transform: rotate(45deg) !important;
651
  cursor: pointer !important;
652
  transition: all 0.25s ease !important;
653
  box-shadow: 1px 1px 3px rgba(0,0,0,0.1) !important;
654
- margin: 0 !important;
655
  padding: 0 !important;
656
  flex-shrink: 0 !important;
657
  }
658
- [data-testid="radio-group"] input[type="radio"]:checked {
659
  background: #3a5a3a !important;
660
  border-color: #3a5a3a !important;
661
  box-shadow: 2px 2px 4px rgba(0,0,0,0.2) !important;
662
  }
663
- /* チェック時のラベルテキスト強調 */
664
- [data-testid="radio-group"] input[type="radio"]:checked + span,
665
- [data-testid="radio-group"] input[type="radio"]:checked ~ span {
666
- color: #2a3a2a !important;
667
- font-weight: 600 !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
668
  }
669
 
670
  /* ========================================
@@ -911,7 +934,7 @@ with gr.Blocks() as demo:
911
 
912
  # 録音 & サンプル追加
913
  gr.Markdown("### 録音")
914
- label_dd = gr.Radio(choices=LABELS, label="ラベル選択", interactive=True)
915
  audio_rec = gr.Audio(sources=["microphone"], type="numpy", label="録音")
916
  add_sample_btn = gr.Button("追加", variant="primary", size="lg")
917
  with gr.Row():
@@ -931,7 +954,7 @@ with gr.Blocks() as demo:
931
  )
932
  selected_idx_state = gr.State(None)
933
  replay_audio = gr.Audio(type="numpy", label="選択した音声(再生)", interactive=False)
934
- relabel_dd = gr.Radio(choices=LABELS, label="ラベル修正", interactive=True)
935
  with gr.Row():
936
  relabel_btn = gr.Button("ラベル更新", size="lg")
937
  del_btn = gr.Button("削除", size="lg")
 
611
  /* ========================================
612
  Radioボタン: ダイヤモンド◆スタイル
613
  ======================================== */
614
+ .diamond-radio {
615
  background: rgba(255,255,255,0.5) !important;
616
  border: 1.25px solid #a8c8a8 !important;
617
  border-radius: 0 !important;
618
  padding: 14px 16px !important;
619
  box-shadow: 3px 3px 0px 0px #c0d8c0 !important;
620
  }
621
+ .diamond-radio label,
622
+ .diamond-radio .wrap label,
623
+ .diamond-radio label.svelte-1kcyvh9 {
624
  display: flex !important;
625
  align-items: center !important;
626
  gap: 10px !important;
627
+ padding: 10px 12px !important;
628
  cursor: pointer !important;
629
  transition: all 0.2s ease !important;
630
  border-bottom: 1px solid rgba(138,170,138,0.15) !important;
 
633
  font-weight: 500 !important;
634
  letter-spacing: 0.08em !important;
635
  }
636
+ .diamond-radio label:last-child {
637
  border-bottom: none !important;
638
  }
639
+ .diamond-radio label:hover {
640
  background: rgba(178,216,210,0.15) !important;
641
  }
642
+ /* ラジオ丸ダイヤモンド: あらゆるinput[type=radio]をカバー */
643
+ .diamond-radio input[type="radio"],
644
+ .diamond-radio input[type="radio"]::before,
645
+ .diamond-radio input[type="radio"]::after {
646
  -webkit-appearance: none !important;
647
  appearance: none !important;
648
+ border-radius: 0 !important;
649
+ }
650
+ .diamond-radio input[type="radio"] {
651
  width: 14px !important;
652
  height: 14px !important;
653
  min-width: 14px !important;
654
  border: 1.5px solid #8aaa8a !important;
 
655
  background: #ffffff !important;
656
  transform: rotate(45deg) !important;
657
  cursor: pointer !important;
658
  transition: all 0.25s ease !important;
659
  box-shadow: 1px 1px 3px rgba(0,0,0,0.1) !important;
660
+ margin: 0 4px 0 0 !important;
661
  padding: 0 !important;
662
  flex-shrink: 0 !important;
663
  }
664
+ .diamond-radio input[type="radio"]:checked {
665
  background: #3a5a3a !important;
666
  border-color: #3a5a3a !important;
667
  box-shadow: 2px 2px 4px rgba(0,0,0,0.2) !important;
668
  }
669
+ /* Gradio 6: 丸いsvg/spanインジケーターも上書き */
670
+ .diamond-radio .radio-circle,
671
+ .diamond-radio [class*="radio"] span:first-child,
672
+ .diamond-radio .item > div:first-child,
673
+ .diamond-radio .choice > div:first-child {
674
+ width: 14px !important;
675
+ height: 14px !important;
676
+ min-width: 14px !important;
677
+ border: 1.5px solid #8aaa8a !important;
678
+ border-radius: 0 !important;
679
+ background: #ffffff !important;
680
+ transform: rotate(45deg) !important;
681
+ box-shadow: 1px 1px 3px rgba(0,0,0,0.1) !important;
682
+ transition: all 0.25s ease !important;
683
+ }
684
+ .diamond-radio .selected .radio-circle,
685
+ .diamond-radio .selected [class*="radio"] span:first-child,
686
+ .diamond-radio .selected .item > div:first-child,
687
+ .diamond-radio .selected .choice > div:first-child {
688
+ background: #3a5a3a !important;
689
+ border-color: #3a5a3a !important;
690
+ box-shadow: 2px 2px 4px rgba(0,0,0,0.2) !important;
691
  }
692
 
693
  /* ========================================
 
934
 
935
  # 録音 & サンプル追加
936
  gr.Markdown("### 録音")
937
+ label_dd = gr.Radio(choices=LABELS, label="ラベル選択", interactive=True, elem_classes=["diamond-radio"])
938
  audio_rec = gr.Audio(sources=["microphone"], type="numpy", label="録音")
939
  add_sample_btn = gr.Button("追加", variant="primary", size="lg")
940
  with gr.Row():
 
954
  )
955
  selected_idx_state = gr.State(None)
956
  replay_audio = gr.Audio(type="numpy", label="選択した音声(再生)", interactive=False)
957
+ relabel_dd = gr.Radio(choices=LABELS, label="ラベル修正", interactive=True, elem_classes=["diamond-radio"])
958
  with gr.Row():
959
  relabel_btn = gr.Button("ラベル更新", size="lg")
960
  del_btn = gr.Button("削除", size="lg")