Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
[Slingshot] committed Apr 5, 2024
1 parent 1f1c81d commit 71299e1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 60 deletions.
55 changes: 19 additions & 36 deletions cars.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,26 @@ <h1 class="green-theme poppins-extrabold fs-4 d-inline-block mb-0">
class="nav d-lg-inline-block float-lg-end pt-2 pt-lg-0 border-bottom-1 text-center"
id="navBar"
>
<div
class="dropdown nav-links d-block d-lg-inline-block py-2 py-lg-1 pe-lg-4 text-decoration-none"
<a
href="index.html"
class="nav-links d-block d-lg-inline-block py-2 py-lg-1 pe-lg-4 text-decoration-none"
>Home</a
>
<a
href="index.html#about-us"
class="nav-links d-block d-lg-inline-block py-2 py-lg-1 pe-lg-4 text-decoration-none"
>About Us</a
>
<a
href="index.html#trending-cars"
class="nav-links d-block d-lg-inline-block py-2 py-lg-1 pe-lg-4 text-decoration-none"
>Trending Cars</a
>
<a
href="index.html#contact-us"
class="nav-links d-block d-lg-inline-block py-2 py-lg-1 pe-lg-4 text-decoration-none"
>Contact Us</a
>
<button
class="btn dropdown-toggle"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<a role="button"
><i class="fa fa-cart-plus" aria-hidden="true"></i>(3)</a
>
</button>
<ul class="dropdown-menu">
<li>
<button class="dropdown-item" type="button">LEXUS LX570</button>
</li>
<li>
<button class="dropdown-item" type="button">LEXUS LX570</button>
</li>
<li>
<button class="dropdown-item" type="button">LEXUS LX570</button>
</li>
</ul>
</div>

<a
href="login.html"
class="nav-links text-primary poppins-semibold d-block d-lg-inline-block py-2 py-lg-1 pe-lg-2 text-decoration-none"
Expand All @@ -82,17 +76,6 @@ <h1 class="green-theme poppins-extrabold fs-4 d-inline-block mb-0">
>Sign up</a
>
</div>
<div class="px-4 pt-1 d-none" id="carInfoModal">
<div class="py-3">
<div>
<i
class="d-block fa-solid fa-xmark fs-2 text-end pb-2 pe-3 pointer-event"
role="button"
id="carModalClose"
></i>
</div>
</div>
</div>
</header>
<div id="carsBody">
<div class="text-center mt-4">
Expand Down
26 changes: 2 additions & 24 deletions js/cars.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ let carModalClose = document.getElementById("carModalClose");
let carInfoBtn = document.querySelectorAll(".seeCarInfo");
let carsBody = document.getElementById("carsBody");
let carsNav = document.getElementById("carsNav");
const carsApi = "https://localhost:7116/api/Cars";

carModalClose.addEventListener("click", () => {
carInfoModal.classList.add("d-none");
carsBody.classList.remove("d-none");
carsNav.classList.remove("d-none");
window.scrollTo(0, 0);
window.scrollTo(0,0)
});

const openCarModal = () => {
Expand All @@ -20,25 +19,4 @@ const openCarModal = () => {

carInfoBtn.forEach((item) => {
item.addEventListener("click", openCarModal);
});

// window.addEventListener("DOMContentLoaded", async () => {
// try {
// const response = await fetch(carsApi, {
// method: "GET",
// mode: "no-cors",
// headers: {
// Accept: "*/*",
// },
// });
// if (!response.ok) {
// throw new Error("Unable to connect to API");
// }
// const data = await response.json();
// console.log(data);
// } catch (err) {
// alert("Unable fetch file. Check internet connection");
// console.error(err);
// }
// console.log(data);
// });
});

0 comments on commit 71299e1

Please sign in to comment.