Format all code.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@@ -8,21 +9,64 @@
|
||||
<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>
|
||||
body { margin: 0; padding: 2rem; font-family: 'Inter', sans-serif; background: #1a1a1a; display: flex; flex-direction: column; align-items: center; min-height: 100vh; }
|
||||
.navbar { width: 100%; max-width: 1200px; background-color: rgba(45, 55, 72, 0.5); padding: 1rem 2rem; border-radius: 12px; margin-bottom: 2rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;}
|
||||
.navbar a { color: #cbd5e0; text-decoration: none; font-weight: 600; padding: 0.5rem 1rem; border-radius: 6px; transition: background-color 0.2s, color 0.2s; }
|
||||
.navbar a.active, .navbar a:hover { background-color: #4a5568; color: #ffffff; }
|
||||
.view-switcher { margin-left: auto; display: flex; gap: 0.5rem; }
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 2rem;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: #1a1a1a;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
background-color: rgba(45, 55, 72, 0.5);
|
||||
padding: 1rem 2rem;
|
||||
border-radius: 12px;
|
||||
margin-bottom: 2rem;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 1rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navbar a {
|
||||
color: #cbd5e0;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 6px;
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
}
|
||||
|
||||
.navbar a.active,
|
||||
.navbar a:hover {
|
||||
background-color: #4a5568;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.view-switcher {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
position: relative; /* Establishes a positioning context for the menu */
|
||||
position: relative;
|
||||
/* Establishes a positioning context for the menu */
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
/* Remove the padding that was causing the misalignment */
|
||||
/* padding-bottom: 0.5rem; */
|
||||
/* padding-bottom: 0.5rem; */
|
||||
}
|
||||
|
||||
.dropdown-button {
|
||||
color: #cbd5e0;
|
||||
font-weight: 600;
|
||||
@@ -30,19 +74,23 @@
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
display: block; /* Ensures it behaves predictably with padding */
|
||||
display: block;
|
||||
/* Ensures it behaves predictably with padding */
|
||||
}
|
||||
.dropdown-button.active, .dropdown:hover .dropdown-button {
|
||||
|
||||
.dropdown-button.active,
|
||||
.dropdown:hover .dropdown-button {
|
||||
background-color: #4a5568;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
background-color: #2d3748;
|
||||
min-width: 200px;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.4);
|
||||
z-index: 1;
|
||||
border-radius: 8px;
|
||||
padding: 0.5rem 0;
|
||||
@@ -51,6 +99,7 @@
|
||||
left: 0;
|
||||
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.dropdown-menu a {
|
||||
color: #e2e8f0;
|
||||
padding: 0.75rem 1.5rem;
|
||||
@@ -58,74 +107,225 @@
|
||||
display: block;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.dropdown-menu a:hover {
|
||||
background-color: #4a5568;
|
||||
}
|
||||
|
||||
.dropdown:hover .dropdown-menu {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.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; }
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.header-action {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.header-action .icon-link svg {
|
||||
color: #a0aec0;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.header-action .icon-link:hover svg {
|
||||
color: #ffffff;
|
||||
}
|
||||
.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: #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.75rem; color: #718096; letter-spacing: 0.05em; }
|
||||
th.mentions, th.sentiment { text-align: center; }
|
||||
th.financials { text-align: right; }
|
||||
td { font-size: 1.1rem; font-weight: 600; }
|
||||
tr:last-child td { border-bottom: none; }
|
||||
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%; }
|
||||
.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: #a0aec0; }
|
||||
/* Style for the ticker link in interactive mode */
|
||||
|
||||
.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: #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.75rem;
|
||||
color: #718096;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
th.mentions,
|
||||
th.sentiment {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th.financials {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
td {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
tr:last-child td {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
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%;
|
||||
}
|
||||
|
||||
.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: #a0aec0;
|
||||
}
|
||||
|
||||
td.ticker a {
|
||||
color: inherit; /* Make the link color the same as the text */
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
transition: transform 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
td.ticker a:hover {
|
||||
text-decoration: underline;
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
/* Ticker coloring (used in both modes) */
|
||||
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; }
|
||||
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;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% if not is_image_mode %}
|
||||
<nav class="navbar">
|
||||
<a href="/" {% if not subreddit_name %}class="active"{% endif %}>Overall</a>
|
||||
|
||||
<a href="/" {% if not subreddit_name %}class="active" {% endif %}>Overall</a>
|
||||
|
||||
<!-- --- THIS IS THE NEW HTML STRUCTURE FOR THE DROPDOWN --- -->
|
||||
<div class="dropdown">
|
||||
<div class="dropdown-button {% if subreddit_name %}active{% endif %}">
|
||||
@@ -133,15 +333,15 @@
|
||||
</div>
|
||||
<div class="dropdown-menu">
|
||||
{% for sub in all_subreddits %}
|
||||
<a href="/subreddit/{{ sub }}">{{ sub }}</a>
|
||||
<a href="/subreddit/{{ sub }}">{{ sub }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<!-- --- END OF NEW HTML STRUCTURE --- -->
|
||||
|
||||
<div class="view-switcher">
|
||||
<a href="?view=daily" {% if view_type == 'daily' %}class="active"{% endif %}>Daily</a>
|
||||
<a href="?view=weekly" {% if view_type == 'weekly' %}class="active"{% endif %}>Weekly</a>
|
||||
<a href="?view=daily" {% if view_type=='daily' %}class="active" {% endif %}>Daily</a>
|
||||
<a href="?view=weekly" {% if view_type=='weekly' %}class="active" {% endif %}>Weekly</a>
|
||||
</div>
|
||||
</nav>
|
||||
{% endif %}
|
||||
@@ -149,4 +349,5 @@
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -12,11 +12,12 @@
|
||||
|
||||
<div class="header-action">
|
||||
<div class="date">{{ date_string }}</div>
|
||||
|
||||
|
||||
<!-- Only show the icon if we are NOT already in image mode -->
|
||||
{% if not is_image_mode %}
|
||||
<a href="{{ base_url }}?view={{ view_type }}&image=true" class="icon-link" title="View as Shareable Image">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"></path>
|
||||
<circle cx="12" cy="13" r="4"></circle>
|
||||
</svg>
|
||||
@@ -42,28 +43,28 @@
|
||||
<td class="ticker">
|
||||
<strong>
|
||||
{% if is_image_mode %}
|
||||
{{ ticker.symbol }}
|
||||
{{ ticker.symbol }}
|
||||
{% else %}
|
||||
<a href="/deep-dive/{{ ticker.symbol }}">{{ ticker.symbol }}</a>
|
||||
<a href="/deep-dive/{{ ticker.symbol }}">{{ ticker.symbol }}</a>
|
||||
{% endif %}
|
||||
</strong>
|
||||
</td>
|
||||
<td class="mentions">{{ ticker.total_mentions }}</td>
|
||||
<td class="sentiment">
|
||||
{% if ticker.bullish_mentions > ticker.bearish_mentions %}
|
||||
<span class="sentiment-bullish">Bullish</span>
|
||||
<span class="sentiment-bullish">Bullish</span>
|
||||
{% elif ticker.bearish_mentions > ticker.bullish_mentions %}
|
||||
<span class="sentiment-bearish">Bearish</span>
|
||||
<span class="sentiment-bearish">Bearish</span>
|
||||
{% else %}
|
||||
<span class="sentiment-neutral">Neutral</span>
|
||||
<span class="sentiment-neutral">Neutral</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="financials">{{ ticker.market_cap | format_mc }}</td>
|
||||
<td class="financials">
|
||||
{% if ticker.closing_price %}
|
||||
${{ "%.2f"|format(ticker.closing_price) }}
|
||||
${{ "%.2f"|format(ticker.closing_price) }}
|
||||
{% else %}
|
||||
N/A
|
||||
N/A
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
@@ -3,27 +3,27 @@
|
||||
{% block title %}Deep Dive: {{ symbol }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Deep Dive Analysis for: <strong>{{ symbol }}</strong></h1>
|
||||
<p>Showing posts that mention {{ symbol }}, sorted by most recent.</p>
|
||||
<h1>Deep Dive Analysis for: <strong>{{ symbol }}</strong></h1>
|
||||
<p>Showing posts that mention {{ symbol }}, sorted by most recent.</p>
|
||||
|
||||
{% for post in posts %}
|
||||
<div class="post-card">
|
||||
<h3><a href="{{ post.post_url }}" target="_blank">{{ post.title }}</a></h3>
|
||||
<div class="post-meta">
|
||||
<span>r/{{ post.subreddit_name }}</span> |
|
||||
<span>{{ post.comment_count }} comments analyzed</span> |
|
||||
<span>Avg. Sentiment:
|
||||
{% if post.avg_comment_sentiment > 0.1 %}
|
||||
<span class="sentiment-bullish">{{ "%.2f"|format(post.avg_comment_sentiment) }}</span>
|
||||
{% elif post.avg_comment_sentiment < -0.1 %}
|
||||
<span class="sentiment-bearish">{{ "%.2f"|format(post.avg_comment_sentiment) }}</span>
|
||||
{% else %}
|
||||
<span class="sentiment-neutral">{{ "%.2f"|format(post.avg_comment_sentiment) }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>No analyzed posts found for this ticker. Run the 'rstat' scraper to gather data.</p>
|
||||
{% endfor %}
|
||||
{% for post in posts %}
|
||||
<div class="post-card">
|
||||
<h3><a href="{{ post.post_url }}" target="_blank">{{ post.title }}</a></h3>
|
||||
<div class="post-meta">
|
||||
<span>r/{{ post.subreddit_name }}</span> |
|
||||
<span>{{ post.comment_count }} comments analyzed</span> |
|
||||
<span>Avg. Sentiment:
|
||||
{% if post.avg_comment_sentiment > 0.1 %}
|
||||
<span class="sentiment-bullish">{{ "%.2f"|format(post.avg_comment_sentiment) }}</span>
|
||||
{% elif post.avg_comment_sentiment < -0.1 %} <span class="sentiment-bearish">{{
|
||||
"%.2f"|format(post.avg_comment_sentiment) }}</span>
|
||||
{% else %}
|
||||
<span class="sentiment-neutral">{{ "%.2f"|format(post.avg_comment_sentiment) }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>No analyzed posts found for this ticker. Run the 'rstat' scraper to gather data.</p>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
Reference in New Issue
Block a user