diff --git a/vault-custom.js b/vault-custom.js index 9217c2f..9874426 100644 --- a/vault-custom.js +++ b/vault-custom.js @@ -7,8 +7,14 @@ * 1. Current-page highlighting in 3D Graph * 2. Click-to-navigate on 3D Graph nodes (Three.js raycasting) * 3. Responsive layout (graph collapses below 1024px, tree below 768px) + * 4. URL-based navigation (?file=) * * Design notes: see docs/ARCHITECTURE.md + * + * IMPORTANT: This script runs AFTER obv's main script (which sets up the + * layout). So our responsiveLayout() needs to apply classes/styles AFTER + * obv's setup, and our CSS must win the specificity battle against obv's + * inline styles + media queries. */ (function() { 'use strict'; @@ -18,60 +24,239 @@ const HermesCustom = window.HermesCustom; // ============================================================ - // 1. Current-page highlighting + // Configuration + // ============================================================ + + const BREAKPOINTS = { + mobile: 768, // <768px + tablet: 1024, // 768-1023px + }; + + // ============================================================ + // 1. CSS injection — high specificity to win against obv // ============================================================ /** - * Determine which file is currently being viewed. - * Uses URL ?file= parameter, or falls back to extracting from the - * page content (the last file fetched via loadFile). + * Inject responsive CSS into as a stylesheet (not