Skip to content

Commit f30a4b8

Browse files
committed
scripting
1 parent e9226c0 commit f30a4b8

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

Youtube Clone/index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,13 @@
88
rel="stylesheet"
99
href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css"
1010
/>
11-
1211
<title>Youtube</title>
1312
</head>
1413
<body>
1514
<div class="main">
1615
<h1>Youtube</h1>
1716
</div>
1817

19-
<aside>
20-
<h1>hi</h1>
21-
</aside>
22-
2318
<div class="navbar">
2419
<div class="logo">Youtube</div>
2520
<div class="search-bar">
@@ -28,11 +23,16 @@ <h1>hi</h1>
2823
<i id="icon" class="bi bi-search"></i>
2924
</button>
3025
</div>
31-
<div class="links">
32-
<a href="#">Home</a>
33-
<a href="#">Trending</a>
34-
<a href="#">Subscriptions</a>
26+
<div class="sidebar">
27+
<button id="toggleButton">&#9776;</button>
28+
<div class="links">
29+
<h2>Home</h2>
30+
<h2>Trending</h2>
31+
<h2>Subscriptions</h2>
32+
</div>
3533
</div>
3634
</div>
35+
36+
<script src="script.js"></script>
3737
</body>
3838
</html>

Youtube Clone/script.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
document.addEventListener("DOMContentLoaded", function () {
2+
const toggleButton = document.getElementById("toggleButton");
3+
const linksContainer = document.querySelector(".links");
4+
5+
toggleButton.addEventListener("click", function () {
6+
linksContainer.style.maxHeight =
7+
linksContainer.style.maxHeight === "0px" ? "200px" : "0px";
8+
});
9+
});

Youtube Clone/style.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,27 @@ body {
6565
}
6666

6767
.search-bar button {
68-
padding: 11px 14px;
68+
padding: 8px 14px;
6969
background-color: hsl(0, 0%, 18.82%);
7070
color: #fff;
7171
border: none;
72-
border-radius: 0 8px 8px 0;
72+
border-radius: 4px 10px 10px 4px;
7373
cursor: pointer;
7474
outline: white;
7575
font-size: 14px;
7676
}
7777

7878
input {
7979
background-color: #0f0f0f;
80+
opacity: 80%;
8081
}
8182

8283
#icon {
8384
width: 7px;
8485
height: 7px;
86+
}
87+
88+
89+
input[type="text"] {
90+
color: #ffffff;
8591
}

0 commit comments

Comments
 (0)