Skip to content

Commit 830866d

Browse files
authored
Merge pull request #297 from Sushil010/fix/navbar-alignment
Fix: Signup button at navbar has been fixed
2 parents 4e4b640 + 80934f6 commit 830866d

2 files changed

Lines changed: 75 additions & 40 deletions

File tree

index.html

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
</a>
103103

104104
<div id="menu"
105-
class="fixed inset-0 bg-gray-900 w-full h-full flex flex-col items-center justify-center space-y-8 transform scale-0 transition-transform duration-300 ease-in-out lg:relative lg:flex lg:items-end lg:justify-end lg:space-y-0 lg:bg-transparent lg:scale-100 lg:flex-row lg:space-x-4 z-20">
105+
class="fixed inset-0 bg-gray-900 w-full h-full flex flex-col items-center justify-center space-y-8 transform scale-0 transition-transform duration-300 ease-in-out lg:relative lg:flex lg:items-center lg:justify-end lg:space-y-0 lg:bg-transparent lg:scale-100 lg:flex-row lg:space-x-4 z-20">
106106
<div id="menu-close" class="text-gray-300 lg:hidden absolute top-5 right-5 cursor-pointer">
107107
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
108108
stroke="currentColor">
@@ -115,30 +115,30 @@
115115
<a href="./about.html" class="text-gray-300 hover:text-green-500" id="about" data-translate="nav-about"><i class="fa-solid fa-address-card"></i> About</a>
116116
<a href="./contact.html" class="text-gray-300 hover:text-green-500" data-translate="nav-contact"><i class="fa-solid fa-phone"></i> Contact</a>
117117
<a href="./faq.html" class="text-gray-300 hover:text-green-500" data-translate="nav-faqs"><i class="fa-solid fa-circle-question"></i> FAQs</a> -->
118-
<!-- added icons by dodithakur -->
119-
<a href="./index.html" class="text-gray-300 hover:text-green-500">
118+
<!-- Navigation Links - Horizontal Layout -->
119+
<a href="./index.html" class="text-gray-300 hover:text-green-500 flex items-center gap-2">
120120
<i class="fa-solid fa-house"></i> Home
121121
</a>
122122

123-
<a href="./explore.html" class="text-gray-300 hover:text-green-500" id="explore" >
124-
<i class="fa-solid fa-magnifying-glass"></i> Explore
125-
</a>
123+
<a href="./explore.html" class="text-gray-300 hover:text-green-500 flex items-center gap-2" id="explore">
124+
<i class="fa-solid fa-magnifying-glass"></i> Explore
125+
</a>
126126

127-
<a href="./scan.html" class="text-gray-300 hover:text-green-500">
128-
<i class="fa-solid fa-book-open-reader"></i> Scan Book
129-
</a>
127+
<a href="./scan.html" class="text-gray-300 hover:text-green-500 flex items-center gap-2">
128+
<i class="fa-solid fa-book-open-reader"></i> Scan Book
129+
</a>
130130

131-
<a href="./about.html" class="text-gray-300 hover:text-green-500" id="about" >
132-
<i class="fa-solid fa-address-card"></i> About
133-
</a>
131+
<a href="./about.html" class="text-gray-300 hover:text-green-500 flex items-center gap-2" id="about">
132+
<i class="fa-solid fa-address-card"></i> About
133+
</a>
134134

135-
<a href="./contact.html" class="text-gray-300 hover:text-green-500">
136-
<i class="fa-solid fa-phone"></i> Contact
137-
</a>
135+
<a href="./contact.html" class="text-gray-300 hover:text-green-500 flex items-center gap-2">
136+
<i class="fa-solid fa-phone"></i> Contact
137+
</a>
138138

139-
<a href="./faq.html" class="text-gray-300 hover:text-green-500" >
140-
<i class="fa-solid fa-circle-question"></i> FAQs
141-
</a>
139+
<a href="./faq.html" class="text-gray-300 hover:text-green-500 flex items-center gap-2">
140+
<i class="fa-solid fa-circle-question"></i> FAQs
141+
</a>
142142

143143
<!-- Profile Icon and Theme Toggle -->
144144
<button id="theme-toggle" class="text-gray-300 hover:text-green-500">
@@ -164,21 +164,22 @@
164164
<a href="./profile.html" class="text-gray-300 hover:text-green-500 me-4">
165165
<i class="bi bi-person-circle h-6 w-6"></i>
166166
</a>
167-
</div>
168167

169-
<div class="language-selector me-3">
170-
<i class="fa-solid fa-language"></i>
171-
<select id="language" onchange="changeLanguage()" class="bg-gray-700 text-gray-300 border border-gray-600 rounded px-3 py-2 focus:outline-none focus:border-green-500">
172-
<option value="en">English</option>
173-
<option value="fr">Français</option>
174-
<option value="es">Español</option>
175-
<option value="zh">简体中文</option>
176-
</select>
177-
</div>
168+
<!-- Language Selector -->
169+
<div class="language-selector me-3">
170+
<i class="fa-solid fa-language"></i>
171+
<select id="language" onchange="changeLanguage()" class="bg-gray-700 text-gray-300 border border-gray-600 rounded px-3 py-2 focus:outline-none focus:border-green-500">
172+
<option value="en">English</option>
173+
<option value="fr">Français</option>
174+
<option value="es">Español</option>
175+
<option value="zh">简体中文</option>
176+
</select>
177+
</div>
178178

179-
<!-- Signup button -->
180-
<div class="flex-shrink-0">
181-
<button id="signupButton" class="w-24 text-white bg-transparent border-2 border-green-600 focus:border-green-700 rounded-full py-2 px-4 hover:-translate-y-0.5 transition-all duration-300 text-sm"><i class="fa-regular fa-circle-user"></i> Sign up</button>
179+
<!-- Signup button -->
180+
<div class="flex-shrink-0">
181+
<button id="signupButton" class="text-white bg-transparent border-2 border-green-600 focus:border-green-700 rounded-full py-2 px-4 hover:-translate-y-0.5 transition-all duration-300 text-sm whitespace-nowrap"><i class="fa-regular fa-circle-user"></i> Sign up</button>
182+
</div>
182183
</div>
183184

184185
<!-- Mobile Menu Toggle Button -->

style.css

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,24 @@ li:hover {
138138
}
139139

140140
.language-selector {
141-
margin: 20px;
141+
margin: 0;
142142
position: relative;
143+
display: flex;
144+
align-items: center;
145+
gap: 8px;
146+
padding: 8px;
147+
border-radius: 10px;
143148
}
144149

145-
.language-selector select {
146-
padding: 12px 16px;
150+
.language-selector i {
147151
font-size: 16px;
148-
border-radius: 25px;
152+
color: #9ca3af;
153+
}
154+
155+
.language-selector select {
156+
padding: 8px 12px;
157+
font-size: 14px;
158+
border-radius: 20px;
149159
font-weight: 500;
150160
border: 2px solid #1db954;
151161
background-color: #1db954;
@@ -155,9 +165,9 @@ li:hover {
155165
appearance: none; /* Remove default arrow */
156166
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.94-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>');
157167
background-repeat: no-repeat;
158-
background-position: right 10px center;
159-
background-size: 20px;
160-
padding-right: 40px; /* Space for the icon */
168+
background-position: right 8px center;
169+
background-size: 16px;
170+
padding-right: 32px; /* Space for the icon */
161171
}
162172

163173
.language-selector select:hover {
@@ -954,10 +964,10 @@ header {
954964
gap: 1.25rem; /* 20px between items */
955965
}
956966

957-
/* Subtle upward nudge for desktop alignment */
967+
/* Remove any margin adjustments that cause misalignment */
958968
@media (min-width: 1024px) {
959969
#menu {
960-
margin-top: -4px;
970+
margin-top: 0;
961971
}
962972
}
963973

@@ -973,6 +983,30 @@ header {
973983
border-radius: 10px;
974984
line-height: 1;
975985
transition: color 0.2s ease, background-color 0.2s ease;
986+
display: flex;
987+
align-items: center;
988+
gap: 8px;
989+
}
990+
991+
/* Ensure proper alignment for all menu elements */
992+
#menu .language-selector,
993+
#menu .flex-shrink-0,
994+
#menu #theme-toggle,
995+
#menu a[href="./profile.html"] {
996+
display: flex;
997+
align-items: center;
998+
justify-content: center;
999+
}
1000+
1001+
/* Ensure theme toggle and profile icon have consistent sizing */
1002+
#menu #theme-toggle {
1003+
padding: 8px;
1004+
border-radius: 10px;
1005+
}
1006+
1007+
#menu a[href="./profile.html"] {
1008+
padding: 8px;
1009+
border-radius: 10px;
9761010
}
9771011

9781012
#menu a:hover,

0 commit comments

Comments
 (0)