Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +40 -96
templates/index.html
CHANGED
|
@@ -1,118 +1,62 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en" data-theme="dark">
|
| 3 |
-
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8">
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
-
<title>CryptoSentinel
|
| 8 |
-
|
| 9 |
-
<
|
| 10 |
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css">
|
| 11 |
-
|
| 12 |
-
<!-- HTMX Core and Server-Sent Events (SSE) Extension -->
|
| 13 |
-
<script src="https://unpkg.com/htmx.org@1.9.10" integrity="sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" crossorigin="anonymous"></script>
|
| 14 |
<script src="https://unpkg.com/htmx.org/dist/ext/sse.js"></script>
|
| 15 |
-
|
| 16 |
<style>
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
margin: 2rem auto;
|
| 22 |
-
}
|
| 23 |
-
.htmx-indicator {
|
| 24 |
-
display: none; /* Hide indicator by default */
|
| 25 |
-
}
|
| 26 |
-
.htmx-request .htmx-indicator {
|
| 27 |
-
display: inline; /* Show when a request is in flight */
|
| 28 |
-
}
|
| 29 |
-
.htmx-request .hide-on-request {
|
| 30 |
-
display: none; /* Hide element during request */
|
| 31 |
-
}
|
| 32 |
.sentiment-positive { color: var(--pico-color-green-400); }
|
| 33 |
.sentiment-negative { color: var(--pico-color-red-400); }
|
| 34 |
-
.sentiment-
|
| 35 |
-
|
| 36 |
-
border-bottom: 1px solid var(--pico-muted-border-color);
|
| 37 |
-
padding-bottom: 1rem;
|
| 38 |
-
margin-bottom: 1rem;
|
| 39 |
-
}
|
| 40 |
</style>
|
| 41 |
</head>
|
| 42 |
-
|
| 43 |
-
<!-- Enable the SSE extension for the whole body -->
|
| 44 |
<body hx-ext="sse">
|
| 45 |
-
|
| 46 |
<main class="container">
|
| 47 |
<header style="text-align: center;">
|
| 48 |
-
<h1>🤖 CryptoSentinel
|
| 49 |
-
<p>
|
| 50 |
</header>
|
| 51 |
|
| 52 |
-
<
|
| 53 |
-
|
| 54 |
-
<header><strong>Market Snapshot</strong></header>
|
| 55 |
-
<div
|
| 56 |
-
id="prices"
|
| 57 |
-
hx-get="/api/prices"
|
| 58 |
-
hx-trigger="load, every 10s"
|
| 59 |
-
hx-swap="innerHTML"
|
| 60 |
-
aria-live="polite">
|
| 61 |
-
<!-- Initial loading state -->
|
| 62 |
-
<p aria-busy="true">Fetching latest prices...</p>
|
| 63 |
-
</div>
|
| 64 |
-
</article>
|
| 65 |
-
|
| 66 |
-
<!-- Section 2: Sentiment Analysis -->
|
| 67 |
-
<article>
|
| 68 |
-
<header><strong>Sentiment Analyzer</strong></header>
|
| 69 |
-
|
| 70 |
-
<!-- Form for submitting text -->
|
| 71 |
-
<form
|
| 72 |
-
hx-post="/api/sentiment"
|
| 73 |
-
hx-target="#analysis-status"
|
| 74 |
-
hx-swap="innerHTML"
|
| 75 |
-
hx-on::after-request="this.reset()">
|
| 76 |
-
<label for="sentiment-text">Analyze market chatter, news, or a tweet:</label>
|
| 77 |
-
<textarea id="sentiment-text" name="text" placeholder="e.g., 'The market is pumping! To the moon! 🚀'" required></textarea>
|
| 78 |
-
|
| 79 |
-
<button type="submit">
|
| 80 |
-
<span class="hide-on-request">Analyze Sentiment</span>
|
| 81 |
-
<span class="htmx-indicator" aria-busy="true">Analyzing...</span>
|
| 82 |
-
</button>
|
| 83 |
-
<small id="analysis-status" style="margin-left: 1rem;"></small>
|
| 84 |
-
</form>
|
| 85 |
-
|
| 86 |
-
<!-- Area for real-time results from the SSE stream -->
|
| 87 |
<section>
|
| 88 |
-
<
|
| 89 |
-
|
| 90 |
-
id="
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
</section>
|
| 97 |
-
</article>
|
| 98 |
|
| 99 |
-
|
| 100 |
-
<
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
<blockquote>"{text}"</blockquote>
|
| 109 |
-
<p>
|
| 110 |
-
<strong>Result:</strong>
|
| 111 |
-
<span class="sentiment-{label}">{label}</span>
|
| 112 |
-
(Confidence: {score})
|
| 113 |
-
</p>
|
| 114 |
</div>
|
| 115 |
-
</
|
| 116 |
-
|
| 117 |
</body>
|
| 118 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en" data-theme="dark">
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>CryptoSentinel Pro</title>
|
| 7 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
|
| 8 |
+
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
<script src="https://unpkg.com/htmx.org/dist/ext/sse.js"></script>
|
|
|
|
| 10 |
<style>
|
| 11 |
+
.card { border-left-width: 4px; border-left-style: solid; margin-bottom: 1.5rem; }
|
| 12 |
+
.impact-low { border-left-color: var(--pico-color-cyan-500); }
|
| 13 |
+
.impact-medium { border-left-color: var(--pico-color-amber-500); }
|
| 14 |
+
.impact-high { border-left-color: var(--pico-color-red-600); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
.sentiment-positive { color: var(--pico-color-green-400); }
|
| 16 |
.sentiment-negative { color: var(--pico-color-red-400); }
|
| 17 |
+
.sentiment-neutral { color: var(--pico-color-gray-400); }
|
| 18 |
+
blockquote { font-style: italic; }
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</style>
|
| 20 |
</head>
|
|
|
|
|
|
|
| 21 |
<body hx-ext="sse">
|
|
|
|
| 22 |
<main class="container">
|
| 23 |
<header style="text-align: center;">
|
| 24 |
+
<h1>🤖 CryptoSentinel Pro</h1>
|
| 25 |
+
<p>AI-Powered Market Intelligence</p>
|
| 26 |
</header>
|
| 27 |
|
| 28 |
+
<div class="grid">
|
| 29 |
+
<!-- Left Column: Manual Analysis & Prices -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
<section>
|
| 31 |
+
<article>
|
| 32 |
+
<header><strong>Market Snapshot</strong></header>
|
| 33 |
+
<div id="prices" hx-get="/api/prices" hx-trigger="load, every 30s" hx-swap="innerHTML">
|
| 34 |
+
<p aria-busy="true">Fetching prices...</p>
|
| 35 |
+
</div>
|
| 36 |
+
</article>
|
| 37 |
+
<article>
|
| 38 |
+
<header><strong>Manual Analysis</strong></header>
|
| 39 |
+
<form hx-post="/api/sentiment" hx-target="#analysis-status" hx-on::after-request="this.reset()">
|
| 40 |
+
<textarea name="text" placeholder="Paste news headline or tweet here..." required></textarea>
|
| 41 |
+
<button type="submit">Run Deep Analysis</button>
|
| 42 |
+
<small id="analysis-status"></small>
|
| 43 |
+
</form>
|
| 44 |
+
<div id="manual-results" hx-sse="connect:/api/sentiment/stream" hx-swap="afterbegin">
|
| 45 |
+
<!-- Manual analysis results appear here -->
|
| 46 |
+
</div>
|
| 47 |
+
</article>
|
| 48 |
</section>
|
|
|
|
| 49 |
|
| 50 |
+
<!-- Right Column: Automated News Feed -->
|
| 51 |
+
<section>
|
| 52 |
+
<article>
|
| 53 |
+
<header><strong>Automated Market Intelligence Feed</strong></header>
|
| 54 |
+
<div id="news-feed" hx-sse="connect:/api/news/stream" hx-swap="afterbegin">
|
| 55 |
+
<p aria-busy="true">Initializing live news feed...</p>
|
| 56 |
+
</div>
|
| 57 |
+
</article>
|
| 58 |
+
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
</div>
|
| 60 |
+
</main>
|
|
|
|
| 61 |
</body>
|
| 62 |
</html>
|