Skip to content

Commit 549156a

Browse files
Merge pull request #114 from Techy-ninja/main
Changes made to project page
2 parents 203aa1d + f46aa4e commit 549156a

File tree

3 files changed

+99
-4
lines changed

3 files changed

+99
-4
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ Whether you’re a seasoned developer or just starting out, Hacktoberfest offers
163163
- 🔍 [Up For Grabs](https://up-for-grabs.net/) — Projects with curated tasks for new contributors
164164
- 👶 [First Timers Only](https://www.firsttimersonly.com/) — Guides and issues specifically for first-time contributors
165165
-[CodeTriage](https://www.codetriage.com/) — Find open issues based on your interests and skills
166-
- 🌟 [ContribHub](https://contribhub.com/) — Platform to discover and contribute to open source projects
167166

168167
### 🏛️ Major Open Source Projects
169168

index.html

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@
13121312

13131313
<nav class="nav-links" aria-label="Main navigation">
13141314
<a href="#what-is-hacktoberfest">Overview</a>
1315-
<a href="projects.html" target="_blank" rel="noopener noreferrer">Projects</a>
1315+
<a href="projects.html">Projects</a>
13161316
<a href="#how-to-participate">How To</a>
13171317
<a href="#resources">Resources</a>
13181318
</nav>
@@ -2057,7 +2057,27 @@ <h1 class="loading-title">Loading README.md…</h1>
20572057
}
20582058
}
20592059

2060-
renderReadme();
2060+
// If visiting index.html with a hash (e.g., index.html#resources), remember it
2061+
const initialHash = window.location.hash ? window.location.hash.slice(1) : null;
2062+
2063+
// Render README and, if there was an initial hash, scroll to that section after render
2064+
renderReadme().then(() => {
2065+
if (initialHash) {
2066+
// If the article is already rendered, try to find the element and scroll to it
2067+
const el = document.getElementById(initialHash);
2068+
if (el) {
2069+
setTimeout(() => {
2070+
el.scrollIntoView({ behavior: 'smooth', block: 'start' });
2071+
history.replaceState(null, '', '#' + initialHash);
2072+
el.classList.add('highlight-section');
2073+
setTimeout(() => el.classList.remove('highlight-section'), 1000);
2074+
}, 120);
2075+
} else {
2076+
// If element not found, ensure loadMarkdownFile handles it by reloading README and passing id
2077+
loadMarkdownFile('README.md', initialHash);
2078+
}
2079+
}
2080+
});
20612081

20622082
// Theme toggle
20632083
const themeToggle = document.getElementById('theme-toggle');

projects.html

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,26 @@
77
<link rel="stylesheet" href="assets/style.css" />
88
<style>
99
:root { --hf-orange:#ff8a65; --hf-purple:#9b59b6; --hf-dark:#0e1b33; --hf-light:#fff; }
10+
/* When light theme is active, make the --hf-light variable dark so text becomes black */
11+
[data-theme="light"] { --hf-light: #000; }
12+
/* Top navigation minimal styles (copied from index.html) */
13+
.logo-blob { display:inline-block; width:2em; height:2em; margin-right:0.5em; background:linear-gradient(135deg,var(--hf-orange),var(--hf-purple)); border-radius:50%; box-shadow:0 0 15px rgba(255,138,101,0.3); }
14+
.brand { display:flex; align-items:center; color:var(--hf-light); text-decoration:none; }
15+
.brand-text { font-weight:700; color:var(--hf-light); }
16+
.topnav { background: linear-gradient(135deg, #0e1b33, var(--hf-purple)); color:var(--hf-light); padding:1rem 2rem; position:sticky; top:0; z-index:1000; box-shadow:0 2px 20px rgba(0,0,0,0.2); }
17+
.topnav-inner { display:flex; justify-content:space-between; align-items:center; max-width:1200px; margin:0 auto; }
18+
.nav-links { display:flex; gap:1.25rem; }
19+
.nav-links a { color:var(--hf-light); text-decoration:none; padding:0.35rem 0.6rem; transition:color .2s; }
20+
.nav-links a:hover { color:var(--hf-orange); }
21+
.nav-actions { display:flex; gap:0.75rem; align-items:center; }
22+
.nav-btn { background:none; border:none; color:#9fb1c7; font-size:1.05rem; cursor:pointer; }
23+
.nav-cta { background:linear-gradient(135deg,var(--hf-orange),var(--hf-purple)); padding:0.5rem .9rem; border-radius:999px; color:var(--hf-light); text-decoration:none; font-weight:600; }
1024
body { margin:0; font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,sans-serif; background:radial-gradient(circle at 30% 30%, rgba(155,89,182,.15), transparent), linear-gradient(135deg,#182c4f,#3d2f67 60%, #532d72); color:var(--hf-light); min-height:100vh; }
1125
header { text-align:center; padding:2.75rem 1rem 1.25rem; }
1226
h1 { margin:0; font-size:3rem; letter-spacing:.07em; font-weight:700; text-shadow:0 4px 18px rgba(0,0,0,.45); }
1327
.subtitle { margin-top:.75rem; font-size:.9rem; letter-spacing:.15em; opacity:.85; }
1428
.search-panel { margin:2.5rem auto 1.25rem; max-width:780px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.12); padding:1.75rem 1.5rem 2rem; border-radius:26px; position:relative; backdrop-filter:blur(10px); box-shadow:0 10px 40px -10px rgba(0,0,0,.35); }
15-
.search-panel:before { content:""; position:absolute; inset:0; border-radius:inherit; padding:1px; background:linear-gradient(135deg,rgba(255,138,101,.45),rgba(155,89,182,.45)); -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask-composite:exclude; pointer-events:none; }
29+
.search-panel:before { content:""; position:absolute; inset:0; border-radius:inherit; padding:1px; background:linear-gradient(135deg,rgba(255,138,101,.45),rgba(155,89,182,.45)); -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite:exclude; pointer-events:none; }
1630
.language-search-form { display:flex; width:100%; border:1px solid rgba(255,255,255,0.25); border-radius:10px; overflow:hidden; background:rgba(0,0,0,0.35); }
1731
.language-search-form input { flex:1; background:transparent; border:none; padding:.9rem 1rem; color:var(--hf-light); font-size:1rem; letter-spacing:.03em; }
1832
.language-search-form input:focus { outline:none; box-shadow: inset 0 0 0 2px var(--hf-purple); }
@@ -57,6 +71,33 @@
5771
</style>
5872
</head>
5973
<body>
74+
<header class="topnav" role="banner">
75+
<div class="topnav-inner">
76+
<a class="brand" href="index.html" title="Home">
77+
<span class="logo-blob" aria-hidden="true"></span>
78+
<span class="brand-text">Hacktoberfest 2025</span>
79+
</a>
80+
81+
<nav class="nav-links" aria-label="Main navigation">
82+
<a href="index.html#what-is-hacktoberfest">Overview</a>
83+
<a href="projects.html">Projects</a>
84+
<a href="index.html#how-to-participate">How To</a>
85+
<a href="index.html#resources">Resources</a>
86+
</nav>
87+
88+
<div class="nav-actions">
89+
<button id="nav-search-btn" class="nav-btn" title="Search (/)">
90+
🔎
91+
</button>
92+
<button id="theme-toggle" class="nav-btn" title="Toggle theme">
93+
🌙
94+
</button>
95+
<a class="nav-cta" href="https://github.com/avinash201199/Hacktoberfest2025" target="_blank" rel="noopener">GitHub</a>
96+
<button id="hamburger" class="nav-btn" aria-label="Toggle sidebar"></button>
97+
</div>
98+
</div>
99+
</header>
100+
60101
<header>
61102
<h1>SEARCH YOUR<br/>LANGUAGE</h1>
62103
<p class="subtitle">Live Hacktoberfest repositories grouped by programming language</p>
@@ -192,5 +233,40 @@ <h3><a href="${r.html_url}" target="_blank" rel="noopener noreferrer">${r.full_n
192233
resultsContent.appendChild(grid);
193234
}
194235
</script>
236+
<script>
237+
// Theme toggle: mirror main page behavior and persist selection
238+
(function(){
239+
const themeToggle = document.getElementById('theme-toggle');
240+
if (!themeToggle) return;
241+
const html = document.documentElement;
242+
const savedTheme = localStorage.getItem('theme') || 'dark';
243+
html.setAttribute('data-theme', savedTheme);
244+
themeToggle.textContent = savedTheme === 'dark' ? '🌙' : '☀️';
245+
246+
themeToggle.addEventListener('click', () => {
247+
const current = html.getAttribute('data-theme');
248+
const next = current === 'dark' ? 'light' : 'dark';
249+
html.setAttribute('data-theme', next);
250+
localStorage.setItem('theme', next);
251+
themeToggle.textContent = next === 'dark' ? '🌙' : '☀️';
252+
});
253+
})();
254+
</script>
255+
<script>
256+
// Ensure navbar links from this page navigate to index.html with the correct fragment
257+
document.querySelectorAll('.nav-links a').forEach(a => {
258+
a.addEventListener('click', (e) => {
259+
const href = a.getAttribute('href');
260+
// If it's already a full index.html#... link, let it proceed
261+
if (href && href.startsWith('index.html#')) return;
262+
// If it's just a fragment like #resources or points to index fragment, build proper URL
263+
if (href && href.startsWith('#')) {
264+
e.preventDefault();
265+
window.location.href = 'index.html' + href;
266+
}
267+
// If it's a plain 'index.html', leave as-is
268+
});
269+
});
270+
</script>
195271
</body>
196272
</html>

0 commit comments

Comments
 (0)