PageSourceSearch

https://waste-land.vercel.app/js/completion.js

js waste-land.vercel.app collected 2026-10-03 08:01:17 UTC 1,449 bytes, 34 lines download raw bytes

1import { cards } from './content.js';
2import { getCount } from './state.js';
3
4const FLAG = 'wasteland-v2-completed';
5
6export function checkCompletion() {
7  if (getCount() < cards.length) return;
8  if (localStorage.getItem(FLAG)) return;
9  localStorage.setItem(FLAG, '1');
10  showCompletionOverlay();
11}
12
13export function showCompletionOverlay() {
14  if (document.querySelector('.complete-overlay')) return;
15
16  const overlay = document.createElement('div');
17  overlay.className = 'complete-overlay';
18  overlay.innerHTML = `
19    <div class="co-mark">&#10022;</div>
20    <h2>Поэма собрана целиком</h2>
21    <p>Все ${cards.length} смыслов раскрыты. Обломки сложились в целое: пять глав, десятки голосов, мифы и города — от Кумской Сивиллы до грома над Гангом. «Этими обломками я подпёр свои руины».</p>
22    <div class="co-actions">
23      <a class="co-btn" href="collection.html">Открыть коллекцию</a>
24      <button class="co-btn" type="button" data-close>Вернуться к чтению</button>
25    </div>
26  `;
27  document.body.appendChild(overlay);
28  requestAnimationFrame(() => overlay.classList.add('active'));
29
30  overlay.querySelector('[data-close]').addEventListener('click', () => {
31    overlay.classList.remove('active');
32    setTimeout(() => overlay.remove(), 800);
33  });
34}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.