File size: 6,555 Bytes
7f8e190 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | {# Pieces shared by more than one captured family layout. Icons are authored
here as inline SVG; nothing is fetched from a remote origin. #}
{% macro icon_library() %}
<svg viewBox="0 0 20 20" width="20" height="20" aria-hidden="true" focusable="false">
<rect x="2.5" y="3" width="4" height="14" rx="1" fill="none" stroke="currentColor" stroke-width="1.4"/>
<rect x="8" y="3" width="4" height="14" rx="1" fill="none" stroke="currentColor" stroke-width="1.4"/>
<path d="m13.8 4.4 3.1.8-2.6 12-3.1-.8Z" fill="none" stroke="currentColor" stroke-width="1.4"/>
</svg>
{% endmacro %}
{% macro icon_quest() %}
<svg viewBox="0 0 20 20" width="20" height="20" aria-hidden="true" focusable="false">
<path d="M3 3h3l8.5 8.5M17 3h-3L5.5 11.5" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
<path d="m3 17 3.5-3.5M17 17l-3.5-3.5" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
</svg>
{% endmacro %}
{% macro icon_explore() %}
<svg viewBox="0 0 20 20" width="20" height="20" aria-hidden="true" focusable="false">
<path d="M3 4.5A2 2 0 0 1 5 3h4v14H5a2 2 0 0 0-2 1.5Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/>
<path d="M17 4.5A2 2 0 0 0 15 3h-4v14h4a2 2 0 0 1 2 1.5Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/>
</svg>
{% endmacro %}
{% macro icon_plan() %}
<svg viewBox="0 0 20 20" width="20" height="20" aria-hidden="true" focusable="false">
<path d="m10 4 8 3.5-8 3.5-8-3.5Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/>
<path d="M5 9.5V14c0 1.4 2.2 2.5 5 2.5s5-1.1 5-2.5V9.5" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
</svg>
{% endmacro %}
{% macro icon_search(size=16) %}
<svg viewBox="0 0 16 16" width="{{ size }}" height="{{ size }}" aria-hidden="true" focusable="false">
<circle cx="7" cy="7" r="5" fill="none" stroke="currentColor" stroke-width="1.6"/>
<path d="m11 11 3.4 3.4" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
</svg>
{% endmacro %}
{% macro icon_arrow_right() %}
<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" focusable="false">
<path d="M2.5 8h11m-4-4 4 4-4 4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
{% endmacro %}
{% macro icon_play() %}
<svg viewBox="0 0 12 12" width="12" height="12" aria-hidden="true" focusable="false">
<path d="M3 2.2 10 6l-7 3.8Z" fill="currentColor"/>
</svg>
{% endmacro %}
{% macro icon_bolt() %}
<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true" focusable="false">
<path d="M9 1 3.5 9H7l-.8 6L12.5 7H9Z" fill="currentColor"/>
</svg>
{% endmacro %}
{% macro icon_doc() %}
<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true" focusable="false">
<rect x="3" y="1.5" width="10" height="13" rx="1.4" fill="none" stroke="currentColor" stroke-width="1.3"/>
<path d="M5.5 5h5M5.5 8h5M5.5 11h3" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/>
</svg>
{% endmacro %}
{# The frequency column is Premium-gated on the source and printed no values,
so the clone renders the same lock instead of inventing a bar. #}
{% macro freq_lock() %}
<span class="freq-lock" role="img" aria-label="Frequency is a Premium feature">
<span class="freq-lock__bar"></span><span class="freq-lock__bar"></span>
<svg viewBox="0 0 12 12" width="11" height="11" aria-hidden="true" focusable="false"><rect x="2" y="5" width="8" height="6" rx="1.4" fill="currentColor"/><path d="M4 5V3.6a2 2 0 0 1 4 0V5" fill="none" stroke="currentColor" stroke-width="1.3"/></svg>
<span class="freq-lock__bar"></span><span class="freq-lock__bar"></span>
</span>
{% endmacro %}
{# Library rail, from company-google-desktop / tag-array-desktop /
studyplan-*-desktop / explore-desktop. Every row is a real local route. #}
{% macro rail(member, active='') %}
<aside class="lc-rail" aria-label="Library">
<button class="lc-rail__toggle" type="button" data-rail-toggle aria-expanded="true" aria-label="Collapse library sidebar">
<span aria-hidden="true">‹</span>
</button>
<nav class="lc-rail__nav">
<a class="lc-rail__link{% if active == 'library' %} is-active{% endif %}" href="/problem-list/">{{ icon_library() }}<span class="lc-rail__label">Library</span></a>
<a class="lc-rail__link{% if active == 'quest' %} is-active{% endif %}" href="/quest/">{{ icon_quest() }}<span class="lc-rail__label">Quest</span></a>
<a class="lc-rail__link{% if active == 'explore' %} is-active{% endif %}" href="/explore/">{{ icon_explore() }}<span class="lc-rail__label">Explore</span></a>
<a class="lc-rail__link{% if active == 'studyplan' %} is-active{% endif %}" href="/studyplan/">{{ icon_plan() }}<span class="lc-rail__label">Study Plan</span></a>
</nav>
<div class="lc-rail__cta">
{% if member %}
<p class="lc-rail__note">Signed in as {{ member.username }}. Lists and study progress are tracked locally.</p>
<a class="lc-rail__button" href="/progress/">My progress</a>
{% else %}
<p class="lc-rail__note">Sign in to view lists and track study progress.</p>
<a class="lc-rail__button" href="/accounts/login/">Sign in</a>
{% endif %}
</div>
</aside>
{% endmacro %}
{% macro boundary(text) %}
{% if text %}<p class="lc-boundary" role="note">{{ text }}</p>{% endif %}
{% endmacro %}
{% macro provenance(text) %}
<p class="lc-provenance">{{ text|default('Every source figure on this page comes from the Playwright capture; every list below it is this clone\'s own local data.') }}</p>
{% endmacro %}
{% macro stats(items) %}
{% if items %}
<dl class="lc-stats">
{% for item in items %}
<div class="lc-stat"><dt>{{ item.label }}</dt><dd>{{ item.value }}</dd></div>
{% endfor %}
</dl>
{% endif %}
{% endmacro %}
{# One question row in the captured list shape: title, acceptance, difficulty,
locked frequency. #}
{% macro question_rows(rows) %}
<ul class="lc-qlist">
{% for row in rows %}
<li class="lc-qrow">
<a href="{{ row.href }}">
<span class="lc-qrow__title">{{ row.number }}. {{ row.title }}{% if row.premium_locked %} <span class="lc-badge">Premium</span>{% endif %}</span>
<span class="lc-qrow__acc">{{ '%.1f'|format(row.acceptance) }}%</span>
<span class="lc-qrow__diff lc-qrow__diff--{{ row.difficulty|lower }}">{{ row.difficulty_label }}</span>
<span class="lc-qrow__freq">{{ freq_lock() }}</span>
</a>
</li>
{% endfor %}
</ul>
{% endmacro %}
|