roncc13 commited on
Commit
e1c490b
·
verified ·
1 Parent(s): 5e190d3

Update theme.py

Browse files
Files changed (1) hide show
  1. theme.py +44 -21
theme.py CHANGED
@@ -1,6 +1,5 @@
1
  import gradio as gr
2
 
3
- # Put ALL your custom CSS here
4
  custom_css = """
5
  body {
6
  background: linear-gradient(135deg, #020617 0%, #1e0b45 50%, #020617 100%);
@@ -21,19 +20,45 @@ body {
21
  box-shadow: none !important;
22
  }
23
 
 
24
  .glass-card {
25
  background: rgba(15, 23, 42, 0.96);
26
  border-radius: 24px;
27
  border: 1px solid rgba(148, 163, 184, 0.30);
28
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
29
- padding: 20px 22px !important;
30
  overflow: hidden;
31
  }
32
 
33
- .glass-card > * + * {
34
- margin-top: 12px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
 
 
37
  .hero-title {
38
  font-size: 34px;
39
  font-weight: 700;
@@ -42,7 +67,6 @@ body {
42
  color: #e5e7eb;
43
  margin-bottom: 8px;
44
  }
45
-
46
  .hero-subtitle {
47
  font-size: 14px;
48
  max-width: 640px;
@@ -50,6 +74,7 @@ body {
50
  color: #cbd5f5;
51
  }
52
 
 
53
  .conf-bar-bg {
54
  margin-top: 14px;
55
  width: 100%;
@@ -57,13 +82,13 @@ body {
57
  border-radius: 999px;
58
  background: rgba(148, 163, 184, 0.35);
59
  }
60
-
61
  .conf-bar-fill {
62
  height: 100%;
63
  border-radius: inherit;
64
  background: linear-gradient(90deg, #f97316, #fb923c);
65
  }
66
 
 
67
  .badge-pill {
68
  display: inline-flex;
69
  align-items: center;
@@ -72,17 +97,10 @@ body {
72
  font-size: 11px;
73
  font-weight: 600;
74
  }
 
 
75
 
76
- .badge-fake {
77
- background: #f97316;
78
- color: #111827;
79
- }
80
-
81
- .badge-real {
82
- background: #22c55e;
83
- color: #022c22;
84
- }
85
-
86
  .gradio-container textarea {
87
  background: #020617 !important;
88
  border-radius: 18px !important;
@@ -93,16 +111,17 @@ body {
93
  line-height: 1.5 !important;
94
  box-sizing: border-box !important;
95
  }
96
-
97
  .gradio-container textarea::placeholder {
98
  color: #94a3b8 !important;
99
  opacity: 1 !important;
100
  }
101
 
 
102
  .gradio-container label {
103
  margin-bottom: 6px !important;
104
  }
105
 
 
106
  @media (max-width: 900px) {
107
  .two-col {
108
  flex-direction: column !important;
@@ -110,6 +129,7 @@ body {
110
  }
111
  """
112
 
 
113
  def header():
114
  return gr.HTML(
115
  """
@@ -125,7 +145,7 @@ def header():
125
  <div>
126
  <div style="font-weight:600;font-size:14px;letter-spacing:0.08em;
127
  text-transform:uppercase;color:#e5e7eb;">
128
- CMDBERT
129
  </div>
130
  <div style="font-size:11px;color:#9ca3af;">
131
  Cebuano Misinformation Detector
@@ -133,7 +153,7 @@ def header():
133
  </div>
134
  </div>
135
  <div style="display:flex;align-items:center;gap:8px;font-size:13px;color:#e5e7eb;opacity:0.9;">
136
- <span>About CMDBERT</span>
137
  <div style="width:24px;height:24px;border-radius:999px;
138
  background:rgba(148,163,184,0.35);"></div>
139
  </div>
@@ -142,7 +162,10 @@ def header():
142
  """
143
  )
144
 
 
145
  def card_start():
146
- return gr.HTML("")
 
 
147
  def card_end():
148
- return gr.HTML("")
 
1
  import gradio as gr
2
 
 
3
  custom_css = """
4
  body {
5
  background: linear-gradient(135deg, #020617 0%, #1e0b45 50%, #020617 100%);
 
20
  box-shadow: none !important;
21
  }
22
 
23
+ /* ── Card shell: no padding here, handled by .card-inner ── */
24
  .glass-card {
25
  background: rgba(15, 23, 42, 0.96);
26
  border-radius: 24px;
27
  border: 1px solid rgba(148, 163, 184, 0.30);
28
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
29
+ padding: 0 !important;
30
  overflow: hidden;
31
  }
32
 
33
+ /* ── Inner wrapper that actually controls the card breathing room ── */
34
+ .card-inner {
35
+ padding: 20px 22px !important;
36
+ box-sizing: border-box;
37
+ }
38
+
39
+ /* Remove excess margin from first/last child inside card-inner */
40
+ .card-inner > *:first-child { margin-top: 0 !important; }
41
+ .card-inner > *:last-child { margin-bottom: 0 !important; }
42
+
43
+ /* ── Gradio component wrappers inside any glass-card ── */
44
+ .glass-card .gradio-markdown,
45
+ .glass-card .gradio-html,
46
+ .glass-card .gradio-textbox,
47
+ .glass-card .gradio-button,
48
+ .glass-card .gradio-dropdown,
49
+ .glass-card .gradio-checkbox,
50
+ .glass-card .gradio-row,
51
+ .glass-card .gradio-column {
52
+ box-sizing: border-box;
53
+ }
54
+
55
+ /* ── Prose / markdown text inside cards ── */
56
+ .glass-card .prose,
57
+ .glass-card .markdown-body {
58
+ color: #f9fafb !important;
59
  }
60
 
61
+ /* ── Hero section ── */
62
  .hero-title {
63
  font-size: 34px;
64
  font-weight: 700;
 
67
  color: #e5e7eb;
68
  margin-bottom: 8px;
69
  }
 
70
  .hero-subtitle {
71
  font-size: 14px;
72
  max-width: 640px;
 
74
  color: #cbd5f5;
75
  }
76
 
77
+ /* ── Confidence bar ── */
78
  .conf-bar-bg {
79
  margin-top: 14px;
80
  width: 100%;
 
82
  border-radius: 999px;
83
  background: rgba(148, 163, 184, 0.35);
84
  }
 
85
  .conf-bar-fill {
86
  height: 100%;
87
  border-radius: inherit;
88
  background: linear-gradient(90deg, #f97316, #fb923c);
89
  }
90
 
91
+ /* ── Label badges ── */
92
  .badge-pill {
93
  display: inline-flex;
94
  align-items: center;
 
97
  font-size: 11px;
98
  font-weight: 600;
99
  }
100
+ .badge-fake { background: #f97316; color: #111827; }
101
+ .badge-real { background: #22c55e; color: #022c22; }
102
 
103
+ /* ── Textarea (the input box) ── */
 
 
 
 
 
 
 
 
 
104
  .gradio-container textarea {
105
  background: #020617 !important;
106
  border-radius: 18px !important;
 
111
  line-height: 1.5 !important;
112
  box-sizing: border-box !important;
113
  }
 
114
  .gradio-container textarea::placeholder {
115
  color: #94a3b8 !important;
116
  opacity: 1 !important;
117
  }
118
 
119
+ /* ── Labels ── */
120
  .gradio-container label {
121
  margin-bottom: 6px !important;
122
  }
123
 
124
+ /* ── Responsive ── */
125
  @media (max-width: 900px) {
126
  .two-col {
127
  flex-direction: column !important;
 
129
  }
130
  """
131
 
132
+
133
  def header():
134
  return gr.HTML(
135
  """
 
145
  <div>
146
  <div style="font-weight:600;font-size:14px;letter-spacing:0.08em;
147
  text-transform:uppercase;color:#e5e7eb;">
148
+ CMD&#8209;BERT
149
  </div>
150
  <div style="font-size:11px;color:#9ca3af;">
151
  Cebuano Misinformation Detector
 
153
  </div>
154
  </div>
155
  <div style="display:flex;align-items:center;gap:8px;font-size:13px;color:#e5e7eb;opacity:0.9;">
156
+ <span>About CMD&#8209;BERT</span>
157
  <div style="width:24px;height:24px;border-radius:999px;
158
  background:rgba(148,163,184,0.35);"></div>
159
  </div>
 
162
  """
163
  )
164
 
165
+
166
  def card_start():
167
+ return gr.HTML("<div class='card-inner'>")
168
+
169
+
170
  def card_end():
171
+ return gr.HTML("</div>")