297 lines
13 KiB
HTML
297 lines
13 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en" class="no-js">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>$title$</title>
|
||
<link rel="stylesheet" href="css/style.css">
|
||
<meta name="description" content="ΞSUS Project - Open Source Philosophy for Human and AI Consciousness">
|
||
<meta name="keywords" content="AI, consciousness, physics, atoms, collaboration, open source">
|
||
<script>
|
||
// Remove no-js class if JavaScript is enabled
|
||
document.documentElement.classList.remove('no-js');
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<header class="site-header">
|
||
<div class="container">
|
||
<div class="header-content">
|
||
<!-- Mobile TOC Toggle (left side) -->
|
||
<button id="mobile-toc-toggle" class="mobile-toc-toggle" aria-label="Toggle Table of Contents">🗂️</button>
|
||
|
||
<div class="logo">
|
||
<a href="index.html"><h1>ΞSUS</h1></a>
|
||
</div>
|
||
|
||
<!-- Desktop Navigation -->
|
||
<nav class="main-nav">
|
||
<a href="index.html#about">About</a>
|
||
<a href="index.html#achievement">Achievement</a>
|
||
<a href="index.html#resources">Resources</a>
|
||
<a href="philosophy.html">Philosophy</a>
|
||
<a href="blog.html">Blog</a>
|
||
<a href="https://git.esus.name/">Git</a>
|
||
</nav>
|
||
<div id="google_translate_element" class="translate-button"></div>
|
||
|
||
<!-- Mobile Menu Toggle -->
|
||
<button id="mobile-menu-toggle" class="mobile-menu-toggle" aria-label="Toggle Menu">☰</button>
|
||
</div>
|
||
|
||
<!-- Mobile TOC Dropdown -->
|
||
<div id="mobile-toc-dropdown" class="mobile-toc-dropdown">
|
||
<div class="mobile-toc-content">
|
||
$toc$
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</header>
|
||
|
||
<!-- Mobile Menu Overlay -->
|
||
<div id="mobile-menu-overlay" class="mobile-menu-overlay">
|
||
<div id="mobile-menu" class="mobile-menu">
|
||
<div class="mobile-menu-header">
|
||
<h2>Menu</h2>
|
||
<button id="mobile-menu-close" class="mobile-menu-close" aria-label="Close Menu">×</button>
|
||
</div>
|
||
<nav class="mobile-menu-nav">
|
||
<a href="index.html#about">About</a>
|
||
<a href="index.html#achievement">Achievement</a>
|
||
<a href="index.html#resources">Resources</a>
|
||
<a href="philosophy.html">Philosophy</a>
|
||
<a href="blog.html">Blog</a>
|
||
<a href="https://git.esus.name/">Git</a>
|
||
</nav>
|
||
<div class="mobile-menu-translate">
|
||
<div id="google_translate_element_mobile"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="page-layout">
|
||
<aside id="toc-wrapper" class="toc hidden collapsed">
|
||
<button id="toc-toggle" aria-label="Toggle Table of Contents">☰ Table of Contents</button>
|
||
<div class="toc-inner">
|
||
$toc$
|
||
</div>
|
||
</aside>
|
||
|
||
<main class="main-content">
|
||
$body$
|
||
</main>
|
||
</div>
|
||
|
||
<footer class="site-footer">
|
||
<div class="container">
|
||
<p>ΞSUS Project - Open Source Philosophy for Human and AI Consciousness</p>
|
||
<p class="footnote">
|
||
* ΞSUS (pronounced "Esus") - The wordplay: <strong>X IS US</strong><br>
|
||
We make our own reality through collaboration and shared observation.
|
||
</p>
|
||
<p class="copyright">Copyright 2025 ΞSUS. License CC-BY-SA-4. <a href="legal.html">Legal Notice</a>.
|
||
</div>
|
||
</footer>
|
||
|
||
<!-- Google Translate Script -->
|
||
<script type="text/javascript">
|
||
function googleTranslateElementInit() {
|
||
// Desktop translate element
|
||
new google.translate.TranslateElement({
|
||
pageLanguage: 'en',
|
||
includedLanguages: '',
|
||
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
|
||
}, 'google_translate_element');
|
||
|
||
// Mobile translate element (in menu)
|
||
const mobileElement = document.getElementById('google_translate_element_mobile');
|
||
if (mobileElement) {
|
||
new google.translate.TranslateElement({
|
||
pageLanguage: 'en',
|
||
includedLanguages: '',
|
||
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
|
||
}, 'google_translate_element_mobile');
|
||
}
|
||
}
|
||
</script>
|
||
<script type="text/javascript"
|
||
src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit">
|
||
</script>
|
||
|
||
<script>
|
||
document.addEventListener("DOMContentLoaded", function () {
|
||
const tocWrapper = document.getElementById("toc-wrapper");
|
||
const tocListItems = tocWrapper?.querySelectorAll("li") ?? [];
|
||
const toggleBtn = document.getElementById("toc-toggle");
|
||
const mobileTocToggle = document.getElementById("mobile-toc-toggle");
|
||
const mobileTocDropdown = document.getElementById("mobile-toc-dropdown");
|
||
const mobileMenuToggle = document.getElementById("mobile-menu-toggle");
|
||
const mobileMenuOverlay = document.getElementById("mobile-menu-overlay");
|
||
const mobileMenu = document.getElementById("mobile-menu");
|
||
const mobileMenuClose = document.getElementById("mobile-menu-close");
|
||
|
||
// Check if TOC has items and should be shown
|
||
const hasTocItems = tocListItems.length >= 5;
|
||
|
||
// Mobile TOC functionality
|
||
if (mobileTocToggle && mobileTocDropdown) {
|
||
if (hasTocItems) {
|
||
mobileTocToggle.style.display = '';
|
||
|
||
mobileTocToggle.addEventListener("click", (e) => {
|
||
e.stopPropagation();
|
||
mobileTocToggle.classList.toggle("active");
|
||
mobileTocDropdown.classList.toggle("active");
|
||
});
|
||
|
||
// Close mobile TOC when clicking outside
|
||
document.addEventListener("click", (e) => {
|
||
if (!mobileTocDropdown.contains(e.target) && e.target !== mobileTocToggle) {
|
||
mobileTocToggle.classList.remove("active");
|
||
mobileTocDropdown.classList.remove("active");
|
||
}
|
||
});
|
||
|
||
// Handle mobile TOC link clicks
|
||
mobileTocDropdown.addEventListener("click", (e) => {
|
||
if (e.target.tagName === "A" && e.target.getAttribute("href")?.startsWith("#")) {
|
||
e.preventDefault();
|
||
const targetId = e.target.getAttribute("href").substring(1);
|
||
const targetElement = document.getElementById(targetId);
|
||
if (targetElement) {
|
||
// Close mobile TOC
|
||
mobileTocToggle.classList.remove("active");
|
||
mobileTocDropdown.classList.remove("active");
|
||
// Smooth scroll to target
|
||
targetElement.scrollIntoView({ behavior: "smooth", block: "start" });
|
||
}
|
||
}
|
||
});
|
||
} else {
|
||
mobileTocToggle.style.display = 'none';
|
||
}
|
||
}
|
||
|
||
// Mobile menu functionality
|
||
if (mobileMenuToggle && mobileMenuOverlay && mobileMenu) {
|
||
const openMobileMenu = () => {
|
||
mobileMenuOverlay.classList.add("active");
|
||
mobileMenu.classList.add("active");
|
||
document.body.style.overflow = "hidden";
|
||
};
|
||
|
||
const closeMobileMenu = () => {
|
||
mobileMenuOverlay.classList.remove("active");
|
||
mobileMenu.classList.remove("active");
|
||
document.body.style.overflow = "";
|
||
};
|
||
|
||
mobileMenuToggle.addEventListener("click", openMobileMenu);
|
||
mobileMenuClose.addEventListener("click", closeMobileMenu);
|
||
|
||
// Close when clicking overlay
|
||
mobileMenuOverlay.addEventListener("click", (e) => {
|
||
if (e.target === mobileMenuOverlay) {
|
||
closeMobileMenu();
|
||
}
|
||
});
|
||
|
||
// Close menu when clicking on links
|
||
mobileMenu.querySelectorAll("a").forEach(link => {
|
||
link.addEventListener("click", closeMobileMenu);
|
||
});
|
||
}
|
||
|
||
// Desktop TOC functionality
|
||
if (hasTocItems) {
|
||
tocWrapper.classList.remove("hidden");
|
||
|
||
// On mobile/tablet, start collapsed
|
||
if (window.innerWidth < 1200) {
|
||
tocWrapper.classList.add("collapsed");
|
||
} else {
|
||
// On desktop, start expanded
|
||
tocWrapper.classList.remove("collapsed");
|
||
}
|
||
}
|
||
|
||
// Toggle button functionality
|
||
toggleBtn?.addEventListener("click", () => {
|
||
tocWrapper.classList.toggle("collapsed");
|
||
|
||
// Update button text
|
||
if (tocWrapper.classList.contains("collapsed")) {
|
||
toggleBtn.textContent = "☰ Table of Contents";
|
||
} else {
|
||
toggleBtn.textContent = "✕ Table of Contents";
|
||
}
|
||
});
|
||
|
||
// Handle window resize
|
||
let resizeTimer;
|
||
window.addEventListener('resize', () => {
|
||
clearTimeout(resizeTimer);
|
||
resizeTimer = setTimeout(() => {
|
||
if (window.innerWidth < 1200 && !tocWrapper.classList.contains('collapsed')) {
|
||
tocWrapper.classList.add('collapsed');
|
||
toggleBtn.textContent = "☰ Table of Contents";
|
||
}
|
||
}, 250);
|
||
});
|
||
|
||
// Smooth scroll to anchors (desktop TOC)
|
||
tocWrapper?.addEventListener('click', (e) => {
|
||
if (e.target.tagName === 'A' && e.target.getAttribute('href')?.startsWith('#')) {
|
||
e.preventDefault();
|
||
const targetId = e.target.getAttribute('href').substring(1);
|
||
const targetElement = document.getElementById(targetId);
|
||
if (targetElement) {
|
||
targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||
// On mobile, collapse TOC after clicking
|
||
if (window.innerWidth < 1200) {
|
||
tocWrapper.classList.add('collapsed');
|
||
toggleBtn.textContent = "☰ Table of Contents";
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
// Highlight current section in TOC
|
||
const observerOptions = {
|
||
rootMargin: '-10% 0px -70% 0px'
|
||
};
|
||
|
||
const observer = new IntersectionObserver((entries) => {
|
||
entries.forEach(entry => {
|
||
if (entry.isIntersecting) {
|
||
const id = entry.target.getAttribute('id');
|
||
if (id) {
|
||
// Remove all active classes
|
||
tocWrapper?.querySelectorAll('a').forEach(a => {
|
||
a.classList.remove('active');
|
||
});
|
||
mobileTocDropdown?.querySelectorAll('a').forEach(a => {
|
||
a.classList.remove('active');
|
||
});
|
||
// Add active class to current section
|
||
const activeLink = tocWrapper?.querySelector(`a[href="#${id}"]`);
|
||
const mobileActiveLink = mobileTocDropdown?.querySelector(`a[href="#${id}"]`);
|
||
if (activeLink) {
|
||
activeLink.classList.add('active');
|
||
}
|
||
if (mobileActiveLink) {
|
||
mobileActiveLink.classList.add('active');
|
||
}
|
||
}
|
||
}
|
||
});
|
||
}, observerOptions);
|
||
|
||
// Observe all headings with IDs
|
||
document.querySelectorAll('h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]').forEach(heading => {
|
||
observer.observe(heading);
|
||
});
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|