Qi Cai commited on
Commit
6345a2e
·
1 Parent(s): e9da9b4
Files changed (1) hide show
  1. app.py +100 -25
app.py CHANGED
@@ -546,60 +546,131 @@ textarea:focus, input:focus,
546
  margin-top: 2px;
547
  }
548
 
549
- /* Refine toggle — render the gradio checkbox as an Apple-style pill switch */
 
 
 
550
  .refine-toggle {
551
- background: #f5f5f7 !important;
552
- border-radius: 12px !important;
553
- border: 1px solid rgba(0,0,0,0.05) !important;
554
- padding: 10px 14px !important;
 
 
 
 
 
 
 
 
 
 
555
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
556
  .refine-toggle label {
557
  display: flex !important;
558
  align-items: center !important;
559
- gap: 10px !important;
560
- cursor: pointer;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
  }
 
 
562
  .refine-toggle input[type="checkbox"] {
563
  appearance: none;
564
  -webkit-appearance: none;
565
- width: 38px;
566
- height: 22px;
567
  border-radius: 999px !important;
568
- background: #d2d2d7 !important;
569
  position: relative;
570
  cursor: pointer;
571
- transition: background 0.18s ease;
572
  border: none !important;
573
- flex-shrink: 0;
574
  margin: 0 !important;
 
575
  }
576
  .refine-toggle input[type="checkbox"]::after {
577
  content: "";
578
  position: absolute;
579
  top: 2px;
580
  left: 2px;
581
- width: 18px;
582
- height: 18px;
583
  border-radius: 50%;
584
  background: #ffffff;
585
- box-shadow: 0 1px 3px rgba(0,0,0,0.15), 0 1px 1px rgba(0,0,0,0.06);
586
- transition: transform 0.18s ease;
 
 
 
587
  }
588
  .refine-toggle input[type="checkbox"]:checked {
589
- background: #30d158 !important;
 
 
 
590
  }
591
  .refine-toggle input[type="checkbox"]:checked::after {
592
- transform: translateX(16px);
593
  }
594
  .refine-toggle input[type="checkbox"]:focus-visible {
595
- box-shadow: 0 0 0 4px rgba(0,113,227,0.15) !important;
596
  }
597
- .refine-toggle .wrap > label > span,
598
- .refine-toggle label > span {
599
- color: #1d1d1f !important;
600
- font-size: 14px !important;
601
- font-weight: 500 !important;
602
- letter-spacing: 0.01em;
603
  }
604
 
605
  /* Seed number input — match the prompt/dropdown rounding */
@@ -617,6 +688,10 @@ textarea:focus, input:focus,
617
  .seed-input input[type="number"] {
618
  -moz-appearance: textfield;
619
  }
 
 
 
 
620
 
621
  /* Footer tagline */
622
  .tagline {
 
546
  margin-top: 2px;
547
  }
548
 
549
+ /* Refine toggle — iOS-style settings card.
550
+ Goal: title + helper text on the left, a polished pill switch on the right,
551
+ everything contained inside a single soft card so the helper text no longer
552
+ floats orphaned above the box. */
553
  .refine-toggle {
554
+ background: linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%) !important;
555
+ border-radius: 14px !important;
556
+ border: 1px solid rgba(0,0,0,0.06) !important;
557
+ padding: 14px 16px !important;
558
+ box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
559
+ transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
560
+ min-height: 88px;
561
+ display: flex !important;
562
+ flex-direction: column !important;
563
+ justify-content: center !important;
564
+ }
565
+ .refine-toggle:hover {
566
+ border-color: rgba(0,0,0,0.10) !important;
567
+ box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 14px rgba(0,0,0,0.05) !important;
568
  }
569
+
570
+ /* Strip default backgrounds from gradio's inner wrappers so only our card shows. */
571
+ .refine-toggle .form,
572
+ .refine-toggle .wrap,
573
+ .refine-toggle .form-wrap,
574
+ .refine-toggle > div {
575
+ background: transparent !important;
576
+ border: none !important;
577
+ padding: 0 !important;
578
+ margin: 0 !important;
579
+ box-shadow: none !important;
580
+ }
581
+
582
+ /* Helper / "info" text becomes a proper subtitle UNDER the toggle row. */
583
+ .refine-toggle [data-testid="block-info"],
584
+ .refine-toggle .info {
585
+ color: #6e6e73 !important;
586
+ font-size: 12px !important;
587
+ line-height: 1.4 !important;
588
+ margin: 8px 0 0 0 !important;
589
+ padding: 0 !important;
590
+ text-align: left !important;
591
+ order: 2 !important;
592
+ }
593
+
594
+ /* Force the gradio wrapper to stack: label-row first, info below. */
595
+ .refine-toggle .form,
596
+ .refine-toggle > div:not([data-testid="block-info"]):not(.info) {
597
+ display: flex !important;
598
+ flex-direction: column !important;
599
+ align-items: stretch !important;
600
+ }
601
+
602
+ /* Label row: title on the LEFT (full width), toggle pinned to the RIGHT. */
603
  .refine-toggle label {
604
  display: flex !important;
605
  align-items: center !important;
606
+ justify-content: space-between !important;
607
+ flex-direction: row-reverse !important;
608
+ cursor: pointer !important;
609
+ margin: 0 !important;
610
+ padding: 0 !important;
611
+ gap: 14px !important;
612
+ width: 100% !important;
613
+ order: 1 !important;
614
+ }
615
+ .refine-toggle label > span {
616
+ color: #1d1d1f !important;
617
+ font-size: 15px !important;
618
+ font-weight: 600 !important;
619
+ letter-spacing: -0.01em;
620
+ flex: 1 1 auto !important;
621
+ text-align: left !important;
622
+ line-height: 1.3 !important;
623
  }
624
+
625
+ /* Pill switch — bigger, smoother, more "Apple-like" */
626
  .refine-toggle input[type="checkbox"] {
627
  appearance: none;
628
  -webkit-appearance: none;
629
+ width: 46px !important;
630
+ height: 28px !important;
631
  border-radius: 999px !important;
632
+ background: #e5e5ea !important;
633
  position: relative;
634
  cursor: pointer;
635
+ transition: background 0.22s ease, box-shadow 0.22s ease;
636
  border: none !important;
637
+ flex-shrink: 0 !important;
638
  margin: 0 !important;
639
+ box-shadow: inset 0 0 1px rgba(0,0,0,0.06);
640
  }
641
  .refine-toggle input[type="checkbox"]::after {
642
  content: "";
643
  position: absolute;
644
  top: 2px;
645
  left: 2px;
646
+ width: 24px;
647
+ height: 24px;
648
  border-radius: 50%;
649
  background: #ffffff;
650
+ box-shadow: 0 2px 5px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.05);
651
+ transition: transform 0.24s cubic-bezier(0.4, 0.0, 0.2, 1);
652
+ }
653
+ .refine-toggle input[type="checkbox"]:hover {
654
+ background: #dcdce0 !important;
655
  }
656
  .refine-toggle input[type="checkbox"]:checked {
657
+ background: #34c759 !important;
658
+ }
659
+ .refine-toggle input[type="checkbox"]:checked:hover {
660
+ background: #30b352 !important;
661
  }
662
  .refine-toggle input[type="checkbox"]:checked::after {
663
+ transform: translateX(18px);
664
  }
665
  .refine-toggle input[type="checkbox"]:focus-visible {
666
+ box-shadow: 0 0 0 4px rgba(0,113,227,0.20) !important;
667
  }
668
+ .refine-toggle input[type="checkbox"]:active::after {
669
+ /* tiny squish on press, very iOS */
670
+ width: 28px;
671
+ }
672
+ .refine-toggle input[type="checkbox"]:checked:active::after {
673
+ transform: translateX(14px);
674
  }
675
 
676
  /* Seed number input — match the prompt/dropdown rounding */
 
688
  .seed-input input[type="number"] {
689
  -moz-appearance: textfield;
690
  }
691
+ /* Keep the seed column visually aligned with the refine card next to it */
692
+ .seed-input {
693
+ align-self: stretch !important;
694
+ }
695
 
696
  /* Footer tagline */
697
  .tagline {