forked from YadavAkhileshh/OpenPlayground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
107 lines (79 loc) · 3.38 KB
/
index.html
File metadata and controls
107 lines (79 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OpenPlayground - Build, Share, Explore</title>
<link rel="icon" href="logo.jpg" type="image/x-icon">
<link rel="icon" href="logo.jpg" type="image/png">
<meta name="description"
content="A community-driven platform where developers showcase their creativity through interactive web projects">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap"
rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/remixicon@4.3.0/fonts/remixicon.css" rel="stylesheet">
<link rel="stylesheet" href="./css/responsive.css">
<link rel="stylesheet" href="./css/style.css">
<link rel="stylesheet" href="./css/contributor-cards.css">
<link rel="stylesheet" href="./css/bookmarks.css">
</head>
<body>
<div id="header-placeholder"></div>
<div id="hero-placeholder"></div>
<!-- Projects Component Placeholder -->
<div id="projects-placeholder"></div>
<div id="contribute-placeholder"></div>
<div id="footer-placeholder"></div>
<div id="chatbot-placeholder"></div>
<button id="scrollToTopBtn" class="scroll-top-btn" aria-label="Scroll to top">
<svg class="progress-ring" viewBox="0 0 48 48" width="100%" height="100%">
<circle class="progress-ring__circle" stroke="currentColor" stroke-width="3" fill="transparent" r="21" cx="24" cy="24"/>
</svg>
<i class="ri-arrow-up-line" aria-hidden="true"></i>
</button>
<script src="./js/bookmarks.js"></script>
<script src="./js/chatbot.js"></script>
<script src="./js/components.js"></script>
<script>
// Function to set active nav link
function setActiveNavLink() {
// Get current URL or hash
const currentPath = window.location.pathname;
const currentHash = window.location.hash;
// Get all nav links
const navLinks = document.querySelectorAll('.nav-link');
// Remove active class from all links
navLinks.forEach(link => link.classList.remove('active'));
// Check for hash links (Projects, Contribute)
if (currentHash) {
const hashLink = document.querySelector(`.nav-link[href="${currentHash}"]`);
if (hashLink) {
hashLink.classList.add('active');
return;
}
}
// Check for page links
navLinks.forEach(link => {
if (link.getAttribute('href') === currentPath ||
(currentPath.includes('about') && link.getAttribute('href') === 'about.html') ||
(currentPath.includes('bookmarks') && link.getAttribute('href') === 'bookmarks.html')) {
link.classList.add('active');
}
});
}
// Run on page load
document.addEventListener('DOMContentLoaded', setActiveNavLink);
// Run on hash change (for Projects/Contribute sections)
window.addEventListener('hashchange', setActiveNavLink);
// Run on page load for sections
window.addEventListener('load', () => {
// If there's a hash on initial load
if (window.location.hash) {
setActiveNavLink();
}
});
</script>
<script type="module" src="./js/app.js"></script>
</body>
</html>