Update app.py
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ class ChartAnalyzer:
|
|
67 |
except Exception as e:
|
68 |
return f"Analysis Error: {str(e)}"
|
69 |
|
70 |
-
# Custom CSS for
|
71 |
custom_css = """
|
72 |
:root {
|
73 |
--primary-color: #2563eb;
|
@@ -82,6 +82,12 @@ body {
|
|
82 |
color: var(--text-color);
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
.analysis-box {
|
86 |
background-color: white;
|
87 |
border-radius: 12px;
|
@@ -90,6 +96,7 @@ body {
|
|
90 |
border: 1px solid var(--border-color);
|
91 |
height: 600px;
|
92 |
overflow-y: auto;
|
|
|
93 |
}
|
94 |
|
95 |
.upload-box {
|
@@ -98,6 +105,7 @@ body {
|
|
98 |
padding: 24px;
|
99 |
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
100 |
border: 1px solid var(--border-color);
|
|
|
101 |
}
|
102 |
|
103 |
.primary-button {
|
@@ -106,6 +114,7 @@ body {
|
|
106 |
border-radius: 8px !important;
|
107 |
padding: 12px 24px !important;
|
108 |
font-weight: 500 !important;
|
|
|
109 |
}
|
110 |
|
111 |
.primary-button:hover {
|
@@ -113,8 +122,10 @@ body {
|
|
113 |
}
|
114 |
|
115 |
.markdown-container {
|
116 |
-
max-width:
|
117 |
margin: 0 auto;
|
|
|
|
|
118 |
}
|
119 |
|
120 |
.markdown-container h2 {
|
@@ -135,6 +146,27 @@ body {
|
|
135 |
border-radius: 4px;
|
136 |
font-family: monospace;
|
137 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
"""
|
139 |
|
140 |
# Gradio Interface
|
@@ -142,19 +174,37 @@ analyzer = ChartAnalyzer()
|
|
142 |
|
143 |
with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
144 |
gr.Markdown("""
|
145 |
-
<div
|
146 |
-
<
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
</div>
|
153 |
""")
|
154 |
|
155 |
with gr.Row():
|
156 |
with gr.Column(scale=1, elem_classes=["upload-box"]):
|
157 |
-
gr.Markdown("### π€ Upload Your Chart")
|
158 |
chart_input = gr.Image(
|
159 |
type="filepath",
|
160 |
label="",
|
@@ -168,7 +218,6 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
|
168 |
)
|
169 |
|
170 |
with gr.Column(scale=2, elem_classes=["analysis-box"]):
|
171 |
-
gr.Markdown("### π Analysis Report")
|
172 |
analysis_output = gr.Markdown(
|
173 |
label="",
|
174 |
elem_classes=["markdown-container"]
|
|
|
67 |
except Exception as e:
|
68 |
return f"Analysis Error: {str(e)}"
|
69 |
|
70 |
+
# Custom CSS for optimized layout
|
71 |
custom_css = """
|
72 |
:root {
|
73 |
--primary-color: #2563eb;
|
|
|
82 |
color: var(--text-color);
|
83 |
}
|
84 |
|
85 |
+
.container {
|
86 |
+
max-width: 1200px;
|
87 |
+
margin: 0 auto;
|
88 |
+
padding: 20px;
|
89 |
+
}
|
90 |
+
|
91 |
.analysis-box {
|
92 |
background-color: white;
|
93 |
border-radius: 12px;
|
|
|
96 |
border: 1px solid var(--border-color);
|
97 |
height: 600px;
|
98 |
overflow-y: auto;
|
99 |
+
width: 100%;
|
100 |
}
|
101 |
|
102 |
.upload-box {
|
|
|
105 |
padding: 24px;
|
106 |
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
107 |
border: 1px solid var(--border-color);
|
108 |
+
width: 100%;
|
109 |
}
|
110 |
|
111 |
.primary-button {
|
|
|
114 |
border-radius: 8px !important;
|
115 |
padding: 12px 24px !important;
|
116 |
font-weight: 500 !important;
|
117 |
+
width: 100%;
|
118 |
}
|
119 |
|
120 |
.primary-button:hover {
|
|
|
122 |
}
|
123 |
|
124 |
.markdown-container {
|
125 |
+
max-width: 100%;
|
126 |
margin: 0 auto;
|
127 |
+
padding: 0 15px;
|
128 |
+
word-wrap: break-word;
|
129 |
}
|
130 |
|
131 |
.markdown-container h2 {
|
|
|
146 |
border-radius: 4px;
|
147 |
font-family: monospace;
|
148 |
}
|
149 |
+
|
150 |
+
.row {
|
151 |
+
display: flex;
|
152 |
+
flex-wrap: wrap;
|
153 |
+
gap: 20px;
|
154 |
+
}
|
155 |
+
|
156 |
+
.column {
|
157 |
+
flex: 1;
|
158 |
+
min-width: 300px;
|
159 |
+
}
|
160 |
+
|
161 |
+
@media (max-width: 768px) {
|
162 |
+
.row {
|
163 |
+
flex-direction: column;
|
164 |
+
}
|
165 |
+
|
166 |
+
.column {
|
167 |
+
width: 100%;
|
168 |
+
}
|
169 |
+
}
|
170 |
"""
|
171 |
|
172 |
# Gradio Interface
|
|
|
174 |
|
175 |
with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
176 |
gr.Markdown("""
|
177 |
+
<div class="container">
|
178 |
+
<div style="text-align: center; margin-bottom: 32px;">
|
179 |
+
<h1 style="color: var(--primary-color); font-size: 2.5rem; margin-bottom: 16px;">
|
180 |
+
π CryptoVision Pro
|
181 |
+
</h1>
|
182 |
+
<p style="color: var(--text-color); font-size: 1.1rem;">
|
183 |
+
Advanced AI-powered cryptocurrency technical analysis
|
184 |
+
</p>
|
185 |
+
</div>
|
186 |
+
|
187 |
+
<div class="row">
|
188 |
+
<div class="column">
|
189 |
+
<div class="upload-box">
|
190 |
+
<h3>π€ Upload Your Chart</h3>
|
191 |
+
<gr.Image />
|
192 |
+
<gr.Button />
|
193 |
+
</div>
|
194 |
+
</div>
|
195 |
+
|
196 |
+
<div class="column">
|
197 |
+
<div class="analysis-box">
|
198 |
+
<h3>π HundAI Agent Analysis Report</h3>
|
199 |
+
<gr.Markdown />
|
200 |
+
</div>
|
201 |
+
</div>
|
202 |
+
</div>
|
203 |
</div>
|
204 |
""")
|
205 |
|
206 |
with gr.Row():
|
207 |
with gr.Column(scale=1, elem_classes=["upload-box"]):
|
|
|
208 |
chart_input = gr.Image(
|
209 |
type="filepath",
|
210 |
label="",
|
|
|
218 |
)
|
219 |
|
220 |
with gr.Column(scale=2, elem_classes=["analysis-box"]):
|
|
|
221 |
analysis_output = gr.Markdown(
|
222 |
label="",
|
223 |
elem_classes=["markdown-container"]
|