Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
affancoder committed Sep 9, 2024
1 parent d7fc75e commit efe0bd1
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 7 deletions.
38 changes: 32 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,38 @@

<body>
<!-- Navbar Start -->
<nav>
<ul>
<a href="/"><li class="brand"><img src="assests/logo1.jpg" alt="spotify" />Music Play</li></a>
<li>Home</li>
<li>About</li>
</ul>

<nav class="navbar">

<div class="nav-container">
<!-- Logo -->
<a href="/">
<li class="brand"><img src="assests/logo1.jpg" alt="spotify" />Music Play</li>
</a>

<!-- Search Bar -->
<div class="search-container">
<input type="text" placeholder="Search for songs..." id="search-input">
</div>

<!-- Menu -->
<div class="menu">
<button class="icon-button">👤</button>
<button class="icon-button">📡</button>
<button class="icon-button">⚙️</button>
<button class="icon-button" id="menu-btn"></button>
</div>

<!-- Mobile Menu -->
<div class="mobile-menu" id="mobile-menu">
<a href="#">Profile</a>
<a href="#">Discover</a>
<a href="#">Settings</a>
</div>
</div>

</nav>

<!-- Navbar End -->
<div>
<div class="container">
Expand Down Expand Up @@ -183,4 +208,5 @@ <h1>Best of Bollywood Hits - Love Songs</h1>
<script src="https://kit.fontawesome.com/033520b209.js" crossorigin="anonymous"></script>
<script src="script.js"></script>
</body>

</html>
15 changes: 15 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,18 @@ window.addEventListener("load", () => {
delay: 1,
});
});

// Toggle Mobile Menu
document.addEventListener("DOMContentLoaded", function () {
const menuButton = document.getElementById("menu-btn");
const mobileMenu = document.getElementById("mobile-menu");

menuButton.addEventListener("click", function () {
mobileMenu.classList.toggle("active");
if (mobileMenu.classList.contains("active")) {
mobileMenu.style.display = "flex";
} else {
mobileMenu.style.display = "none";
}
});
});
138 changes: 137 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ nav ul a {
background-size: cover;
}

nav img{
nav img {
width: 50px;
border-radius: 50%;
}
Expand All @@ -95,6 +95,124 @@ img:hover {
cursor: pointer;
}

/* Navbar Styling */
.navbar {
/* background-color: #1db954; */
padding: 10px 20px;
position: relative;
z-index: 1000;
}

.nav-container {
display: flex;
justify-content: space-between;
align-items: center;
margin: auto 50px;
}

.nav-container a {
text-decoration: none;
}

.brand {
display: flex;
align-items: center;
text-decoration: none;
color: white;
}

.brand img {
border-radius: 50%;
}

.logo {
height: 40px;
margin-right: 10px;
}

.brand-name {
font-size: 1.5rem;
font-weight: bold;
}

.search-container {
display: flex;
align-items: center;
position: relative;
}

.search-icon {
position: absolute;
right: 10px;
color: #333;
}

.search-container input {
padding: 10px;
border-radius: 25px;
border: none;
width: 250px;
transition: width 0.3s ease;
}

.search-container input:focus {
width: 300px;
outline: none;
}

.menu {
display: flex;
align-items: center;
}

.icon-button {
background: none;
border: none;
font-size: 1.5rem;
margin: 0 10px;
cursor: pointer;
color: white;
}

/* Mobile Menu Styling */
.mobile-menu {
display: none;
flex-direction: column;
background-color: white;
position: absolute;
top: 60px;
right: 20px;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
z-index: 10;
}

.mobile-menu a {
padding: 10px 20px;
text-decoration: none;
color: #1db954;
font-size: 1.2rem;
border-bottom: 1px solid #eee;
}

.mobile-menu a:hover {
background-color: #f4f4f4;
}

/* Animation */
@keyframes slideDown {
0% {
opacity: 0;
transform: translateY(-20px);
}

100% {
opacity: 1;
transform: translateY(0);
}
}


#myProgressBar {
width: 80vw;
text-align: center;
Expand Down Expand Up @@ -170,4 +288,22 @@ img:hover {
.timestamp {
margin-right: 8px;
}

.search-container input {
width: 100px;
margin-left: 70px;
display: none;
}

.menu {
display: none;
}

#menu-btn {
display: block;
}

.mobile-menu {
display: none;
}
}

0 comments on commit efe0bd1

Please sign in to comment.