Update web/templates/stats.html
This commit is contained in:
parent
529d284050
commit
f2a90746ab
@ -36,22 +36,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tag Cloud (replaces Top Subjects) -->
|
||||
<!-- Subject Cloud (no pills) -->
|
||||
<div class="card" style="padding:16px; margin-bottom:16px;">
|
||||
<div class="meta-label">Subject Cloud</div>
|
||||
|
||||
{% if top_subjects %}
|
||||
{# max count is the first item because list is sorted desc in the view #}
|
||||
{% with maxc=top_subjects.0.count|default:1 %}
|
||||
<div class="tag-cloud" aria-label="Subject Tag Cloud">
|
||||
{% for s in top_subjects %}
|
||||
{# font-size from 14px up to 32px based on weight #}
|
||||
<a
|
||||
class="tag"
|
||||
href="{% url 'search' %}?q={{ s.name|urlencode }}&subject=on"
|
||||
title="{{ s.name }} ({{ s.count }})"
|
||||
style="font-size: calc(14px + ({{ s.count }} / {{ maxc }}) * 18px);
|
||||
opacity: calc(.6 + ({{ s.count }} / {{ maxc }}) * .4);"
|
||||
style="
|
||||
/* Size: 12px → 40px */
|
||||
font-size: calc(12px + ({{ s.count }} / {{ maxc }}) * 28px);
|
||||
/* Weight: 350 → 800 */
|
||||
font-weight: calc(350 + ({{ s.count }} / {{ maxc }}) * 450);
|
||||
/* Color: darker as frequency rises */
|
||||
color: rgba(31, 41, 55, calc(.45 + ({{ s.count }} / {{ maxc }}) * .55));
|
||||
"
|
||||
>
|
||||
{{ s.name }}
|
||||
</a>
|
||||
@ -105,25 +109,20 @@
|
||||
.tag-cloud{
|
||||
display:flex;
|
||||
flex-wrap:wrap;
|
||||
gap:10px 14px;
|
||||
gap:12px 18px;
|
||||
margin-top:10px;
|
||||
align-items:flex-end;
|
||||
}
|
||||
.tag{
|
||||
line-height:1.1;
|
||||
padding:6px 10px;
|
||||
border-radius:12px;
|
||||
text-decoration:none;
|
||||
color:#0f172a;
|
||||
background:#eef5fc;
|
||||
border:1px solid #d7e6f7;
|
||||
transition: transform .1s ease, background .12s ease, border-color .12s ease;
|
||||
white-space:nowrap;
|
||||
transition: transform .12s ease, text-decoration-color .12s ease, color .12s ease;
|
||||
text-underline-offset: 3px;
|
||||
}
|
||||
.tag:hover{
|
||||
transform: translateY(-1px);
|
||||
background:#e2effc;
|
||||
border-color:#c9def5;
|
||||
transform: translateY(-2px);
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
Loading…
Reference in New Issue
Block a user