Skip to content

Commit 6666a55

Browse files
committed
update welcome.html
1 parent f15e4d9 commit 6666a55

14 files changed

Lines changed: 429 additions & 72 deletions

File tree

assets/.DS_Store

2 KB
Binary file not shown.

assets/images/.DS_Store

6 KB
Binary file not shown.

assets/images/20px/.DS_Store

6 KB
Binary file not shown.

assets/images/Question-Circle.png

2.56 KB
Loading

assets/images/explore-topics.png

1.64 KB
Loading

assets/images/pick-your-role.png

2.7 KB
Loading
1.44 KB
Loading

assets/images/search-features.png

2.33 KB
Loading

index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap" rel="stylesheet">
34
<head>
45
<meta charset="UTF-8" />
56
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
@@ -150,6 +151,21 @@
150151
</ul>
151152
</div>
152153

154+
<div class="menu-section">
155+
<div class="section-title" onclick="toggleSection(this)">
156+
<span class="title-text">Publish Your Course</span>
157+
<span class="caret" aria-hidden="true">
158+
<svg viewBox="0 0 24 24" width="16" height="16">
159+
<path d="M9 6l6 6-6 6" fill="none" stroke="currentColor" stroke-width="2"
160+
stroke-linecap="round" stroke-linejoin="round"/>
161+
</svg>
162+
</span>
163+
</div>
164+
165+
<ul class="submenu">
166+
<li data-page="pages/publish-your-course/review-your-course.html"><span>Review Your Course</span></li>
167+
</ul>
168+
153169
<!-- INSTRUCTOR SECTIONS -->
154170
<div class="role-header">Instructor</div>
155171
<div class="menu-section">

main.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,35 @@ console.log('main.js loaded');
1515
badge.setAttribute('aria-hidden', 'true');
1616
});
1717

18+
// Enable in-panel SPA navigation for data-page elements inside .content too
19+
document.addEventListener('click', function (event) {
20+
const target = event.target.closest('[data-page]');
21+
if (!target) return;
22+
23+
// Prevent full page reload
24+
event.preventDefault();
25+
26+
const page = target.getAttribute('data-page');
27+
if (!page) return;
28+
29+
// Highlight selected state if you want
30+
document.querySelectorAll('.submenu li').forEach(li => li.classList.remove('selected'));
31+
32+
// Load the HTML into the main content area
33+
fetch(page)
34+
.then(response => response.text())
35+
.then(html => {
36+
const content = document.querySelector('.content');
37+
if (content) {
38+
content.innerHTML = html;
39+
// Optional: scroll to top after load
40+
content.scrollTo({ top: 0, behavior: 'smooth' });
41+
}
42+
})
43+
.catch(err => console.error('Error loading page:', err));
44+
});
45+
46+
1847
// --- fuzzy matching helpers (used by search overlay) ---
1948
const _norm = (s) => String(s || '')
2049
.toLowerCase()
@@ -226,4 +255,40 @@ console.log('main.js loaded');
226255
setTimeout(() => li.classList.remove('spotlight'), 1100);
227256
});
228257

258+
// --- Role-card spotlight navigation (for Logging In page) ---
259+
document.addEventListener('click', (e) => {
260+
const card = e.target.closest('.role-card[data-page]');
261+
if (!card) return;
262+
263+
e.preventDefault();
264+
const page = card.getAttribute('data-page');
265+
if (!page) return;
266+
267+
// Find matching sidebar item
268+
const li = document.querySelector(`.submenu li[data-page="${page}"]`);
269+
if (!li) {
270+
console.warn('No matching sidebar item for:', page);
271+
return;
272+
}
273+
274+
// Expand the section if collapsed
275+
const submenu = li.closest('.submenu');
276+
if (submenu && submenu.classList.contains('collapsed')) {
277+
const header = submenu.previousElementSibling;
278+
if (header) header.click();
279+
}
280+
281+
// Select and trigger load
282+
li.classList.add('selected');
283+
li.click();
284+
285+
// Smooth scroll and spotlight (uses your existing functions)
286+
const container = getScrollContainer(li);
287+
scrollIntoViewWithin(container, li);
288+
289+
li.classList.add('spotlight');
290+
setTimeout(() => li.classList.remove('spotlight'), 1100);
291+
});
292+
293+
229294
})();

0 commit comments

Comments
 (0)