Skip to content

Commit 2846e43

Browse files
authored
Updated Navbar in Hero section (#105)
* Navbar fix * Added Navbar in Hero section * fix hero image * review fixes
1 parent f3cac0f commit 2846e43

File tree

4 files changed

+4
-25
lines changed

4 files changed

+4
-25
lines changed

src/_includes/js.njk

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,6 @@
2828
btt.classList.remove('block');
2929
}
3030
}
31-
32-
// Handle navbar appearance on scroll
33-
if (navbar) {
34-
if (window.scrollY > 50) {
35-
navbar.classList.add('scrolled');
36-
37-
// For homepage, make navbar visible after scrolling
38-
if (isHomePage) {
39-
navbar.classList.remove('opacity-0', '-translate-y-full');
40-
navbar.classList.add('opacity-100', 'translate-y-0', 'bg-pycon-blue/70');
41-
}
42-
} else {
43-
navbar.classList.remove('scrolled');
44-
45-
// For homepage, hide navbar when at the top
46-
if (isHomePage) {
47-
navbar.classList.add('opacity-0', '-translate-y-full');
48-
navbar.classList.remove('opacity-100', 'translate-y-0', 'bg-pycon-blue/70');
49-
}
50-
}
51-
}
5231
};
5332
5433
window.addEventListener('scroll', handleScroll);

src/_includes/landing/hero-banner.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<div class="relative w-full h-auto bg-[#4E62F5] pt-1 md:pt-3 overflow-hidden">
1+
<div class="relative w-full h-auto bg-[#4E62F5] pt-12 md:pt-16 xl:pt-20 overflow-hidden">
22
<img
33
src="{{ env.baseUrl }}img/hero-banner.png"
44
alt="PyCon India 2025"
5-
class="w-full object-cover object-center scale-105"
5+
class="w-full object-cover object-center scale-105 pb-10"
66
/>
77
</div>

src/_includes/navbar.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% macro navbar(isHomePage = false, env = env) %}
2-
<nav class="w-full flex justify-center glass-nav {% if isHomePage %}bg-transparent opacity-0 -translate-y-full{% else %}bg-pycon-blue/70{% endif %} z-50 fixed top-0 transition-all duration-500" id="main-navbar">
2+
<nav class="w-full flex justify-center {% if isHomePage %}bg-black{% else %}bg-pycon-blue{% endif %} z-50 fixed top-0 left-0 right-0 transition-all duration-500" id="main-navbar">
33
<div class="w-full max-w-5xl mx-auto px-6 hidden md:block py-3">
44
<div class="relative flex justify-center items-center h-12 px-6">
55
<a href="{{ env.baseUrl }}" class="absolute left-0">

src/index.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ isFront: true
1010
</div>
1111

1212
<main class="flex-grow relative">
13-
<div class="home-banner mt-0 relative z-[1]">
13+
<div class="home-banner mt-4 lg:mt-5 xl:mt-3 relative z-[1]">
1414
{% include "landing/hero-banner.njk" %}
1515
</div>
1616
{% include "landing/hero.njk" %}

0 commit comments

Comments
 (0)