v4: аналитика — счётчик просмотров + Яндекс.Метрика

This commit is contained in:
Dauren777 2026-06-19 06:53:54 +00:00
parent 2680a7fa62
commit c1ff23caa6

View File

@ -116,6 +116,7 @@ body{font:17px/1.6 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,s
/* Footer */
.footer{background:var(--gray-100);text-align:center;padding:32px 24px;font-size:14px;color:var(--gray-500)}
.counter{display:inline-flex;align-items:center;gap:6px;margin-top:8px;font-size:13px;color:var(--gray-500)}
@media (max-width:900px){
.hero .container{grid-template-columns:1fr;gap:40px;padding:60px 24px}
@ -135,7 +136,11 @@ body{font:17px/1.6 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,s
.cta-buttons{flex-direction:column}
.cta-buttons .btn-primary,.cta-buttons .btn-secondary{width:100%;justify-content:center}
}
/* Yandex.Metrica — замени ID на свой */
</style>
<!-- Yandex.Metrica -->
<script>(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};m[i].l=1*new Date();for(var j=0;j<document.scripts.length;j++){if(document.scripts[j].src===r)return;}k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})(window,document,"script","https://mc.yandex.ru/metrika/tag.js","ym");ym(XXXXXXXX,"init",{clickmap:true,trackLinks:true,accurateTrackBounce:true});</script>
<noscript><div><img src="https://mc.yandex.ru/watch/XXXXXXXX" style="position:absolute;left:-9999px" alt=""></div></noscript>
</head>
<body>
@ -328,6 +333,7 @@ body{font:17px/1.6 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,s
<footer class="footer">
<p>© 2026 AssistHR — виртуальный помощник по обучению и развитию</p>
<span class="counter">👁️ Просмотров: <span id="viewCount">...</span></span>
</footer>
<script>
@ -336,6 +342,25 @@ document.querySelectorAll('.faq-q').forEach(q => {
q.parentElement.classList.toggle('open')
})
})
;(async () => {
try {
const key = 'assisthr_training_rules'
let count = localStorage.getItem(key)
if (!count) {
const r = await fetch('https://api.countapi.xyz/hit/vibe42/training-rules')
const d = await r.json()
count = d.value
} else {
const r = await fetch('https://api.countapi.xyz/get/vibe42/training-rules')
const d = await r.json()
count = d.value
}
document.getElementById('viewCount').textContent = count.toLocaleString()
} catch {
document.getElementById('viewCount').textContent = '—'
}
})()
</script>
</body>
</html>