|
| 1 | +<!-- ============================================================================== |
| 2 | + - File: Primary_Footer.html (Structural Closure & Interaction Hydration) |
| 3 | + - Author: Amey Thakur |
| 4 | + - Profile: https://github.com/Amey-Thakur |
| 5 | + - Repository: https://github.com/Amey-Thakur/Amey-Thakur.github.io |
| 6 | + - Release Date: December 16, 2025 |
| 7 | + - License: MIT License |
| 8 | + - ============================================================================== |
| 9 | + - |
| 10 | + - DESCRIPTION: |
| 11 | + - This partial serves as the site's structural closure. It handles the |
| 12 | + - technical footer content, back-to-top navigational logic, and initializes |
| 13 | + - critical interactive scripts such as theme-switching and code-copying. |
| 14 | + - |
| 15 | + - HOW IT WORKS: |
| 16 | + - The component injects authorship metadata and dynamic copyright dates. It |
| 17 | + - utilizes native browser APIs (localStorage, matchMedia) to reconcile user |
| 18 | + - preferences and provides smooth-scroll behaviors for site-wide anchors. |
| 19 | + - It also integrates custom audio feedback for thematic transitions. |
| 20 | + - |
| 21 | + - TECH STACK: |
| 22 | + - - Hugo Template Logic |
| 23 | + - - Web APIs (Web Audio, View Transitions) |
| 24 | + - - Client-side Interaction Logic (Vanilla JS) |
| 25 | + - |
| 26 | + - ============================================================================== --> |
| 27 | + |
1 | 28 | {{- if not (.Param "hideFooter") }} |
2 | 29 | <footer class="footer"> |
3 | 30 | <span> |
| 31 | + {{- /* Technical Authorship & Repository Mapping */ -}} |
4 | 32 | © 2025-{{ now.Year }} <a href="https://github.com/Amey-Thakur/Amey-Thakur.github.io" |
5 | 33 | rel="noopener noreferrer" target="_blank">Amey’s Arc</a> · Authored by <a |
6 | 34 | href="https://github.com/Amey-Thakur" rel="noopener noreferrer" target="_blank">Amey Thakur</a> |
7 | 35 | </span> |
8 | 36 | </footer> |
9 | 37 | {{- end }} |
10 | 38 |
|
| 39 | +{{- /* Navigational Anchor: Return to root top. */ -}} |
11 | 40 | {{- if (not site.Params.disableScrollToTop) }} |
12 | 41 | <a href="#top" aria-label="go to top" title="Go to Top (Alt + G)" class="top-link" id="top-link" accesskey="g"> |
13 | 42 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentColor"> |
|
16 | 45 | </a> |
17 | 46 | {{- end }} |
18 | 47 |
|
| 48 | +{{- /* Technical Hooks: Site hooks for custom footer injections. */ -}} |
19 | 49 | {{- partial "internal/Injected_Footer_Hooks.html" . }} |
20 | 50 |
|
21 | 51 | <script> |
| 52 | + /* |
| 53 | + * Navigation State Maintenance: |
| 54 | + * Synchronizing the scroll position of the primary menu across page loads. |
| 55 | + */ |
22 | 56 | let menu = document.getElementById('menu'); |
23 | 57 | if (menu) { |
24 | | - // Set the scroll position |
25 | 58 | const scrollPosition = localStorage.getItem("menu-scroll-position"); |
26 | 59 | if (scrollPosition) { |
27 | 60 | menu.scrollLeft = parseInt(scrollPosition, 10); |
|
32 | 65 | } |
33 | 66 | } |
34 | 67 |
|
| 68 | + /* |
| 69 | + * Smooth Anchor Orchestration: |
| 70 | + * Providing fluid motion for internal site linkages. |
| 71 | + */ |
35 | 72 | document.querySelectorAll('a[href^="#"]').forEach(anchor => { |
36 | 73 | anchor.addEventListener("click", function (e) { |
37 | 74 | e.preventDefault(); |
|
50 | 87 | } |
51 | 88 | }); |
52 | 89 | }); |
53 | | - |
54 | 90 | </script> |
55 | 91 |
|
| 92 | +{{- /* Visibility logic for the back-to-top navigational hook. */ -}} |
56 | 93 | {{- if (not site.Params.disableScrollToTop) }} |
57 | 94 | <script> |
58 | 95 | var mybutton = document.getElementById("top-link"); |
|
65 | 102 | mybutton.style.opacity = "0"; |
66 | 103 | } |
67 | 104 | }; |
68 | | - |
69 | 105 | </script> |
70 | 106 | {{- end }} |
71 | 107 |
|
| 108 | +{{- /* |
| 109 | +* Thematic Interaction Logic: |
| 110 | +* Orchestrating theme transitions with visual and auditory feedback. |
| 111 | +*/ -}} |
72 | 112 | {{- if (not site.Params.disableThemeToggle) }} |
73 | 113 | <script> |
| 114 | + /* Audio Synthesis: Providing subtle feedback for modality shifts. */ |
74 | 115 | function playThemeSound() { |
75 | 116 | try { |
76 | 117 | const AudioContext = window.AudioContext || window.webkitAudioContext; |
|
81 | 122 | osc.connect(gain); |
82 | 123 | gain.connect(ctx.destination); |
83 | 124 |
|
84 | | - // Subtle "Soft Click" |
85 | 125 | osc.type = 'sine'; |
86 | 126 | const t = ctx.currentTime; |
87 | 127 |
|
88 | | - // Quick, low frequency drop (400Hz -> 100Hz) |
89 | 128 | osc.frequency.setValueAtTime(400, t); |
90 | 129 | osc.frequency.exponentialRampToValueAtTime(100, t + 0.1); |
91 | 130 |
|
92 | | - // Short, soft envelope |
93 | | - gain.gain.setValueAtTime(0.03, t); // Lower volume |
| 131 | + gain.gain.setValueAtTime(0.03, t); |
94 | 132 | gain.gain.exponentialRampToValueAtTime(0.001, t + 0.1); |
95 | 133 |
|
96 | 134 | osc.start(t); |
97 | 135 | osc.stop(t + 0.1); |
98 | 136 | } catch (e) { } |
99 | 137 | } |
100 | 138 |
|
| 139 | + /* View Transition Integration: Elevating the aesthetic of modality changes. */ |
101 | 140 | document.getElementById("theme-toggle").addEventListener("click", (e) => { |
102 | | - playThemeSound(); // Play sound on toggle |
| 141 | + playThemeSound(); |
103 | 142 |
|
104 | 143 | const toggleTheme = () => { |
105 | 144 | const html = document.querySelector("html"); |
|
145 | 184 | ); |
146 | 185 | }); |
147 | 186 | }) |
148 | | - |
149 | 187 | </script> |
150 | 188 | {{- end }} |
151 | 189 |
|
| 190 | +{{- /* |
| 191 | +* Content Utility: |
| 192 | +* Initializing the code-copying functionality for technical artifacts. |
| 193 | +*/ -}} |
152 | 194 | {{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (.Param "ShowCodeCopyButtons")) }} |
153 | 195 | <script> |
154 | 196 | document.querySelectorAll('pre > code').forEach((codeblock) => { |
|
184 | 226 | selection.removeRange(range); |
185 | 227 | }); |
186 | 228 |
|
| 229 | + /* Strategic button placement based on container nesting. */ |
187 | 230 | if (container.classList.contains("highlight")) { |
188 | 231 | container.appendChild(copybutton); |
189 | 232 | } else if (container.parentNode.firstChild == container) { |
190 | | - // td containing LineNos |
| 233 | + /* td containing LineNos */ |
191 | 234 | } else if (codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "TABLE") { |
192 | | - // table containing LineNos and code |
| 235 | + /* table containing LineNos and code */ |
193 | 236 | codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(copybutton); |
194 | 237 | } else { |
195 | | - // code blocks not having highlight as parent class |
| 238 | + /* code blocks not having highlight as parent class */ |
196 | 239 | codeblock.parentNode.appendChild(copybutton); |
197 | 240 | } |
198 | 241 | }); |
|
0 commit comments