Deploy implemented Videoreg interface and persistent theme cycle

This commit is contained in:
huncode committed 2026-10-27 15:49:46 +03:00
1 parent 6405a8d101
commit a12eefa1de
98 files changed
+4094 -2319

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><rect width="16" height="16" fill="#112c43"/><path d="M0 5h1v5H0zM15 5h1v5h-1z" fill="#f9fbfc"/><path d="M2 3h12v9H2z" fill="#f3933d"/><path d="M4 5h8v5H4z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" fill="#112c43"/><path d="M0 11h2v10H0zM30 11h2v10h-2z" fill="#f9fbfc"/><path d="M4 7h24v18H4z" fill="#f3933d"/><path d="M8 11h16v10H8z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><rect width="48" height="48" fill="#112c43"/><path d="M0 16h3v15H0zM45 16h3v15h-3z" fill="#f9fbfc"/><path d="M6 10h36v27H6z" fill="#f3933d"/><path d="M12 16h24v15H12z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><rect width="16" height="16" fill="#112c43"/><path d="M0 5h1v5H0zM15 5h1v5h-1z" fill="#f9fbfc"/><path d="M2 3h12v9H2z" fill="#f3933d"/><path d="M4 5h8v5H4z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" fill="#112c43"/><path d="M0 11h2v10H0zM30 11h2v10h-2z" fill="#f9fbfc"/><path d="M4 7h24v18H4z" fill="#f3933d"/><path d="M8 11h16v10H8z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><rect width="48" height="48" fill="#112c43"/><path d="M0 16h3v15H0zM45 16h3v15h-3z" fill="#f9fbfc"/><path d="M6 10h36v27H6z" fill="#f3933d"/><path d="M12 16h24v15H12z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="275" height="64" viewBox="0 0 275 64" role="img" aria-labelledby="title"><title id="title">Videoreg</title><g transform="translate(0 8) scale(1.5)"><rect width="32" height="32" rx="6" fill="#e9eee5"/><path d="M7 7h18v18H7z" fill="none" stroke="#17382f" stroke-width="2"/><path d="M4 12v16h16" fill="none" stroke="#17382f" stroke-width="2"/><circle cx="21" cy="11" r="2" fill="#9d4820"/></g><text x="64" y="44" fill="#f5f2e9" font-family="Georgia,Times New Roman,serif" font-size="43" font-weight="700" letter-spacing="-1.5">videoreg</text></svg>

After

Width:  |  Height:  |  Size: 592 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="275" height="64" viewBox="0 0 275 64" role="img" aria-labelledby="title"><title id="title">Videoreg</title><g transform="translate(0 8) scale(1.5)"><rect width="32" height="32" rx="6" fill="#17382f"/><path d="M7 7h18v18H7z" fill="none" stroke="#fffef9" stroke-width="2"/><path d="M4 12v16h16" fill="none" stroke="#fffef9" stroke-width="2"/><circle cx="21" cy="11" r="2" fill="#efbf78"/></g><text x="64" y="44" fill="#17382f" font-family="Georgia,Times New Roman,serif" font-size="43" font-weight="700" letter-spacing="-1.5">videoreg</text></svg>

After

Width:  |  Height:  |  Size: 592 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" fill="#112c43"/><path d="M0 11h2v10H0zM30 11h2v10h-2z" fill="#f9fbfc"/><path d="M4 7h24v18H4z" fill="#f3933d"/><path d="M8 11h16v10H8z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 270 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 32 32"><title>Videoreg — кадр СВК</title><rect width="32" height="32" fill="#112c43"/><g transform="translate(4.625 4.625) scale(0.7109375)"><path d="M0 11h2v10H0zM30 11h2v10h-2z" fill="#f9fbfc"/><path d="M4 7h24v18H4z" fill="#f3933d"/><path d="M8 11h16v10H8z" fill="#112c43"/></g></svg>

After

Width:  |  Height:  |  Size: 374 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 32 32"><title>Videoreg — кадр СВК</title><rect width="32" height="32" fill="#112c43"/><g transform="translate(4.625 4.625) scale(0.7109375)"><path d="M0 11h2v10H0zM30 11h2v10h-2z" fill="#f9fbfc"/><path d="M4 7h24v18H4z" fill="#f3933d"/><path d="M8 11h16v10H8z" fill="#112c43"/></g></svg>

After

Width:  |  Height:  |  Size: 374 B

+79
View File
@@ -0,0 +1,79 @@
/* Videoreg analytics: one existing counter, public hosts only, no query payloads. */
(function () {
"use strict";
if (!/^(www\.)?videoreg\.ru$/.test(window.location.hostname) || window.__videoregMetrika) return;
window.__videoregMetrika = true;
var counter = 109268682;
window.ym = window.ym || function () { (window.ym.a = window.ym.a || []).push(arguments); };
window.ym.l = Number(new Date());
var tag = document.createElement("script");
tag.async = true;
tag.src = "https://mc.yandex.ru/metrika/tag.js";
document.head.appendChild(tag);
window.ym(counter, "init", {
webvisor: false, clickmap: true, trackLinks: true,
accurateTrackBounce: true, trackHash: false
});
function goal(name, params) { window.ym(counter, "reachGoal", name, params); }
var problems = new Set();
function problem(kind) {
if (problems.has(kind)) return;
problems.add(kind);
goal("content_problem", { problem: kind });
}
// Only actual, enabled document/ZIP downloads; a click does not imply success.
document.addEventListener("click", function (event) {
var link = event.target instanceof Element ? event.target.closest("a[href]") : null;
if (!link || event.defaultPrevented || link.getAttribute("aria-disabled") === "true") return;
var url = new URL(link.href, window.location.href);
if (url.origin !== window.location.origin) return;
if (/^\/(manuals|download)\//.test(url.pathname) && /\.(pdf|zip)$/i.test(url.pathname)) goal("download_click");
if (link.closest(".related-reading")) goal("related_content_click");
var queryInput = document.querySelector("#library-query");
if (link.closest(".search-results") && queryInput && queryInput.value.trim()) goal("search_used");
});
document.addEventListener("keydown", function (event) {
if (event.key === "Enter" && !event.isComposing && !event.repeat && event.target.id === "library-query" && event.target.value.trim()) goal("search_used");
});
document.addEventListener("videoreg:search-zero-results", function () { goal("search_zero_results"); });
function fragment() {
var id;
try { id = decodeURIComponent(window.location.hash.slice(1).split(":~:")[0]); } catch (_) { return; }
if (id && !document.getElementById(id) && !document.getElementsByName(id).length) problem("missing_fragment");
}
function imageFailed(image) {
if (image instanceof HTMLImageElement && image.closest("main") && image.getAttribute("src")) problem("image_failed");
}
document.addEventListener("error", function (event) { imageFailed(event.target); }, true);
if (document.querySelector("main.not-found")) problem("not_found");
document.querySelectorAll("main img").forEach(function (image) {
if (image.complete && image.naturalWidth === 0) imageFailed(image);
});
if (document.readyState === "complete") fragment();
else window.addEventListener("load", fragment, { once: true });
window.addEventListener("hashchange", fragment);
var article = document.querySelector("article.article-body");
if (!article) return;
var visibleMs = 0, depth = 0, sent = false, last = performance.now();
var active = document.visibilityState === "visible" && document.hasFocus();
function sample() {
var now = performance.now();
var nextActive = document.visibilityState === "visible" && document.hasFocus();
// Conservative cap avoids counting background/throttled gaps as reading.
if (active && nextActive) visibleMs += Math.min(now - last, 1500);
last = now; active = nextActive;
if (nextActive) {
var rect = article.getBoundingClientRect();
if (rect.height > 0) depth = Math.max(depth, Math.min(1, (window.innerHeight - rect.top) / rect.height));
}
if (!sent && visibleMs >= 60000 && depth >= 0.75) {
sent = true; goal("engaged_read"); clearInterval(timer);
}
}
var timer = setInterval(sample, 1000);
window.addEventListener("scroll", sample, { passive: true });
window.addEventListener("focus", sample);
window.addEventListener("blur", sample);
document.addEventListener("visibilitychange", sample);
})();
+39
View File
@@ -0,0 +1,39 @@
/* Blocking, same-origin bootstrap: keep this before body paint. */
(function () {
'use strict';
var key = 'videoreg-theme';
var root = document.documentElement;
var media = typeof window.matchMedia === 'function' ? window.matchMedia('(prefers-color-scheme: dark)') : null;
function valid(value) { return value === 'light' || value === 'dark' || value === 'system'; }
function read() { try { var value = localStorage.getItem(key); return valid(value) ? value : 'system'; } catch (_) { return 'system'; } }
var choice = read();
function apply() {
var resolved = choice === 'system' ? (media && media.matches ? 'dark' : 'light') : choice;
root.dataset.theme = resolved;
root.dataset.themeChoice = choice;
root.style.colorScheme = resolved;
window.dispatchEvent(new CustomEvent('videoreg:theme-change'));
}
window.videoregTheme = {
get: function () { return choice; },
set: function (value) {
if (!valid(value)) return;
choice = value;
try { localStorage.setItem(key, choice); } catch (_) { /* Session choice still works. */ }
apply();
}
};
function osChanged() { if (choice === 'system') apply(); }
if (media) {
if (media.addEventListener) media.addEventListener('change', osChanged);
else if (media.addListener) media.addListener(osChanged);
}
window.addEventListener('storage', function (event) {
if (event.key !== key && event.key !== null) return;
// Ignore sessionStorage events; inaccessible storage must not break rendering.
try { if (event.storageArea && event.storageArea !== localStorage) return; } catch (_) { return; }
choice = read();
apply();
});
apply();
}());