Skip to content

Commit 26ac9fb

Browse files
committed
New UI And Version 11th.
Signed-off-by: Someshdiwan <[email protected]>
1 parent ea09884 commit 26ac9fb

File tree

2 files changed

+56
-53
lines changed

2 files changed

+56
-53
lines changed

site/_layouts/default.html

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

7-
<!-- Favicon and related assets -->
7+
<!-- Favicon and App Icons -->
88
<link rel="icon" type="image/png" href="{{ '/assets/favicon-96x96.png' | relative_url }}" sizes="96x96" />
99
<link rel="icon" type="image/svg+xml" href="{{ '/assets/favicon.svg' | relative_url }}" />
1010
<link rel="shortcut icon" href="{{ '/assets/favicon.ico' | relative_url }}" />
1111
<link rel="apple-touch-icon" sizes="180x180" href="{{ '/assets/apple-touch-icon.png' | relative_url }}" />
1212
<meta name="apple-mobile-web-app-title" content="Java" />
1313

14-
<!-- Use the correct manifest for GitHub Pages project path -->
14+
<!-- Manifest: Use only one link, adjust for GitHub Pages project path -->
1515
<link rel="manifest" href="/JavaEvolution-Learning-Growing-Mastering/assets/site.webmanifest">
1616
<meta name="theme-color" content="#ffffff">
1717

1818
<title>{{ page.title }}</title>
1919
<link rel="stylesheet" href="{{ "/assets/style.css" | relative_url }}">
2020

2121
<script>
22-
// --- Sidebar Toggle Function ---
22+
// Sidebar Toggle Function
2323
function toggleSidebar() {
2424
const sidebar = document.getElementById("sidebar");
2525
sidebar.classList.toggle("hidden");
2626
}
2727

28-
// --- Auto-hide Sidebar if Clicked Outside ---
28+
// Function to hide sidebar if clicked outside
2929
function hideSidebarIfClickedOutside(event) {
3030
const sidebar = document.getElementById("sidebar");
3131
const toggleBtn = document.querySelector(".toggle-btn");
@@ -36,23 +36,23 @@
3636
}
3737
}
3838

39-
// --- Dark Mode Toggle ---
39+
// Dark Mode Toggle Function
4040
const toggleDarkMode = () => {
4141
document.body.classList.toggle('dark-mode');
4242
localStorage.setItem('dark-mode', document.body.classList.contains('dark-mode'));
4343
};
4444

45-
// --- Live Time Update Function ---
45+
// Live Time Update Function (includes GMT offset)
4646
function updateLiveTime() {
4747
const now = new Date();
4848
let hours = now.getHours();
4949
const minutes = now.getMinutes().toString().padStart(2, '0');
5050
const seconds = now.getSeconds().toString().padStart(2, '0');
5151
const ampm = hours >= 12 ? 'PM' : 'AM';
52-
hours = hours % 12 || 12; // convert to 12-hour format
52+
hours = hours % 12 || 12;
5353
const timeString = `${hours}:${minutes}:${seconds} ${ampm}`;
5454

55-
// Calculate GMT offset (JavaScript returns offset in minutes; negative means ahead of UTC)
55+
// Compute offset (JS returns minutes behind UTC; here we negate to get GMT+ for IST)
5656
const offset = -now.getTimezoneOffset();
5757
const offsetHours = Math.floor(Math.abs(offset) / 60);
5858
const offsetMinutes = Math.abs(offset) % 60;
@@ -62,33 +62,37 @@
6262
document.getElementById('live-time').textContent = `Time: ${timeString} ${offsetString}`;
6363
}
6464

65-
// --- Service Worker Registration ---
65+
// Service Worker Registration (ensure sw.js is at the correct path)
6666
if ("serviceWorker" in navigator) {
6767
navigator.serviceWorker.register("/JavaEvolution-Learning-Growing-Mastering/assets/sw.js")
6868
.then(() => console.log("✅ Service Worker Registered"))
6969
.catch(err => console.error("SW registration failed", err));
7070
}
7171

72-
// --- Initialize on DOMContentLoaded ---
72+
// Initialization on DOMContentLoaded
7373
window.addEventListener('DOMContentLoaded', () => {
74-
// Initialize dark mode from localStorage
74+
// Dark mode initialization
7575
if (localStorage.getItem('dark-mode') === 'true') {
7676
document.body.classList.add('dark-mode');
7777
}
78+
// Attach click listener for sidebar auto-hide
79+
document.addEventListener('click', hideSidebarIfClickedOutside);
7880

7981
// Start live time updates
8082
updateLiveTime();
8183
setInterval(updateLiveTime, 1000);
82-
83-
// Auto-hide sidebar on click outside
84-
document.addEventListener('click', hideSidebarIfClickedOutside);
8584
});
8685
</script>
8786
</head>
8887
<body>
89-
<!-- Dark Mode Toggle Button (top-right) -->
88+
<!-- Dark Mode Toggle Button -->
9089
<button onclick="toggleDarkMode()" class="dark-toggle">🌓</button>
9190

91+
<!-- Place the Time Container under the dark mode toggle -->
92+
<div id="time-location-container">
93+
<div id="live-time">Time: Loading...</div>
94+
</div>
95+
9296
<div class="wrapper">
9397
<!-- Sidebar Navigation -->
9498
<div id="sidebar" class="sidebar">
@@ -97,19 +101,12 @@
97101

98102
<!-- Content Area -->
99103
<div class="content">
100-
<!-- (Optional: Sidebar Toggle Button, if needed) -->
104+
<!-- Sidebar Toggle Button (keep if you want manual control) -->
101105
<button class="toggle-btn" onclick="toggleSidebar()"></button>
102-
103-
<!-- Live Time Container (placed below the dark mode toggle) -->
104-
<div id="live-time" class="fade-in" style="text-align: center; margin: 1rem 0;">
105-
Time: Loading...
106-
</div>
107-
108-
<!-- Main Content -->
109106
<div class="fade-in">
110107
{{ content }}
111108
</div>
112109
</div>
113110
</div>
114111
</body>
115-
</html>
112+
</html>

site/assets/style.css

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
1+
/* Base Colors and Typography */
12
:root {
23
--bg-color: #ffffff;
34
--text-color: #000000;
45
--sidebar-bg: #f8f9fa;
56
--link-color: #0366d6;
7+
--button-bg: #eee;
8+
--button-text: #000;
9+
--hover-bg: rgba(0, 0, 0, 0.05);
10+
--border-color: #ccc;
611
}
712

813
.dark-mode {
914
--bg-color: #121212;
1015
--text-color: #e0e0e0;
1116
--sidebar-bg: #1f1f1f;
1217
--link-color: #90caf9;
18+
--button-bg: #333;
19+
--button-text: #fff;
20+
--hover-bg: rgba(255, 255, 255, 0.1);
21+
--border-color: #444;
1322
}
1423

1524
body {
1625
background-color: var(--bg-color);
1726
color: var(--text-color);
1827
margin: 0;
1928
font-family: sans-serif;
29+
transition: background-color 0.3s ease, color 0.3s ease;
2030
}
2131

22-
2332
/* Sidebar Styles */
2433
.sidebar {
2534
background-color: var(--sidebar-bg);
@@ -28,7 +37,7 @@ body {
2837
position: fixed;
2938
height: 100vh;
3039
overflow-y: auto;
31-
border-right: 1px solid #ccc;
40+
border-right: 1px solid var(--border-color);
3241
transition: transform 0.3s ease;
3342
z-index: 999;
3443
}
@@ -37,7 +46,6 @@ body {
3746
transform: translateX(-100%);
3847
}
3948

40-
/* Sidebar Links */
4149
.sidebar a {
4250
display: block;
4351
padding: 0.5rem;
@@ -48,7 +56,7 @@ body {
4856
}
4957

5058
.sidebar a:hover {
51-
background-color: rgba(0, 0, 0, 0.05);
59+
background-color: var(--hover-bg);
5260
}
5361

5462
/* Content Area */
@@ -62,34 +70,34 @@ body {
6270
margin-left: 0;
6371
}
6472

65-
66-
/* Toggle Button */
73+
/* Toggle Buttons */
6774
.toggle-btn {
6875
position: fixed;
6976
top: 1rem;
7077
left: 1rem;
7178
z-index: 1001;
72-
background: #eee;
79+
background-color: var(--button-bg);
80+
color: var(--button-text);
7381
border: none;
7482
padding: 0.5rem 1rem;
7583
border-radius: 5px;
7684
cursor: pointer;
7785
}
7886

79-
/* Dark Mode Toggle Button */
8087
.dark-toggle {
8188
position: fixed;
8289
top: 1rem;
8390
right: 1rem;
8491
z-index: 1001;
85-
background: #eee;
92+
background-color: var(--button-bg);
93+
color: var(--button-text);
8694
border: none;
8795
padding: 0.5rem 1rem;
8896
border-radius: 5px;
8997
cursor: pointer;
9098
}
9199

92-
/* Animation */
100+
/* Fade-in Animation */
93101
.fade-in {
94102
animation: fadeIn 0.4s ease-in;
95103
}
@@ -106,15 +114,15 @@ body {
106114
position: fixed;
107115
left: 0;
108116
}
109-
110117
.sidebar:not(.hidden) {
111118
transform: translateX(0);
112119
}
113-
114120
.content {
115121
margin-left: 0;
116122
}
117123
}
124+
125+
/* Image Row and Responsive Image Styles */
118126
.image-row {
119127
display: flex;
120128
flex-wrap: wrap;
@@ -143,7 +151,7 @@ body {
143151

144152
.responsive-img {
145153
width: 100%;
146-
max-width: 600px; /* Or 500px or whatever looks good */
154+
max-width: 600px; /* Adjust this value as preferred */
147155
height: auto;
148156
margin: 0 auto;
149157
display: block;
@@ -156,15 +164,12 @@ body {
156164
transform: scale(1.02);
157165
}
158166

159-
160-
/* Optional: Add a dark-mode outline for visibility */
161167
.dark-mode .responsive-img {
162168
box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
163169
}
164170

165-
/* for the Location and Time Container */
166-
<style>
167-
#time-location-container {
171+
/* Time Container Styling */
172+
#time-location-container {
168173
background: rgba(0, 0, 0, 0.6);
169174
color: #00ffff;
170175
border: 1px solid #00ffff;
@@ -174,17 +179,18 @@ body {
174179
text-align: center;
175180
font-weight: 600;
176181
font-size: 1.05rem;
177-
}
182+
margin: 1rem auto;
183+
max-width: 300px;
184+
}
178185

179-
body.dark-mode #time-location-container {
180-
background-color: #333;
181-
color: #eee;
182-
}
186+
body.dark-mode #time-location-container {
187+
background-color: #333;
188+
color: #eee;
189+
}
183190

184-
@media (max-width: 600px) {
185-
#time-location-container {
186-
font-size: 0.95rem;
187-
margin: 1rem 1rem;
188-
}
191+
@media (max-width: 600px) {
192+
#time-location-container {
193+
font-size: 0.95rem;
194+
margin: 1rem;
189195
}
190-
</style>
196+
}

0 commit comments

Comments
 (0)