From ea09bb4f4f7902c8e42d8fcefad113b37b510eb8 Mon Sep 17 00:00:00 2001
From: Sibilla ๐ Fonti
' +
+ data.sources.map(s =>
+ `
+ ${escapeHtml(s.title)}
+ ${escapeHtml(s.url)}
+ `
+ ).join('');
+ }
+
+ } catch (err) {
+ answerDiv.innerHTML = `$1
');
+ html = html.replace(/^## (.+)$/gm, '$1
');
+ html = html.replace(/^# (.+)$/gm, '$1
');
+
+ // Bold + italic
+ html = html.replace(/\*\*\*(.+?)\*\*\*/g, '$1');
+ html = html.replace(/\*\*(.+?)\*\*/g, '$1');
+ html = html.replace(/\*(.+?)\*/g, '$1');
+
+ // Inline code
+ html = html.replace(/`(.+?)`/g, '$1');
+
+ // Links
+ html = html.replace(/\[(.+?)\]\((.+?)\)/g, '$1');
+
+ // Paragraphs (double newlines)
+ html = html.replace(/\n\n/g, '
'); + html = '
' + html + '
'; + html = html.replace(/\s*<\/p>/g, '');
+
+ // Line breaks
+ html = html.replace(/\n/g, '
');
+
+ return html;
+}
+
+function escapeHtml(text) {
+ const div = document.createElement('div');
+ div.textContent = text;
+ return div.innerHTML;
+}
diff --git a/static/style.css b/static/style.css
new file mode 100644
index 0000000..2279e92
--- /dev/null
+++ b/static/style.css
@@ -0,0 +1,285 @@
+/* โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+ Sibilla โ L'Oracolo AI
+ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
+
+:root {
+ --bg: #0f0f14;
+ --surface: #1a1a24;
+ --surface-hover: #22222e;
+ --border: #2a2a3a;
+ --text: #e8e8ed;
+ --text-muted: #8888a0;
+ --accent: #a78bfa;
+ --accent-glow: #c4b5fd;
+ --success: #34d399;
+ --danger: #f87171;
+ --radius: 12px;
+ --transition: 0.2s ease;
+}
+
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+}
+
+body {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
+ background: var(--bg);
+ color: var(--text);
+ min-height: 100vh;
+ display: flex;
+ justify-content: center;
+}
+
+.container {
+ max-width: 800px;
+ width: 100%;
+ padding: 2rem 1.5rem;
+ display: flex;
+ flex-direction: column;
+ min-height: 100vh;
+}
+
+/* โโ Header โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
+
+header {
+ text-align: center;
+ margin-bottom: 3rem;
+ padding-top: 3rem;
+}
+
+header h1 {
+ font-size: 2.8rem;
+ font-weight: 700;
+ background: linear-gradient(135deg, var(--accent), var(--accent-glow));
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+ background-clip: text;
+ margin-bottom: 0.5rem;
+ letter-spacing: -0.02em;
+}
+
+.subtitle {
+ color: var(--text-muted);
+ font-size: 1.05rem;
+}
+
+/* โโ Search Box โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
+
+.search-box {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ margin-bottom: 2rem;
+}
+
+.search-box textarea {
+ width: 100%;
+ padding: 1rem 1.25rem;
+ background: var(--surface);
+ border: 2px solid var(--border);
+ border-radius: var(--radius);
+ color: var(--text);
+ font-size: 1.05rem;
+ font-family: inherit;
+ resize: vertical;
+ min-height: 80px;
+ transition: border-color var(--transition), box-shadow var(--transition);
+ outline: none;
+}
+
+.search-box textarea:focus {
+ border-color: var(--accent);
+ box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
+}
+
+.search-box textarea::placeholder {
+ color: var(--text-muted);
+}
+
+#submit-btn {
+ align-self: flex-end;
+ padding: 0.75rem 1.75rem;
+ background: linear-gradient(135deg, var(--accent), #8b5cf6);
+ border: none;
+ border-radius: var(--radius);
+ color: #fff;
+ font-size: 1rem;
+ font-weight: 600;
+ cursor: pointer;
+ transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
+}
+
+#submit-btn:hover {
+ transform: translateY(-1px);
+ box-shadow: 0 4px 20px rgba(167, 139, 250, 0.35);
+}
+
+#submit-btn:active {
+ transform: translateY(0);
+}
+
+#submit-btn:disabled {
+ opacity: 0.6;
+ cursor: not-allowed;
+ transform: none;
+}
+
+/* โโ Response Area โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
+
+.response-area {
+ flex: 1;
+ animation: fadeIn 0.3s ease;
+}
+
+@keyframes fadeIn {
+ from { opacity: 0; transform: translateY(8px); }
+ to { opacity: 1; transform: translateY(0); }
+}
+
+/* โโ Loading โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
+
+.loading {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 1rem;
+ padding: 2rem;
+ color: var(--text-muted);
+}
+
+.spinner {
+ width: 36px;
+ height: 36px;
+ border: 3px solid var(--border);
+ border-top-color: var(--accent);
+ border-radius: 50%;
+ animation: spin 0.8s linear infinite;
+}
+
+@keyframes spin {
+ to { transform: rotate(360deg); }
+}
+
+/* โโ Answer โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
+
+.answer {
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: var(--radius);
+ padding: 1.5rem;
+ margin-bottom: 1.5rem;
+ line-height: 1.7;
+ font-size: 1.02rem;
+}
+
+.answer h1, .answer h2, .answer h3 {
+ margin-top: 1.25rem;
+ margin-bottom: 0.5rem;
+ color: var(--accent-glow);
+}
+
+.answer h1 { font-size: 1.5rem; }
+.answer h2 { font-size: 1.25rem; }
+.answer h3 { font-size: 1.1rem; }
+
+.answer p {
+ margin-bottom: 0.75rem;
+}
+
+.answer ul, .answer ol {
+ padding-left: 1.5rem;
+ margin-bottom: 0.75rem;
+}
+
+.answer li {
+ margin-bottom: 0.35rem;
+}
+
+.answer code {
+ background: rgba(167, 139, 250, 0.1);
+ padding: 0.15rem 0.4rem;
+ border-radius: 4px;
+ font-size: 0.9em;
+}
+
+.answer pre {
+ background: rgba(0, 0, 0, 0.3);
+ padding: 1rem;
+ border-radius: 8px;
+ overflow-x: auto;
+ margin-bottom: 0.75rem;
+}
+
+.answer blockquote {
+ border-left: 3px solid var(--accent);
+ padding-left: 1rem;
+ color: var(--text-muted);
+ margin-bottom: 0.75rem;
+}
+
+/* โโ Sources โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
+
+.sources {
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: var(--radius);
+ padding: 1.25rem;
+}
+
+.sources h3 {
+ color: var(--accent-glow);
+ font-size: 0.95rem;
+ margin-bottom: 0.75rem;
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+}
+
+.source-item {
+ display: block;
+ padding: 0.6rem 0.75rem;
+ border-radius: 8px;
+ color: var(--text);
+ text-decoration: none;
+ transition: background var(--transition);
+ margin-bottom: 0.25rem;
+ font-size: 0.9rem;
+}
+
+.source-item:hover {
+ background: var(--surface-hover);
+}
+
+.source-item .source-title {
+ font-weight: 500;
+ color: var(--accent-glow);
+}
+
+.source-item .source-url {
+ color: var(--text-muted);
+ font-size: 0.8rem;
+ display: block;
+ margin-top: 0.15rem;
+ word-break: break-all;
+}
+
+/* โโ Error โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
+
+.error-box {
+ background: rgba(248, 113, 113, 0.1);
+ border: 1px solid var(--danger);
+ border-radius: var(--radius);
+ padding: 1rem 1.25rem;
+ color: var(--danger);
+}
+
+/* โโ Footer โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
+
+footer {
+ text-align: center;
+ padding: 1.5rem 0;
+ color: var(--text-muted);
+ font-size: 0.8rem;
+ margin-top: auto;
+}
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..c38aac3
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,47 @@
+
+
+
L'oracolo AI che cerca nel web e risponde alle tue domande
+