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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html><head><base href="echo.iamwomen.cloudns.be">
|
2 |
+
<meta charset="UTF-8">
|
3 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
4 |
+
<title>Echo: Advanced AI Research Agent</title>
|
5 |
+
<style>
|
6 |
+
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700&family=Roboto:wght@300;400;700&display=swap');
|
7 |
+
:root {
|
8 |
+
--text-color: #f0f0f0;
|
9 |
+
--primary-color: #6a11cb;
|
10 |
+
--secondary-color: #2575fc;
|
11 |
+
--overlay-color: rgba(0, 0, 0, 0.6);
|
12 |
+
}
|
13 |
+
body, html {
|
14 |
+
margin: 0;
|
15 |
+
padding: 0;
|
16 |
+
font-family: 'Roboto', sans-serif;
|
17 |
+
color: var(--text-color);
|
18 |
+
height: 100%;
|
19 |
+
overflow: hidden;
|
20 |
+
background-color: #0f0f1a;
|
21 |
+
}
|
22 |
+
.background {
|
23 |
+
position: fixed;
|
24 |
+
top: 0;
|
25 |
+
left: 0;
|
26 |
+
width: 100%;
|
27 |
+
height: 100%;
|
28 |
+
background-image: url('https://images.pexels.com/photos/531880/pexels-photo-531880.jpeg?cs=srgb&dl=pexels-pixabay-531880.jpg&fm=jpg');
|
29 |
+
background-size: cover;
|
30 |
+
background-position: center;
|
31 |
+
filter: brightness(0.6) saturate(1.2);
|
32 |
+
z-index: -2;
|
33 |
+
}
|
34 |
+
.overlay {
|
35 |
+
position: fixed;
|
36 |
+
top: 0;
|
37 |
+
left: 0;
|
38 |
+
width: 100%;
|
39 |
+
height: 100%;
|
40 |
+
background: linear-gradient(135deg, var(--overlay-color), rgba(0, 0, 0, 0.8));
|
41 |
+
z-index: -1;
|
42 |
+
}
|
43 |
+
.container {
|
44 |
+
display: flex;
|
45 |
+
flex-direction: column;
|
46 |
+
justify-content: center;
|
47 |
+
align-items: center;
|
48 |
+
height: 100%;
|
49 |
+
padding: 20px;
|
50 |
+
box-sizing: border-box;
|
51 |
+
}
|
52 |
+
.title-container {
|
53 |
+
text-align: center;
|
54 |
+
margin-bottom: 60px;
|
55 |
+
transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
|
56 |
+
}
|
57 |
+
.title {
|
58 |
+
font-family: 'Montserrat', sans-serif;
|
59 |
+
font-size: 5em;
|
60 |
+
font-weight: 700;
|
61 |
+
margin: 0;
|
62 |
+
background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
|
63 |
+
-webkit-background-clip: text;
|
64 |
+
-webkit-text-fill-color: transparent;
|
65 |
+
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
|
66 |
+
letter-spacing: 2px;
|
67 |
+
}
|
68 |
+
.tagline {
|
69 |
+
font-size: 1.4em;
|
70 |
+
margin-top: 15px;
|
71 |
+
color: var(--text-color);
|
72 |
+
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
|
73 |
+
font-weight: 300;
|
74 |
+
letter-spacing: 1px;
|
75 |
+
}
|
76 |
+
.query-container {
|
77 |
+
background: rgba(255, 255, 255, 0.1);
|
78 |
+
backdrop-filter: blur(10px);
|
79 |
+
border-radius: 20px;
|
80 |
+
padding: 30px;
|
81 |
+
width: 80%;
|
82 |
+
max-width: 600px;
|
83 |
+
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
|
84 |
+
transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
|
85 |
+
display: flex;
|
86 |
+
flex-direction: column;
|
87 |
+
align-items: center;
|
88 |
+
}
|
89 |
+
#query-input {
|
90 |
+
width: 100%;
|
91 |
+
padding: 15px 20px;
|
92 |
+
border: none;
|
93 |
+
border-radius: 30px;
|
94 |
+
background-color: rgba(255, 255, 255, 0.15);
|
95 |
+
color: var(--text-color);
|
96 |
+
font-size: 1.1em;
|
97 |
+
transition: all 0.3s ease;
|
98 |
+
margin-bottom: 25px;
|
99 |
+
}
|
100 |
+
#query-input:focus {
|
101 |
+
outline: none;
|
102 |
+
box-shadow: 0 0 15px rgba(106, 17, 203, 0.5);
|
103 |
+
background-color: rgba(255, 255, 255, 0.2);
|
104 |
+
}
|
105 |
+
#submit-btn {
|
106 |
+
padding: 14px 50px;
|
107 |
+
border: none;
|
108 |
+
border-radius: 30px;
|
109 |
+
background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
|
110 |
+
color: white;
|
111 |
+
font-size: 1.2em;
|
112 |
+
font-weight: bold;
|
113 |
+
cursor: pointer;
|
114 |
+
transition: all 0.3s ease;
|
115 |
+
box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
|
116 |
+
text-transform: uppercase;
|
117 |
+
letter-spacing: 2px;
|
118 |
+
}
|
119 |
+
#submit-btn:hover {
|
120 |
+
transform: translateY(-3px);
|
121 |
+
box-shadow: 0 8px 25px rgba(106, 17, 203, 0.6);
|
122 |
+
}
|
123 |
+
#submit-btn:active {
|
124 |
+
transform: translateY(1px);
|
125 |
+
box-shadow: 0 3px 10px rgba(106, 17, 203, 0.4);
|
126 |
+
}
|
127 |
+
.result-container {
|
128 |
+
margin-top: 40px;
|
129 |
+
width: 80%;
|
130 |
+
max-width: 800px;
|
131 |
+
background: rgba(255, 255, 255, 0.1);
|
132 |
+
backdrop-filter: blur(10px);
|
133 |
+
border-radius: 20px;
|
134 |
+
padding: 30px;
|
135 |
+
opacity: 0;
|
136 |
+
transform: translateY(20px);
|
137 |
+
transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
|
138 |
+
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
|
139 |
+
}
|
140 |
+
.result-container.show {
|
141 |
+
opacity: 1;
|
142 |
+
transform: translateY(0);
|
143 |
+
}
|
144 |
+
#result {
|
145 |
+
white-space: pre-wrap;
|
146 |
+
word-wrap: break-word;
|
147 |
+
font-size: 1.1em;
|
148 |
+
line-height: 1.6;
|
149 |
+
}
|
150 |
+
.loading {
|
151 |
+
display: none;
|
152 |
+
justify-content: center;
|
153 |
+
align-items: center;
|
154 |
+
margin-top: 30px;
|
155 |
+
}
|
156 |
+
.loading-dot {
|
157 |
+
width: 12px;
|
158 |
+
height: 12px;
|
159 |
+
border-radius: 50%;
|
160 |
+
background-color: var(--secondary-color);
|
161 |
+
margin: 0 8px;
|
162 |
+
animation: loading 1.5s infinite ease-in-out;
|
163 |
+
}
|
164 |
+
.loading-dot:nth-child(2) {
|
165 |
+
animation-delay: 0.5s;
|
166 |
+
background-color: var(--primary-color);
|
167 |
+
}
|
168 |
+
.loading-dot:nth-child(3) {
|
169 |
+
animation-delay: 1s;
|
170 |
+
}
|
171 |
+
@keyframes loading {
|
172 |
+
0%, 100% { transform: scale(1); opacity: 0.5; }
|
173 |
+
50% { transform: scale(1.5); opacity: 1; }
|
174 |
+
}
|
175 |
+
@media (max-width: 768px) {
|
176 |
+
.title {
|
177 |
+
font-size: 3.5em;
|
178 |
+
}
|
179 |
+
.tagline {
|
180 |
+
font-size: 1.2em;
|
181 |
+
}
|
182 |
+
.query-container, .result-container {
|
183 |
+
width: 90%;
|
184 |
+
}
|
185 |
+
}
|
186 |
+
</style>
|
187 |
+
</head>
|
188 |
+
<body>
|
189 |
+
<div class="background"></div>
|
190 |
+
<div class="overlay"></div>
|
191 |
+
<div class="container">
|
192 |
+
<div class="title-container">
|
193 |
+
<h1 class="title">Echo</h1>
|
194 |
+
<p class="tagline">Your Advanced AI Research Companion</p>
|
195 |
+
</div>
|
196 |
+
<div class="query-container">
|
197 |
+
<input type="text" id="query-input" placeholder="Ask Echo a question...">
|
198 |
+
<button id="submit-btn">Research</button>
|
199 |
+
</div>
|
200 |
+
<div class="loading">
|
201 |
+
<div class="loading-dot"></div>
|
202 |
+
<div class="loading-dot"></div>
|
203 |
+
<div class="loading-dot"></div>
|
204 |
+
</div>
|
205 |
+
<div class="result-container">
|
206 |
+
<pre id="result"></pre>
|
207 |
+
</div>
|
208 |
+
</div>
|
209 |
+
|
210 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js"></script>
|
211 |
+
<script>
|
212 |
+
const queryInput = document.getElementById('query-input');
|
213 |
+
const submitBtn = document.getElementById('submit-btn');
|
214 |
+
const resultContainer = document.querySelector('.result-container');
|
215 |
+
const result = document.getElementById('result');
|
216 |
+
const loading = document.querySelector('.loading');
|
217 |
+
const queryContainer = document.querySelector('.query-container');
|
218 |
+
const titleContainer = document.querySelector('.title-container');
|
219 |
+
async function getEchoResponse(query) {
|
220 |
+
try {
|
221 |
+
const response = await fetch('/research', {
|
222 |
+
method: 'POST',
|
223 |
+
headers: {
|
224 |
+
'Content-Type': 'application/json',
|
225 |
+
},
|
226 |
+
body: JSON.stringify({ query: query }),
|
227 |
+
});
|
228 |
+
const data = await response.json();
|
229 |
+
return data.result;
|
230 |
+
} catch (error) {
|
231 |
+
console.error('Error fetching response:', error);
|
232 |
+
return 'I apologize, but I encountered an error while processing your request.';
|
233 |
+
}
|
234 |
+
}
|
235 |
+
submitBtn.addEventListener('click', async () => {
|
236 |
+
const query = queryInput.value.trim();
|
237 |
+
if (query) {
|
238 |
+
titleContainer.style.opacity = '0';
|
239 |
+
titleContainer.style.transform = 'translateY(-100px)';
|
240 |
+
queryContainer.style.transform = 'translateY(-120px) scale(0.9)';
|
241 |
+
loading.style.display = 'flex';
|
242 |
+
resultContainer.classList.remove('show');
|
243 |
+
result.textContent = '';
|
244 |
+
const echoResponse = await getEchoResponse(query);
|
245 |
+
|
246 |
+
loading.style.display = 'none';
|
247 |
+
resultContainer.classList.add('show');
|
248 |
+
result.textContent = echoResponse;
|
249 |
+
// Animate typing effect
|
250 |
+
result.textContent = '';
|
251 |
+
let i = 0;
|
252 |
+
const typeWriter = () => {
|
253 |
+
if (i < echoResponse.length) {
|
254 |
+
result.textContent += echoResponse.charAt(i);
|
255 |
+
i++;
|
256 |
+
setTimeout(typeWriter, 10);
|
257 |
+
}
|
258 |
+
};
|
259 |
+
typeWriter();
|
260 |
+
}
|
261 |
+
});
|
262 |
+
queryInput.addEventListener('keypress', (e) => {
|
263 |
+
if (e.key === 'Enter') {
|
264 |
+
submitBtn.click();
|
265 |
+
}
|
266 |
+
});
|
267 |
+
// Add particle effect
|
268 |
+
const particlesContainer = document.createElement('div');
|
269 |
+
particlesContainer.id = 'particles-js';
|
270 |
+
particlesContainer.style.position = 'fixed';
|
271 |
+
particlesContainer.style.top = '0';
|
272 |
+
particlesContainer.style.left = '0';
|
273 |
+
particlesContainer.style.width = '100%';
|
274 |
+
particlesContainer.style.height = '100%';
|
275 |
+
particlesContainer.style.zIndex = '-1';
|
276 |
+
document.body.appendChild(particlesContainer);
|
277 |
+
const script = document.createElement('script');
|
278 |
+
script.src = 'https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js';
|
279 |
+
script.onload = () => {
|
280 |
+
particlesJS('particles-js', {
|
281 |
+
particles: {
|
282 |
+
number: { value: 80, density: { enable: true, value_area: 800 } },
|
283 |
+
color: { value: '#ffffff' },
|
284 |
+
shape: { type: 'circle' },
|
285 |
+
opacity: { value: 0.5, random: true },
|
286 |
+
size: { value: 3, random: true },
|
287 |
+
line_linked: { enable: true, distance: 150, color: '#ffffff', opacity: 0.4, width: 1 },
|
288 |
+
move: { enable: true, speed: 2, direction: 'none', random: true, out_mode: 'out' }
|
289 |
+
},
|
290 |
+
interactivity: {
|
291 |
+
detect_on: 'canvas',
|
292 |
+
events: { onhover: { enable: true, mode: 'grab' }, onclick: { enable: true, mode: 'push' } },
|
293 |
+
modes: { grab: { distance: 140, line_linked: { opacity: 1 } }, push: { particles_nb: 4 } }
|
294 |
+
},
|
295 |
+
retina_detect: true
|
296 |
+
});
|
297 |
+
};
|
298 |
+
document.body.appendChild(script);
|
299 |
+
</script>
|
300 |
+
</body></html>
|