Skip to content

Commit 7321b3c

Browse files
committed
Final Update Done.
Signed-off-by: Someshdiwan <[email protected]>
1 parent 0fab388 commit 7321b3c

File tree

7 files changed

+898
-650
lines changed

7 files changed

+898
-650
lines changed
File renamed without changes.

site/_includes/nav.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
<a href="https://github.com/Someshdiwan/JavaEvolution-Learning-Growing-Mastering" class="sidebar-link" target="_blank">
1111
<i class="fab fa-github"></i> GitHub Repo
1212
</a>
13-
</div>
13+
</div>

site/_layouts/default.html

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66

7-
<!-- Font Awesome -->
7+
<-- Font Awesome -->
88
<link
99
rel="stylesheet"
1010
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
1111
/>
1212

13-
<!-- Favicons -->
13+
<-- Favicons -->
1414
<link
1515
rel="icon" type="image/png"
1616
href="{{ '/assets/favicon-96x96.png' | relative_url }}"
@@ -45,29 +45,30 @@
4545
/>
4646

4747
<script>
48-
// Current timezone tracker
48+
49+
// TimeZone
4950
let currentZone = 'IST';
5051
let tapCount = 0;
5152
let tapTimer = null;
52-
const TAP_TIMEOUT = 300; // ms for double-tap detection
53-
const SCROLL_THRESHOLD = 100; // px to hide theme/time container
5453

55-
// Update active link based on URL
54+
const TAP_TIMEOUT = 200; //double-tap detection
55+
const SCROLL_THRESHOLD = 100; // after Scroll hide theme/time container
56+
57+
5658
function updateActiveLink() {
5759
const currentPath = window.location.pathname;
5860
const baseUrl = '{{ site.baseurl }}' || '';
59-
console.log('Current Path:', currentPath, 'Base URL:', baseUrl); // Debug
61+
console.log('Current Path:', currentPath, 'Base URL:', baseUrl);
6062
document.querySelectorAll('.sidebar-link').forEach(link => {
6163
link.classList.remove('active');
62-
const href = link.getAttribute('href').replace(baseUrl, ''); // Normalize href
64+
const href = link.getAttribute('href').replace(baseUrl, '');
6365
if (href === currentPath || (currentPath === '/' && href === '/')) {
6466
link.classList.add('active');
65-
console.log('Active Link Set:', href); // Debug
67+
console.log('Active Link Set:', href);
6668
}
6769
});
6870
}
6971

70-
// Sidebar toggle
7172
function toggleSidebar(isHidden) {
7273
const sidebar = document.getElementById('sidebar');
7374
const toggleBtn = document.querySelector('.toggle-btn');
@@ -77,7 +78,7 @@
7778
return;
7879
}
7980
sidebar.classList.toggle('hidden', isHidden);
80-
content.style.marginLeft = isHidden ? '0' : '210px'; // Force margin update
81+
content.style.marginLeft = isHidden ? '0' : '210px';
8182
localStorage.setItem('sidebar-hidden', isHidden);
8283
if (window.innerWidth > 768) {
8384
toggleBtn.style.display = isHidden ? 'block' : 'none';
@@ -87,7 +88,7 @@
8788
updateActiveLink();
8889
}
8990

90-
// Handle tap/click events
91+
// Handle tap or click events
9192
function handleTap(event) {
9293
const sidebar = document.getElementById('sidebar');
9394
const target = event.target;
@@ -96,7 +97,7 @@
9697
return;
9798
}
9899

99-
// Allow taps outside interactive elements to trigger hide/show
100+
// Allow taps outside interactive elements to trigger hide and show
100101
if (
101102
target.closest('#sidebar') ||
102103
target.closest('#theme-time-container') ||
@@ -123,7 +124,7 @@
123124
}
124125
}
125126

126-
// Dark mode toggle
127+
// Dark mode
127128
function toggleDarkMode() {
128129
const body = document.body;
129130
body.classList.toggle('dark-mode');
@@ -147,7 +148,7 @@
147148
}, 0);
148149
}
149150

150-
// Timezone toggle
151+
// Timezone
151152
function toggleTimezone() {
152153
currentZone = currentZone === 'IST' ? 'GMT' : 'IST';
153154
const tzButton = document.getElementById('tz-toggle-btn');
@@ -182,7 +183,8 @@
182183
liveTime.textContent = `Time (${currentZone}): ${h}:${m}:${s} ${ampm}`;
183184
}
184185

185-
// Handle scroll for theme/time container
186+
187+
// Handle scroll for theme and time container
186188
function handleScroll() {
187189
const themeTimeContainer = document.getElementById('theme-time-container');
188190
if (themeTimeContainer) {
@@ -196,7 +198,8 @@
196198
}
197199
}
198200

199-
// On load: init dark mode, sidebar state, listeners, time, SW
201+
202+
// On load: init dark mode, sidebar state, listeners, time, SW.
200203
window.onload = () => {
201204
// Initialize dark mode
202205
const isDark = localStorage.getItem('dark-mode') === 'true';
@@ -211,7 +214,8 @@
211214
console.error('Body element not found');
212215
}
213216

214-
// Initialize sidebar state
217+
218+
// Initialize sidebar
215219
const sidebar = document.getElementById('sidebar');
216220
const toggleBtn = document.querySelector('.toggle-btn');
217221
const content = document.querySelector('.content');
@@ -228,12 +232,13 @@
228232
console.error('Sidebar, toggle button, or content not found');
229233
}
230234

231-
// Show tooltip on first visit or force for testing
235+
236+
// Show tooltip on first visit
232237
const tooltip = document.getElementById('tooltip');
233238
if (tooltip) {
234239
const tooltipShown = localStorage.getItem('tooltip-shown');
235240
if (!tooltipShown) {
236-
console.log('Showing tooltip for first visit'); // Debug
241+
console.log('Showing tooltip for first visit');
237242
setTimeout(() => {
238243
tooltip.classList.add('visible');
239244
setTimeout(() => {
@@ -242,13 +247,13 @@
242247
}, 5000);
243248
}, 1000);
244249
} else {
245-
console.log('Tooltip already shown, skipping'); // Debug
250+
console.log('Tooltip already shown, skipping');
246251
}
247252
} else {
248253
console.error('Tooltip element not found');
249254
}
250255

251-
// Add tap/click and scroll listeners
256+
// Add tap and click and scroll listeners
252257
document.addEventListener('click', handleTap);
253258
document.addEventListener('touchstart', handleTap, { passive: true });
254259
window.addEventListener('scroll', handleScroll, { passive: true });
@@ -271,7 +276,8 @@
271276

272277
<body>
273278

274-
<!-- Dark Mode & Timezone Controls -->
279+
280+
<-- Dark Mode & Timezone Controls -->
275281
<div id="theme-time-container">
276282
<button class="dark-toggle" onclick="toggleDarkMode()" aria-label="Toggle Dark Mode">
277283
<i class="fas fa-moon"></i>
@@ -282,12 +288,13 @@
282288
</div>
283289
</div>
284290

285-
<!-- Onboarding Tooltip -->
291+
292+
<-- Onboarding Tooltip -->
286293
<div id="tooltip" class="tooltip">
287294
Single tap to hide sidebar, double tap to show
288295
</div>
289296

290-
<!-- Collapsible Sidebar -->
297+
<-- Collapsible Sidebar -->
291298
<div id="sidebar" class="sidebar">
292299
<a href="{{ site.baseurl }}/" class="sidebar-link">
293300
<i class="fas fa-home"></i> Home
@@ -300,12 +307,12 @@
300307
</a>
301308
</div>
302309

303-
<!-- Toggle Button (Fallback) -->
310+
<-- Toggle Button (Fallback) -->
304311
<button class="toggle-btn" onclick="toggleSidebar(!document.getElementById('sidebar').classList.contains('hidden'))" aria-label="Toggle Sidebar">
305312
<i class="fas fa-bars"></i>
306313
</button>
307314

308-
<!-- Main Content -->
315+
<-- Main Content -->
309316
<div class="wrapper">
310317
<div class="content">
311318
<div class="fade-in">

site/assets/style.css

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
--card-shadow: rgba(0, 0, 0, 0.5);
2222
--primary-color: #4da8ff;
2323
--active-color: #a1d6ff;
24-
--hover-bg: #333333; /* Adjusted for dark mode */
24+
--hover-bg: #333333;
2525
}
2626

2727
/* 2. Global Styles */
@@ -33,7 +33,7 @@ body {
3333
transition: background-color 0.3s, color 0.3s;
3434
}
3535

36-
/* 3. Theme + Time Container */
36+
/* 3. Theme and Time Container */
3737
#theme-time-container {
3838
position: fixed;
3939
top: 1rem;
@@ -163,7 +163,7 @@ body {
163163
transform: scaleX(1.1);
164164
}
165165

166-
/* 9. Toggle Button (Fallback) */
166+
/* 9. Toggle Button */
167167
.toggle-btn {
168168
position: sticky;
169169
top: 1rem;
@@ -186,6 +186,7 @@ body {
186186
opacity: 1;
187187
}
188188

189+
189190
/* 10. Content Area */
190191
.wrapper {
191192
display: flex;
@@ -204,15 +205,16 @@ body {
204205
margin-left: 0;
205206
}
206207

207-
/* 11. Card-style Container inside Content */
208+
209+
/* 11. Card style Container inside Content */
208210
.fade-in {
209211
background-color: var(--card-bg);
210212
padding: 1.5rem;
211213
border-radius: 10px;
212214
box-shadow: 0 4px 20px var(--card-shadow);
213215
}
214216

215-
/* 12. Fade-in Keyframes */
217+
/* 12. Fade in Key frames */
216218
@keyframes fadeIn {
217219
from {
218220
opacity: 0;

site/assets/sw.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const CACHE_NAME = "java-evolution-cache-v6";
1+
const CACHE_NAME = "java-evolution-cache-v7";
22
const STATIC_ASSETS = [
33
"/JavaEvolution-Learning-Growing-Mastering/",
44
"/JavaEvolution-Learning-Growing-Mastering/default.html",
@@ -11,6 +11,7 @@ const STATIC_ASSETS = [
1111
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
1212
];
1313

14+
1415
// Debounce function to limit cache updates
1516
function debounce(func, wait) {
1617
let timeout;
@@ -24,6 +25,7 @@ function debounce(func, wait) {
2425
};
2526
}
2627

28+
2729
// Install event
2830
self.addEventListener("install", (event) => {
2931
console.log("[Service Worker] Installing and caching static assets");
@@ -35,6 +37,7 @@ self.addEventListener("install", (event) => {
3537
);
3638
});
3739

40+
3841
// Activate event
3942
self.addEventListener("activate", (event) => {
4043
console.log("[Service Worker] Activated and cleaning old caches");
@@ -50,6 +53,7 @@ self.addEventListener("activate", (event) => {
5053
self.clients.claim();
5154
});
5255

56+
5357
// Fetch event
5458
self.addEventListener("fetch", (event) => {
5559
const request = event.request;
@@ -136,4 +140,4 @@ self.addEventListener("fetch", (event) => {
136140
});
137141
})
138142
);
139-
});
143+
});

0 commit comments

Comments
 (0)