sanyan-evo commited on
Commit
d3cfd7a
·
verified ·
1 Parent(s): 7368f50

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +45 -52
app.py CHANGED
@@ -452,23 +452,25 @@ def get_ritual():
452
 
453
  # ===== CSS: Gradio 6.x Compatible =====
454
  CUSTOM_CSS = """
455
- /* Root background */
456
- body, .gradio-container, gradio-app {
 
 
457
  background: #0a0015 !important;
 
 
458
  }
459
 
460
  .gradio-container {
461
  max-width: 900px !important;
462
  margin: 0 auto !important;
463
- padding: 0 20px !important;
464
  min-height: 100vh !important;
465
- font-family: 'Georgia', 'Times New Roman', serif !important;
466
  }
467
 
468
- /* Hide footer */
469
  footer { display: none !important; }
470
 
471
- /* === TYPOGRAPHY === */
472
  h1 {
473
  font-family: 'Georgia', serif !important;
474
  font-weight: 700 !important;
@@ -477,6 +479,7 @@ h1 {
477
  color: #feca57 !important;
478
  margin: 0 0 8px 0 !important;
479
  letter-spacing: 0.03em !important;
 
480
  }
481
 
482
  h2 {
@@ -491,10 +494,10 @@ h2 {
491
  }
492
 
493
  h3 { color: #c4b5fd !important; }
494
- p { color: #a5a0b8 !important; line-height: 1.7 !important; }
495
 
496
- /* Labels */
497
- label, .label-text, .svelte-1gfkn6j {
 
498
  color: #c4b5fd !important;
499
  font-size: 0.8em !important;
500
  font-weight: 500 !important;
@@ -502,8 +505,8 @@ label, .label-text, .svelte-1gfkn6j {
502
  letter-spacing: 0.06em !important;
503
  }
504
 
505
- /* === BUTTONS === */
506
- button, .gr-button {
507
  border-radius: 24px !important;
508
  font-weight: 600 !important;
509
  letter-spacing: 0.03em !important;
@@ -514,28 +517,25 @@ button, .gr-button {
514
  border: none !important;
515
  }
516
 
517
- /* Primary buttons: purple gradient */
518
- .gr-button-primary, button.primary, button[variant="primary"] {
519
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
520
  color: #f8f7ff !important;
521
  box-shadow: 0 4px 20px rgba(124,58,237,0.35) !important;
522
  border: 1px solid rgba(255,255,255,0.15) !important;
523
  }
524
 
525
- .gr-button-primary:hover, button.primary:hover {
526
  filter: brightness(1.15) !important;
527
  box-shadow: 0 6px 28px rgba(168,85,247,0.55) !important;
528
  transform: translateY(-2px) !important;
529
  }
530
 
531
- /* Stop button */
532
- .gr-button-stop, button.stop, button[variant="stop"] {
533
  background: linear-gradient(135deg, #dc2626, #991b1b) !important;
534
  color: #f8f7ff !important;
535
- border: 1px solid rgba(255,255,255,0.1) !important;
536
  }
537
 
538
- /* === INPUTS === */
539
  textarea, input[type="text"], input[type="number"] {
540
  background: rgba(15, 8, 30, 0.7) !important;
541
  border: 1px solid rgba(180, 150, 220, 0.25) !important;
@@ -551,51 +551,39 @@ textarea:focus, input:focus {
551
  outline: none !important;
552
  }
553
 
554
- /* === SLIDERS === */
555
  input[type="range"] { accent-color: #a855f7 !important; }
556
 
557
- /* === RADIO === */
558
- fieldset label, .radio-group label {
559
  padding: 10px 20px !important;
560
  border-radius: 10px !important;
561
  border: 1px solid rgba(180,150,220,0.2) !important;
562
  margin: 4px !important;
563
  background: rgba(20,12,40,0.5) !important;
564
  color: #c4b5fd !important;
 
565
  transition: all 0.2s !important;
566
  }
567
 
568
- fieldset label.selected, .radio-group input:checked + label,
569
- input[type="radio"]:checked + label {
570
- border-color: #feca57 !important;
571
- background: rgba(254,202,87,0.1) !important;
572
- color: #feca57 !important;
573
- box-shadow: 0 0 16px rgba(254,202,87,0.12) !important;
574
- }
575
-
576
- /* === PANELS / CARDS === */
577
- .gradio-container > .contain > div > div,
578
- .prose + div, .gr-group, fieldset, .panel {
579
- background: rgba(20, 12, 40, 0.6) !important;
580
  backdrop-filter: blur(12px) !important;
581
  -webkit-backdrop-filter: blur(12px) !important;
582
  border: 1px solid rgba(180, 150, 220, 0.15) !important;
583
  border-radius: 16px !important;
584
- padding: 20px !important;
585
- margin-bottom: 16px !important;
586
  box-shadow: 0 8px 32px rgba(0,0,0,0.25) !important;
587
  }
588
 
589
- /* === JSON === */
590
- .gr-json, .json-display {
591
- border-radius: 12px !important;
592
- background: rgba(10, 4, 20, 0.7) !important;
593
- color: #a5a0b8 !important;
594
- border: 1px solid rgba(180,150,220,0.15) !important;
595
- font-family: monospace !important;
596
- }
597
 
598
- /* === STATUS BOX === */
 
 
 
599
  #status-box textarea, #status-box input {
600
  background: rgba(254,202,87,0.06) !important;
601
  border-color: rgba(254,202,87,0.25) !important;
@@ -603,7 +591,7 @@ input[type="radio"]:checked + label {
603
  font-style: italic !important;
604
  }
605
 
606
- /* === RITUAL BUTTON (heart glow) === */
607
  #ritual-btn {
608
  background: linear-gradient(135deg, #e94560, #ff6b9d) !important;
609
  font-size: 1.1em !important;
@@ -617,19 +605,24 @@ input[type="radio"]:checked + label {
617
  50% { box-shadow: 0 8px 44px rgba(233,69,96,0.75); }
618
  }
619
 
620
- /* === IMAGE containers === */
621
- img { border-radius: 12px !important; }
622
-
623
- /* === MARKDOWN === */
624
- .prose, .md, .markdown { color: #a5a0b8 !important; }
625
  .prose em, .md em { color: #c4b5fd !important; }
626
  .prose strong, .md strong { color: #f8f7ff !important; }
627
 
628
- /* === RESPONSIVE === */
 
 
 
 
 
 
 
 
629
  @media (max-width: 768px) {
630
  h1 { font-size: 2em !important; }
631
  h2 { font-size: 1.3em !important; }
632
- .gradio-container { padding: 0 12px !important; }
633
  }
634
  """
635
 
 
452
 
453
  # ===== CSS: Gradio 6.x Compatible =====
454
  CUSTOM_CSS = """
455
+ /* ===== Thousand Token Wood — Gradio 6.x Compatible ===== */
456
+
457
+ /* --- Root dark theme --- */
458
+ html, body, .app, .main, .gradio-container {
459
  background: #0a0015 !important;
460
+ color: #a5a0b8 !important;
461
+ font-family: 'Georgia', 'Times New Roman', serif !important;
462
  }
463
 
464
  .gradio-container {
465
  max-width: 900px !important;
466
  margin: 0 auto !important;
467
+ padding: 0 16px !important;
468
  min-height: 100vh !important;
 
469
  }
470
 
 
471
  footer { display: none !important; }
472
 
473
+ /* --- Typography --- */
474
  h1 {
475
  font-family: 'Georgia', serif !important;
476
  font-weight: 700 !important;
 
479
  color: #feca57 !important;
480
  margin: 0 0 8px 0 !important;
481
  letter-spacing: 0.03em !important;
482
+ line-height: 1.2 !important;
483
  }
484
 
485
  h2 {
 
494
  }
495
 
496
  h3 { color: #c4b5fd !important; }
 
497
 
498
+ p, span, div { color: inherit; }
499
+
500
+ label, .label-text {
501
  color: #c4b5fd !important;
502
  font-size: 0.8em !important;
503
  font-weight: 500 !important;
 
505
  letter-spacing: 0.06em !important;
506
  }
507
 
508
+ /* --- Buttons (Gradio 6.x: button.lg.primary) --- */
509
+ button {
510
  border-radius: 24px !important;
511
  font-weight: 600 !important;
512
  letter-spacing: 0.03em !important;
 
517
  border: none !important;
518
  }
519
 
520
+ button.primary, button.lg, button.svelte-xzq5jh {
 
521
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
522
  color: #f8f7ff !important;
523
  box-shadow: 0 4px 20px rgba(124,58,237,0.35) !important;
524
  border: 1px solid rgba(255,255,255,0.15) !important;
525
  }
526
 
527
+ button.primary:hover {
528
  filter: brightness(1.15) !important;
529
  box-shadow: 0 6px 28px rgba(168,85,247,0.55) !important;
530
  transform: translateY(-2px) !important;
531
  }
532
 
533
+ button.stop {
 
534
  background: linear-gradient(135deg, #dc2626, #991b1b) !important;
535
  color: #f8f7ff !important;
 
536
  }
537
 
538
+ /* --- Inputs --- */
539
  textarea, input[type="text"], input[type="number"] {
540
  background: rgba(15, 8, 30, 0.7) !important;
541
  border: 1px solid rgba(180, 150, 220, 0.25) !important;
 
551
  outline: none !important;
552
  }
553
 
 
554
  input[type="range"] { accent-color: #a855f7 !important; }
555
 
556
+ /* --- Radio --- */
557
+ fieldset label, .radio-group label, label.svelte-1hf8a14 {
558
  padding: 10px 20px !important;
559
  border-radius: 10px !important;
560
  border: 1px solid rgba(180,150,220,0.2) !important;
561
  margin: 4px !important;
562
  background: rgba(20,12,40,0.5) !important;
563
  color: #c4b5fd !important;
564
+ cursor: pointer !important;
565
  transition: all 0.2s !important;
566
  }
567
 
568
+ /* --- Card blocks --- */
569
+ .block, .top-panel, .unpadded_box {
570
+ background: rgba(20, 12, 40, 0.55) !important;
 
 
 
 
 
 
 
 
 
571
  backdrop-filter: blur(12px) !important;
572
  -webkit-backdrop-filter: blur(12px) !important;
573
  border: 1px solid rgba(180, 150, 220, 0.15) !important;
574
  border-radius: 16px !important;
575
+ padding: 16px 20px !important;
576
+ margin-bottom: 12px !important;
577
  box-shadow: 0 8px 32px rgba(0,0,0,0.25) !important;
578
  }
579
 
580
+ /* --- Images in cards --- */
581
+ img { border-radius: 10px !important; }
 
 
 
 
 
 
582
 
583
+ /* --- Centered empty state --- */
584
+ .unpadded_box:empty { display: none !important; }
585
+
586
+ /* --- Status box --- */
587
  #status-box textarea, #status-box input {
588
  background: rgba(254,202,87,0.06) !important;
589
  border-color: rgba(254,202,87,0.25) !important;
 
591
  font-style: italic !important;
592
  }
593
 
594
+ /* --- Ritual button (heart pulse) --- */
595
  #ritual-btn {
596
  background: linear-gradient(135deg, #e94560, #ff6b9d) !important;
597
  font-size: 1.1em !important;
 
605
  50% { box-shadow: 0 8px 44px rgba(233,69,96,0.75); }
606
  }
607
 
608
+ /* --- Markdown content --- */
609
+ .prose p, .md p, .markdown p { color: #a5a0b8 !important; line-height: 1.7 !important; }
 
 
 
610
  .prose em, .md em { color: #c4b5fd !important; }
611
  .prose strong, .md strong { color: #f8f7ff !important; }
612
 
613
+ /* --- JSON display --- */
614
+ .json-display, pre {
615
+ background: rgba(10, 4, 20, 0.7) !important;
616
+ border-radius: 12px !important;
617
+ padding: 12px !important;
618
+ color: #a5a0b8 !important;
619
+ }
620
+
621
+ /* --- Responsive --- */
622
  @media (max-width: 768px) {
623
  h1 { font-size: 2em !important; }
624
  h2 { font-size: 1.3em !important; }
625
+ .gradio-container { padding: 0 10px !important; }
626
  }
627
  """
628