SagarVelamuri commited on
Commit
725dcc4
·
verified ·
1 Parent(s): 1e32b99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -22
app.py CHANGED
@@ -140,40 +140,51 @@ THEME = gr.themes.Soft(
140
  button_primary_text_color="#ffffff",
141
  )
142
 
143
- # -------------------- LAYOUT CSS (20/40/40 exact split) --------------------
144
  CUSTOM_CSS = """
145
- /* Full-bleed app */
146
- html, body { height: 100%; background:#0b1220; }
147
- .gradio-container { height: 100vh !important; width: 100vw !important; max-width: 100vw !important; margin: 0; padding: 0 8px 8px 8px; }
 
148
 
149
  /* Header */
150
- #hdr { height: 64px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
151
- background:#162434; border:1px solid #223144; border-radius:12px; margin:8px 0; }
152
  #title { color:#ffffff; font-weight:900; font-size:20px; margin:0; letter-spacing:.2px; }
153
- #subtitle { color:#9fb4d1; font-size:12.5px; margin:0; }
154
 
155
- /* Main grid: 20% / 40% / 40% widths; fills the rest of the viewport height */
156
  #main {
157
- height: calc(100vh - 64px - 16px); /* header + top/bottom margins */
158
  display: grid;
159
  grid-template-columns: 20% 40% 40%;
160
  gap: 10px;
161
  }
162
 
163
  /* Panels */
164
- .panel { border:1px solid #223144; border-radius:12px; background:#0f172a; display:flex; flex-direction:column; min-height:0; }
 
165
  .panel-h {
166
  display:flex; align-items:center; justify-content:space-between;
167
- padding:10px 12px; background:#0b1b2b; border-bottom:1px solid #243244;
168
- color:#eaf2ff; font-weight:900; letter-spacing:.2px;
169
- border-top-left-radius:12px; border-top-right-radius:12px;
170
  }
171
- .panel-b { flex:1 1 auto; min-height:0; padding:10px 12px; }
172
 
173
- /* Left column (Advanced) = 100% of main height; scroll inside if overflow */
174
  #left { height: 100%; }
175
  #adv-inner { height: 100%; overflow: auto; padding-right: 6px; }
176
- label { color:#ffffff !important; font-weight:800 !important; }
 
 
 
 
 
 
 
 
 
 
177
 
178
  /* Middle column splits 75% (input) / 25% (buttons) */
179
  #middle { display:grid; grid-template-rows: 75% 25%; height:100%; gap:10px; }
@@ -181,25 +192,26 @@ label { color:#ffffff !important; font-weight:800 !important; }
181
  /* Right column splits 50% / 50% */
182
  #right { display:grid; grid-template-rows: 1fr 1fr; height:100%; gap:10px; }
183
 
184
- /* Textareas fill their panel without overflow */
185
  .textwrap { height:100%; min-height:0; display:flex; }
186
  .textwrap > div { flex:1 1 auto; min-height:0; }
187
  .textwrap textarea { height:100% !important; }
188
 
 
189
  textarea, textarea:focus {
190
  background:#0b1220 !important; color:#f9fbff !important;
191
  font-size: 17px !important; line-height:1.55 !important;
192
  padding: 10px 12px !important; border:1.6px solid #3b516c !important; border-radius: 10px !important;
193
  }
194
- textarea::placeholder { color:#9fb4d1 !important; }
195
  textarea:hover { border-color:#6b8db6 !important; }
196
  textarea:focus { border-color:#60a5fa !important; outline:none !important; }
197
 
198
  /* Buttons row */
199
- #btnrow { display:flex; align-items:center; justify-content:center; gap:14px; height:100%; }
200
- #btnrow > button { min-width: 160px; height: 46px; font-weight:800; border-radius:10px; }
201
 
202
- /* Maximize button (Hindi/Telugu headers) */
203
  .max { font-weight:900; padding:4px 10px; border-radius:10px; border:1px solid #3c5a86;
204
  background:#122037; color:#ffffff; }
205
  .max:hover { border-color:#60a5fa; }
@@ -207,7 +219,8 @@ textarea:focus { border-color:#60a5fa !important; outline:none !important; }
207
  /* Modal */
208
  #modal { position: fixed; inset: 0; z-index: 9999; background: rgba(2,6,23,.88); display: none; align-items: center; justify-content: center; padding: 12px; }
209
  #modal[style*="display: block"] { display: flex !important; }
210
- .modal-card { width:min(1280px,96vw); height:min(92vh,900px); background:#0f172a; border:1px solid #335070; border-radius:14px; box-shadow:0 18px 40px rgba(2,6,23,.6); display:flex; flex-direction:column; gap:8px; padding:10px; }
 
211
  .modal-title { color:#ffffff; font-weight:800; font-size:18px; letter-spacing:.2px; margin:0; }
212
  #fs_box textarea { height: calc(100% - 52px) !important; }
213
  .modal-actions { display:flex; gap:8px; justify-content:flex-end; }
 
140
  button_primary_text_color="#ffffff",
141
  )
142
 
143
+ # -------------------- LAYOUT CSS (20/40/40 exact; crisp headers) ------
144
  CUSTOM_CSS = """
145
+ /* Full-bleed app with no side gutters */
146
+ * { box-sizing: border-box; }
147
+ html, body { height: 100%; background:#0b1220; margin:0; padding:0; }
148
+ .gradio-container { height: 100vh !important; width: 100vw !important; max-width: 100vw !important; margin: 0; padding: 8px; }
149
 
150
  /* Header */
151
+ #hdr { height: 60px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
152
+ background:#162434; border:1px solid #223144; border-radius:12px; margin-bottom:8px; }
153
  #title { color:#ffffff; font-weight:900; font-size:20px; margin:0; letter-spacing:.2px; }
154
+ #subtitle { color:#b8cae1; font-size:12.5px; margin:0; }
155
 
156
+ /* Main grid: 20% / 40% / 40% widths; fills remaining viewport height */
157
  #main {
158
+ height: calc(100vh - 60px - 16px); /* header + outer padding */
159
  display: grid;
160
  grid-template-columns: 20% 40% 40%;
161
  gap: 10px;
162
  }
163
 
164
  /* Panels */
165
+ .panel { position:relative; border:1px solid #223144; border-radius:12px; background:#0f172a;
166
+ display:flex; flex-direction:column; min-height:0; overflow: hidden; }
167
  .panel-h {
168
  display:flex; align-items:center; justify-content:space-between;
169
+ padding:10px 12px; background:#081422; border-bottom:1px solid #243244;
170
+ color:#ffffff; font-weight:900; letter-spacing:.25px; font-size:15px;
 
171
  }
172
+ .panel-b { flex:1 1 auto; min-height:0; padding:10px 12px; position:relative; z-index:1; }
173
 
174
+ /* Left column (Advanced) scroll inside if needed */
175
  #left { height: 100%; }
176
  #adv-inner { height: 100%; overflow: auto; padding-right: 6px; }
177
+
178
+ /* Kill chip-like label backgrounds (make text crisp) */
179
+ .gradio-container .panel .label,
180
+ .gradio-container .panel .label > span,
181
+ .gradio-container label {
182
+ background: transparent !important;
183
+ box-shadow: none !important;
184
+ border: none !important;
185
+ color: #ffffff !important;
186
+ font-weight: 800 !important;
187
+ }
188
 
189
  /* Middle column splits 75% (input) / 25% (buttons) */
190
  #middle { display:grid; grid-template-rows: 75% 25%; height:100%; gap:10px; }
 
192
  /* Right column splits 50% / 50% */
193
  #right { display:grid; grid-template-rows: 1fr 1fr; height:100%; gap:10px; }
194
 
195
+ /* Textareas fill their panel; no spillover */
196
  .textwrap { height:100%; min-height:0; display:flex; }
197
  .textwrap > div { flex:1 1 auto; min-height:0; }
198
  .textwrap textarea { height:100% !important; }
199
 
200
+ /* Inputs (high contrast) */
201
  textarea, textarea:focus {
202
  background:#0b1220 !important; color:#f9fbff !important;
203
  font-size: 17px !important; line-height:1.55 !important;
204
  padding: 10px 12px !important; border:1.6px solid #3b516c !important; border-radius: 10px !important;
205
  }
206
+ textarea::placeholder { color:#a6bdd9 !important; }
207
  textarea:hover { border-color:#6b8db6 !important; }
208
  textarea:focus { border-color:#60a5fa !important; outline:none !important; }
209
 
210
  /* Buttons row */
211
+ #btnrow { display:flex; align-items:center; justify-content:center; gap:16px; height:100%; }
212
+ #btnrow > button { min-width: 180px; height: 46px; font-weight:800; border-radius:10px; }
213
 
214
+ /* Maximize buttons (Hindi/Telugu) */
215
  .max { font-weight:900; padding:4px 10px; border-radius:10px; border:1px solid #3c5a86;
216
  background:#122037; color:#ffffff; }
217
  .max:hover { border-color:#60a5fa; }
 
219
  /* Modal */
220
  #modal { position: fixed; inset: 0; z-index: 9999; background: rgba(2,6,23,.88); display: none; align-items: center; justify-content: center; padding: 12px; }
221
  #modal[style*="display: block"] { display: flex !important; }
222
+ .modal-card { width:min(1280px,96vw); height:min(92vh,900px); background:#0f172a; border:1px solid #335070; border-radius:14px;
223
+ box-shadow:0 18px 40px rgba(2,6,23,.6); display:flex; flex-direction:column; gap:8px; padding:10px; }
224
  .modal-title { color:#ffffff; font-weight:800; font-size:18px; letter-spacing:.2px; margin:0; }
225
  #fs_box textarea { height: calc(100% - 52px) !important; }
226
  .modal-actions { display:flex; gap:8px; justify-content:flex-end; }