K1SysAdmin commited on
Commit
d905c00
·
verified ·
1 Parent(s): f7727d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +96 -27
app.py CHANGED
@@ -37,7 +37,7 @@ def call_kgx3(title, email, pdf_file, agreement):
37
  return "⚠️ You must accept the disclaimer before running KGX3.", ""
38
  if not pdf_file:
39
  return "Please select a PDF file.", ""
40
- if not email or not re.match(r"[^@]+@[^@]+\\.[^@]+", email):
41
  return "A valid email address is required to run KGX3.", ""
42
 
43
  pdf_path = pdf_file.name
@@ -67,40 +67,109 @@ def call_kgx3(title, email, pdf_file, agreement):
67
 
68
  # === STYLE (high-contrast Matrix aesthetic) ===
69
  FUTURE_CSS = """
70
- html, body, .gradio-container {
71
- background:#000 !important;
72
- color:#00ff99 !important;
73
- font-family:'Courier New',monospace !important;
 
 
74
  }
75
- * { box-sizing:border-box; color:#00ff99 !important; }
76
- h1,h2,h3,label,.label {
77
- font-weight:700 !important; text-transform:uppercase;
78
- border-bottom:1px solid #00ff99; padding-bottom:4px; margin-bottom:8px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  }
80
- .gr-box,.gr-panel,.gr-column,.gr-row {
81
- background:#000 !important; border:1px solid #00ff99 !important;
82
- border-radius:6px; padding:10px;
 
 
 
 
 
 
 
 
 
83
  }
84
- input,textarea,.upload-box,.file-preview,.wrap-inner {
85
- background:#000 !important; border:1px solid #00ff99 !important;
86
- color:#00ff99 !important; border-radius:4px; padding:6px 8px !important;
87
  }
 
 
88
  button {
89
- background:#000 !important; color:#00ff99 !important;
90
- border:2px solid #00ff99 !important; border-radius:4px;
91
- text-transform:uppercase; font-weight:700; padding:8px 16px !important;
 
 
 
 
 
 
92
  }
93
- button:hover { background:#00ff99 !important; color:#000 !important; }
94
- pre,code,.cm-editor,.cm-content,.cm-line {
95
- background:#000 !important; color:#00ff99 !important;
96
- border:1px solid #00ff99 !important; border-radius:4px; padding:10px;
97
  }
98
- input[type=checkbox]{accent-color:#00ff99 !important;transform:scale(1.1);}
99
- ::-webkit-scrollbar{width:8px;background:#000;}
100
- ::-webkit-scrollbar-thumb{background:#00ff99;border-radius:4px;}
101
- footer,.footer,small{color:#00ff99 !important;opacity:.8;text-align:center;}
102
- """
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
  # === BUILD INTERFACE ===
106
  with gr.Blocks(css=FUTURE_CSS, title="KGX3 Research Analyzer") as demo:
 
37
  return "⚠️ You must accept the disclaimer before running KGX3.", ""
38
  if not pdf_file:
39
  return "Please select a PDF file.", ""
40
+ if not email or not re.match(r"[^@]+@[^@]+\.[^@]+", email):
41
  return "A valid email address is required to run KGX3.", ""
42
 
43
  pdf_path = pdf_file.name
 
67
 
68
  # === STYLE (high-contrast Matrix aesthetic) ===
69
  FUTURE_CSS = """
70
+ /* === UNIVERSAL RESET === */
71
+ html, body, .gradio-container, section, div, .form, .gr-block, .gr-panel, .gr-box, .gr-column, .gr-row, .container, .file-preview, .upload-box, .wrap-inner {
72
+ background-color: #000 !important;
73
+ color: #00ff99 !important;
74
+ font-family: 'Courier New', monospace !important;
75
+ box-sizing: border-box;
76
  }
77
+
78
+ /* === GENERAL TEXT === */
79
+ * { color: #00ff99 !important; }
80
+ h1, h2, h3, label, .label {
81
+ font-weight: 700 !important;
82
+ text-transform: uppercase;
83
+ border-bottom: 1px solid #00ff99;
84
+ margin-bottom: 6px;
85
+ padding-bottom: 4px;
86
+ letter-spacing: 0.5px;
87
+ }
88
+
89
+ /* === CONTAINERS === */
90
+ .gr-box, .gr-panel, .gr-block, .gr-column, .gr-row, .form {
91
+ border: 1px solid #00ff99 !important;
92
+ border-radius: 6px;
93
+ background-color: #000 !important;
94
+ padding: 8px !important;
95
+ }
96
+
97
+ /* === INPUTS & TEXTAREAS === */
98
+ input, textarea, select {
99
+ background-color: #000 !important;
100
+ color: #00ff99 !important;
101
+ border: 1px solid #00ff99 !important;
102
+ border-radius: 4px;
103
+ padding: 6px 8px !important;
104
+ }
105
+ input:focus, textarea:focus {
106
+ outline: none !important;
107
+ border: 1px solid #00ffcc !important;
108
+ background-color: #001a10 !important;
109
  }
110
+ ::placeholder { color: #00ff99 !important; opacity: 0.6; }
111
+
112
+ /* === FILE UPLOAD === */
113
+ .upload-box, .file-preview, .wrap-inner, .file-preview-container {
114
+ background-color: #000 !important;
115
+ border: 2px solid #00ff99 !important;
116
+ border-radius: 6px !important;
117
+ padding: 10px !important;
118
+ display: flex !important;
119
+ align-items: center !important;
120
+ justify-content: center !important;
121
+ transition: all 0.2s ease-in-out;
122
  }
123
+ .upload-box:hover, .file-preview:hover {
124
+ background-color: #001a10 !important;
125
+ border-color: #00ffaa !important;
126
  }
127
+
128
+ /* === BUTTONS === */
129
  button {
130
+ background-color: #000 !important;
131
+ color: #00ff99 !important;
132
+ border: 2px solid #00ff99 !important;
133
+ border-radius: 4px;
134
+ text-transform: uppercase;
135
+ font-weight: 700;
136
+ letter-spacing: 0.5px;
137
+ padding: 8px 16px !important;
138
+ transition: all 0.15s ease-in-out;
139
  }
140
+ button:hover {
141
+ background-color: #00ff99 !important;
142
+ color: #000 !important;
 
143
  }
 
 
 
 
 
144
 
145
+ /* === OUTPUT / CODE AREA === */
146
+ pre, code, .cm-editor, .cm-content, .cm-line, .output-html, .output-markdown {
147
+ background-color: #000 !important;
148
+ color: #00ff99 !important;
149
+ border: 1px solid #00ff99 !important;
150
+ border-radius: 6px;
151
+ padding: 10px !important;
152
+ font-size: 0.9rem;
153
+ }
154
+
155
+ /* === CHECKBOX === */
156
+ input[type=checkbox] {
157
+ accent-color: #00ff99 !important;
158
+ transform: scale(1.2);
159
+ }
160
+
161
+ /* === SCROLLBARS === */
162
+ ::-webkit-scrollbar { width: 8px; background: #000; }
163
+ ::-webkit-scrollbar-thumb { background: #00ff99; border-radius: 4px; }
164
+
165
+ /* === FOOTER === */
166
+ footer, .footer, small {
167
+ color: #00ff99 !important;
168
+ opacity: 0.8;
169
+ text-align: center;
170
+ letter-spacing: 0.4px;
171
+ }
172
+ """
173
 
174
  # === BUILD INTERFACE ===
175
  with gr.Blocks(css=FUTURE_CSS, title="KGX3 Research Analyzer") as demo: