Skip to content

Commit

Permalink
Merge pull request #123 from ananyag309/master
Browse files Browse the repository at this point in the history
Added search bar
  • Loading branch information
swaraj-das authored Oct 6, 2024
2 parents 5ff31b6 + 3e0deb3 commit 59df99a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
<li class="login"><a href="login/login.html">Login</a></li>
</ul>
</nav>

<!-- Search Bar (initially hidden) -->
<div class="search-bar hidden" id="searchBar">
<input type="text" id="search-input" placeholder="Search..." />
<button type="button" onclick="performSearch()">🔍</button>
</div>

<img src="images/menu.png" class="menu-icon" onclick="toggleMenu()">
</div>

Expand Down
51 changes: 51 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -697,3 +697,54 @@ button:hover img {
background: #ff6062;
}

.hidden {
display: none;
}

.search-bar {
text-align: center;
margin: 15px 0;
display: flex;
justify-content: flex-end; /* Align to right */
align-items: center;
gap: 8px; /* Space between input and button */
background-color: #f0f0f0;
padding: 8px 15px;
border-radius: 50px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
max-width: 250px; /* Adjust width to make it smaller */
margin: 20px auto 0 auto; /* Right alignment with some margin */
position: relative;
right: 80px; /* Push it further right */
}

#search-input {
width: 60%; /* Smaller input size */
padding: 8px 10px;
font-size: 14px;
border: none;
border-radius: 50px;
background-color: #fff;
outline: none;
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s ease;
}

#search-input:focus {
box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.search-bar button {
background-color: #333;
color: #fff;
border: none;
padding: 8px 12px;
font-size: 16px;
border-radius: 50px;
cursor: pointer;
transition: background-color 0.3s ease;
}

.search-bar button:hover {
background-color: #555;
}

0 comments on commit 59df99a

Please sign in to comment.