summaryrefslogtreecommitdiffstats
path: root/assets/js/filters.js
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-10 11:29:00 +0200
committerDanilo M. <danix@danix.xyz>2026-04-10 11:29:00 +0200
commitc42150058196f5affad5c6c590e99dd2fc7321c3 (patch)
treecb0a7ad297128a43d32111e403959491573b6ace /assets/js/filters.js
parentd51e4ef7dcd8609cd008a803f9d51674ac3d3ed2 (diff)
downloaddanixxyz-theme-c42150058196f5affad5c6c590e99dd2fc7321c3.tar.gz
danixxyz-theme-c42150058196f5affad5c6c590e99dd2fc7321c3.zip
feat: complete Hugo theme implementation from mockups
Transform all production-ready mockup files into a fully functional Hugo theme with all design patterns, components, and interactivity. Implements the complete plan: token alignment, global shell, homepage, articles section, single article views, photo gallery, static pages, and 404 page. Changes: - Phase 0: Token alignment (--color-* → --type-*, add spacing/z-index/timing scales) - Phase 1a: Global shell (baseof.html, hamburger menu, theme toggle, matrix rain) - Phase 1b: Homepage (hero layout, glitch/typing/scroll-reveal effects) - Phase 1c: Articles section (timeline layout, filter system, featured cards) - Phase 1d: Single article (meta bar, share sidebar, footer nav, progress bar) - Phase 1e: Photo gallery (lightbox, grid layout, shortcode updates) - Phase 1f: Static pages (about/contact page layout) - Phase 1g: 404 page (standalone HTML, quote randomization, recent articles) New files: - 6 CSS components: hamburger, article-hero, share-sidebar, timeline, lightbox, 404 - 8 JS modules: hamburger, glitch, typing, scroll-reveal, share-sidebar, lightbox, 404, photo-utils - 6 template partials: article-single, featured-card, photo-article, share-sidebar, static-page, timeline-item - 1 layout: 404.html (standalone) Updated: - All CSS variables with comprehensive token system - All JS modules integrated into main.js - All shortcodes (gallery, gal-img) for lightbox compatibility - All layout files (baseof, home, section, page) with new dispatching logic Verified: Hugo build succeeds with 21 pages, no errors. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Diffstat (limited to 'assets/js/filters.js')
-rw-r--r--assets/js/filters.js45
1 files changed, 27 insertions, 18 deletions
diff --git a/assets/js/filters.js b/assets/js/filters.js
index 64d9c57..f7fa6a6 100644
--- a/assets/js/filters.js
+++ b/assets/js/filters.js
@@ -1,28 +1,37 @@
-// filters.js
+/**
+ * filters.js
+ * Article filtering by type on the articles page
+ */
+
(function() {
- const filterBtns = document.querySelectorAll('.filter-btn');
- const feedList = document.getElementById('articles-feed');
- const cards = feedList ? feedList.querySelectorAll('.post-card') : [];
+ 'use strict';
- if (!filterBtns.length || !cards.length) return;
+ const filterBtns = document.querySelectorAll('.filter-btn');
+ const timelineItems = document.querySelectorAll('.timeline-item');
- filterBtns.forEach(btn => {
- btn.addEventListener('click', function() {
- const filter = this.dataset.filter;
+ filterBtns.forEach((btn) => {
+ btn.addEventListener('click', () => {
+ const filter = btn.getAttribute('data-filter');
// Update active button
- filterBtns.forEach(b => b.classList.remove('active'));
- this.classList.add('active');
+ filterBtns.forEach((b) => b.classList.remove('active'));
+ btn.classList.add('active');
- // Filter cards
- cards.forEach(card => {
- const cardType = card.querySelector('.post-type-badge')?.classList[1];
- const matches = filter === 'all' || cardType === filter;
- card.style.display = matches ? '' : 'none';
- });
+ // Filter articles
+ timelineItems.forEach((item) => {
+ const type = item.getAttribute('data-type');
- // Scroll to top
- window.scrollTo({ top: 0, behavior: 'smooth' });
+ if (filter === 'all' || type === filter) {
+ item.classList.add('visible');
+ } else {
+ item.classList.remove('visible');
+ }
+ });
});
});
+
+ // Show all on load
+ timelineItems.forEach((item) => {
+ item.classList.add('visible');
+ });
})();