Keep Yandex Metrica in the code, dormant behind HM_YM_ID

- Restore analytics.js, the counter id and the consent banner. The banner
  renders and the "Cookie" reset button exists only when HM_YM_ID is non-zero;
  at 0 the node is removed and no request reaches mc.yandex.ru.
- Release state stays data-free (verified headless): id 0, banner absent,
  0 requests to Yandex, 0 external hosts. With an id set, the banner appears,
  and tag.js loads only after "Принять".
- check-release now fails on a non-zero counter instead of banning the code,
  so the gate protects the release state, not the implementation.
- privacy.html says the counter exists but is not activated; ads-readiness
  section 3 is the enable procedure (id + RKN notice + policy paragraph).
This commit is contained in:
FastD committed 2026-11-15 17:45:13 +03:00
1 parent 0ac596086a
commit a013db4c5b
9 files changed
+174 -19

No files matched your search

+27
View File
@@ -23,6 +23,10 @@
<meta property="og:image:alt" content="Harvey Monster Team — игры и сервисы под ключ">
<meta name="twitter:card" content="summary_large_image">
<!-- Яндекс.Метрика: номер счётчика. 0 = счётчик не подключён (ни одного запроса).
Включение = номер + уведомление РКН + политика; cookie-баннер появится сам. -->
<script>window.HM_YM_ID = 0;</script>
<!-- Theme: no-FOUC — apply saved theme BEFORE first paint (default = light, D7/D12) -->
<script>(function(){try{if(localStorage.getItem('hm-theme')==='dark')document.documentElement.setAttribute('data-theme','dark');}catch(e){}})();</script>
@@ -658,6 +662,14 @@
.contact-card__hint a{color:var(--brand-deep);text-decoration:underline}
.contact-card__hint a:focus-visible{outline:2px solid var(--brand-deep);outline-offset:2px;border-radius:2px}
.cookie{position:fixed;left:0;right:0;bottom:0;z-index:60;display:flex;gap:16px;flex-wrap:wrap;
align-items:center;justify-content:space-between;padding:14px 24px;background:var(--card);
border-top:1px solid var(--hairline);box-shadow:var(--shadow-nav)}
.cookie[hidden]{display:none}
.cookie__text{margin:0;font-size:14px;color:var(--text-2);max-width:72ch}
.cookie__actions{display:flex;gap:10px;flex-wrap:wrap}
.cookie .btn{min-height:44px;padding:10px 18px}
/* ===== Footer ===== */
.footer{background:var(--card);border-top:1px solid var(--hairline);box-shadow:var(--shadow-rest)}
.footer__inner{display:flex;justify-content:space-between;align-items:center;gap:16px;
@@ -670,6 +682,10 @@
.footer__slogan{color:var(--text-2);font-size:14px}
.footer__links{display:flex;flex-wrap:wrap;gap:6px 18px;align-items:center}
.footer__link{color:var(--text-2);font-size:14px}
/* Кнопка «Cookie» в футере: сбрасывает выбор аналитики, поэтому это button, а не ссылка. */
.footer__reset{background:none;border:0;padding:2px 0;font-family:var(--font-body);cursor:pointer}
.footer__reset:hover{color:var(--brand-deep)}
.footer__reset:focus-visible{outline:2px solid var(--brand-deep);outline-offset:2px;border-radius:4px}
.footer__link:hover{color:var(--brand-deep)}
.footer__link:focus-visible{outline:2px solid var(--brand-deep);outline-offset:2px;border-radius:4px}
@@ -1409,6 +1425,15 @@
</div>
</dialog>
<!-- ============ Cookie-баннер (п.14 правок 2026-10-12) ============ -->
<div class="cookie" id="cookie-bar" hidden role="region" aria-label="Использование cookie">
<p class="cookie__text">Необходимые cookie нужны, чтобы сайт работал корректно. Аналитические cookie (Яндекс.Метрика) включаем только с вашего согласия — подробнее в <a href="privacy.html">политике конфиденциальности</a>.</p>
<div class="cookie__actions">
<button class="btn btn--primary" type="button" id="cookie-accept">Принять</button>
<button class="btn btn--ghost" type="button" id="cookie-only-necessary">Только необходимые</button>
</div>
</div>
<!-- ============ Footer ============ -->
<footer class="footer">
<div class="footer__inner">
@@ -1418,6 +1443,7 @@
<a class="footer__link" href="https://vk.ru/harveymonsterteam" target="_blank" rel="noopener">VK</a>
<a class="footer__link" href="https://www.rustore.ru/catalog/developer/s7wfth0g" target="_blank" rel="noopener">RuStore</a>
<a class="footer__link" href="privacy.html">Политика конфиденциальности</a>
<button class="footer__link footer__reset" type="button" id="cookie-reset">Cookie</button>
</nav>
<span class="footer__slogan">От прототипа до релиза и поддержки</span>
</div>
@@ -1428,6 +1454,7 @@
без неё вернувшийся посетитель сутки видит старый код. Менять при каждом деплое. -->
<script src="data/projects.js?v=20261115"></script>
<script src="data/team.js?v=20261115"></script>
<script src="js/analytics.js?v=20261115" defer></script>
<script src="js/planet.js?v=20261115" defer></script>
<script src="js/main.js?v=20261115" defer></script>
</body>