Big improvements on image view.

This commit is contained in:
2025-07-22 20:53:38 +02:00
parent 45818046a2
commit 2688a7df44
9 changed files with 324 additions and 326 deletions

View File

@@ -3,63 +3,59 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Weekly Sentiment: r/{{ subreddit_name }}</title>
<!-- All the <style> and <link> tags from image_view.html go here -->
<!-- You can just copy the entire <head> section from image_view.html -->
<title>r/{{ subreddit_name }} Ticker Mentions</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap" rel="stylesheet">
<style>
/* This entire style block is IDENTICAL to image_view.html */
body { margin: 0; padding: 2rem; font-family: 'Inter', sans-serif; background: #1a1a1a; display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.image-container { width: 650px; background: linear-gradient(145deg, #4d302d, #1f2128); color: #ffffff; border-radius: 16px; padding: 2.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5); text-align: center; }
.image-container { width: 750px; background: linear-gradient(145deg, #2d3748, #1a202c); color: #ffffff; border-radius: 16px; padding: 2.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5); text-align: center; }
header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; }
.title-block { text-align: left; }
.title-block h1 { font-size: 2.5rem; font-weight: 800; margin: 0; line-height: 1; }
.title-block h2 { font-size: 1.25rem; font-weight: 600; margin: 0.5rem 0 0; color: #b0b0b0; }
.date { font-size: 1rem; font-weight: 600; color: #c0c0c0; letter-spacing: 0.02em; }
.title-block h2 { font-size: 1.25rem; font-weight: 600; margin: 0.5rem 0 0; color: #a0aec0; }
.date { font-size: 1.1rem; font-weight: 600; color: #a0aec0; letter-spacing: 0.02em; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 1rem 0.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
th { font-weight: 700; text-transform: uppercase; font-size: 0.8rem; color: #a0a0a0; }
th { font-weight: 700; text-transform: uppercase; font-size: 0.75rem; color: #718096; letter-spacing: 0.05em; }
td { font-size: 1.1rem; font-weight: 600; }
tr:last-child td { border-bottom: none; }
td.rank { font-weight: 700; color: #d0d0d0; width: 8%; }
td.ticker { width: 30%; }
td.mentions { text-align: center; width: 18%; }
td.sentiment { text-align: center; width: 26%; }
.sentiment-bullish { color: #28a745; font-weight: 700; }
.sentiment-bearish { color: #dc3545; font-weight: 700; }
.sentiment-neutral { color: #9e9e9e; font-weight: 600; }
tr:nth-child(1) td.ticker { color: #d8b4fe; } tr:nth-child(6) td.ticker { color: #fca5a5; }
tr:nth-child(2) td.ticker { color: #a3e635; } tr:nth-child(7) td.ticker { color: #fdba74; }
tr:nth-child(3) td.ticker { color: #67e8f9; } tr:nth-child(8) td.ticker { color: #6ee7b7; }
tr:nth-child(4) td.ticker { color: #fde047; } tr:nth-child(9) td.ticker { color: #93c5fd; }
tr:nth-child(5) td.ticker { color: #fcd34d; } tr:nth-child(10) td.ticker { color: #d1d5db; }
td.rank { font-weight: 700; color: #cbd5e0; width: 5%; }
td.ticker { width: 15%; }
td.financials { text-align: right; width: 20%; }
td.mentions { text-align: center; width: 15%; }
td.sentiment { text-align: center; width: 20%; }
th.mentions, th.sentiment {
text-align: center;
}
th.financials {
text-align: right;
}
.sentiment-bullish { color: #48bb78; font-weight: 700; }
.sentiment-bearish { color: #f56565; font-weight: 700; }
.sentiment-neutral { color: #a0aec0; font-weight: 600; }
footer { margin-top: 2.5rem; }
.brand-name { font-size: 1.75rem; font-weight: 800; letter-spacing: -1px; }
.brand-subtitle { font-size: 1rem; color: #b0b0b0; }
.brand-subtitle { font-size: 1rem; color: #a0aec0; }
</style>
</head>
<body>
<div class="image-container">
<header>
<div class="title-block">
<!-- UPDATED: Title shows it's a weekly report -->
<h1>Weekly Sentiment</h1>
<h2>r/{{ subreddit_name }} - Top 10</h2>
<h1>Ticker Mentions Weekly</h1>
<h2>r/{{ subreddit_name }}</h2>
</div>
<!-- UPDATED: Date now shows the range -->
<div class="date">{{ date_range }}</div>
</header>
<!-- The entire table structure is IDENTICAL to image_view.html -->
<table>
<thead>
<tr>
<th class="rank">Rank</th>
<th class="ticker">Ticker</th>
<th class="mentions">Posts</th>
<th class="mentions">Comments</th>
<th class="mentions">Mentions</th>
<th class="financials">Mkt Cap</th>
<th class="financials">Close Price</th>
<th class="sentiment">Sentiment</th>
</tr>
</thead>
@@ -68,8 +64,15 @@
<tr>
<td class="rank">{{ loop.index }}</td>
<td class="ticker">{{ ticker.symbol }}</td>
<td class="mentions">{{ ticker.post_mentions }}</td>
<td class="mentions">{{ ticker.comment_mentions }}</td>
<td class="mentions">{{ ticker.total_mentions }}</td>
<td class="financials">{{ ticker.market_cap | format_mc }}</td>
<td class="financials">
{% if ticker.closing_price %}
${{ "%.2f"|format(ticker.closing_price) }}
{% else %}
N/A
{% endif %}
</td>
<td class="sentiment">
{% if ticker.bullish_mentions > ticker.bearish_mentions %}
<span class="sentiment-bullish">Bullish</span>
@@ -83,7 +86,6 @@
{% endfor %}
</tbody>
</table>
<footer>
<div class="brand-name">r/rstat</div>
<div class="brand-subtitle">visit us for more</div>