initial commit

This commit is contained in:
2026-07-14 22:02:24 +03:00
parent a80849829a
commit 6453730766
2783 changed files with 6055 additions and 238 deletions
+70
View File
@@ -0,0 +1,70 @@
(function () {
var root = document.documentElement;
var stored = localStorage.getItem('theme');
var isLight = stored ? stored === 'light' : false;
root.classList.toggle('lm', isLight);
function syncThemeIcons() {
document.querySelectorAll('[data-theme-icon="sun"]').forEach(function (el) {
el.style.display = isLight ? 'inline' : 'none';
});
document.querySelectorAll('[data-theme-icon="moon"]').forEach(function (el) {
el.style.display = isLight ? 'none' : 'inline';
});
}
function toggleTheme() {
isLight = !isLight;
root.classList.toggle('lm', isLight);
localStorage.setItem('theme', isLight ? 'light' : 'dark');
syncThemeIcons();
}
document.querySelectorAll('[data-theme-toggle]').forEach(function (btn) {
btn.addEventListener('click', toggleTheme);
});
syncThemeIcons();
var nav = document.getElementById('site-nav');
if (nav) {
var onScroll = function () {
nav.classList.toggle('scrolled', window.scrollY > 40);
};
window.addEventListener('scroll', onScroll);
onScroll();
}
var mobileMenu = document.getElementById('mobile-menu');
var mobileToggle = document.getElementById('mobile-menu-toggle');
if (mobileMenu && mobileToggle) {
var open = false;
var setOpen = function (next) {
open = next;
mobileMenu.classList.toggle('open', open);
var barIcon = mobileToggle.querySelector('[data-icon="bars"]');
var xIcon = mobileToggle.querySelector('[data-icon="xmark"]');
if (barIcon) barIcon.style.display = open ? 'none' : 'inline';
if (xIcon) xIcon.style.display = open ? 'inline' : 'none';
};
mobileToggle.addEventListener('click', function () {
setOpen(!open);
});
mobileMenu.querySelectorAll('a').forEach(function (link) {
link.addEventListener('click', function () {
setOpen(false);
});
});
}
var revealObserver = new IntersectionObserver(
function (entries) {
entries.forEach(function (entry) {
if (entry.isIntersecting) entry.target.classList.add('is-in');
});
},
{ threshold: 0.1, rootMargin: '0px 0px -40px 0px' }
);
document.querySelectorAll('.reveal').forEach(function (el) {
revealObserver.observe(el);
});
})();