From c42150058196f5affad5c6c590e99dd2fc7321c3 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 10 Apr 2026 11:29:00 +0200 Subject: feat: complete Hugo theme implementation from mockups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- assets/js/share-sidebar.js | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 assets/js/share-sidebar.js (limited to 'assets/js/share-sidebar.js') diff --git a/assets/js/share-sidebar.js b/assets/js/share-sidebar.js new file mode 100644 index 0000000..81e5f6c --- /dev/null +++ b/assets/js/share-sidebar.js @@ -0,0 +1,51 @@ +/** + * share-sidebar.js + * Social sharing sidebar with copy-to-clipboard + */ + +export function initShareSidebar() { + 'use strict'; + + const sidebar = document.getElementById('share-sidebar'); + const copyBtn = document.getElementById('share-copy'); + + if (!sidebar) return; + + // Share button handlers + const shareBtns = sidebar.querySelectorAll('.share-btn[data-platform]'); + shareBtns.forEach((btn) => { + btn.addEventListener('click', () => { + const platform = btn.getAttribute('data-platform'); + const url = sidebar.getAttribute('data-url'); + const title = sidebar.getAttribute('data-title'); + + const shareUrls = { + whatsapp: `https://wa.me/?text=${encodeURIComponent(title + ' ' + url)}`, + telegram: `https://t.me/share/url?url=${encodeURIComponent(url)}&text=${encodeURIComponent(title)}`, + linkedin: `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(url)}`, + twitter: `https://twitter.com/intent/tweet?url=${encodeURIComponent(url)}&text=${encodeURIComponent(title)}`, + facebook: `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(url)}`, + reddit: `https://reddit.com/submit?url=${encodeURIComponent(url)}&title=${encodeURIComponent(title)}`, + email: `mailto:?subject=${encodeURIComponent(title)}&body=${encodeURIComponent(url)}`, + }; + + if (shareUrls[platform]) { + window.open(shareUrls[platform], '_blank'); + } + }); + }); + + // Copy to clipboard + if (copyBtn) { + copyBtn.addEventListener('click', () => { + const url = sidebar.getAttribute('data-url'); + navigator.clipboard.writeText(url).then(() => { + const originalText = copyBtn.innerHTML; + copyBtn.innerHTML = '✓'; + setTimeout(() => { + copyBtn.innerHTML = originalText; + }, 2000); + }); + }); + } +} -- cgit v1.2.3