-
Notifications
You must be signed in to change notification settings - Fork 54
/
script.js
43 lines (31 loc) · 1.25 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//dont change this code line 2 to 5
let logoimg = document.getElementById("logo");
logoimg.style.height = "250px";
logoimg.style.width = "100%";
// Search function for project lookup
function findProject() {
const projectNameInput = document.getElementById("proname").value.trim();
if (projectNameInput === "") {
alert("Please enter a project name.");
return;
}
const projectMappings = {
amazon: "amazon",
searchengine: "searchengine",
};
const projectNameLower = projectNameInput.toLowerCase();
const findCardId = projectMappings[projectNameLower] || 'notfound-img';
const findCard = document.getElementById(findCardId);
document.body.innerHTML = findCard.innerHTML;
}
// Toggle search form visibility
const menuIcon = document.getElementById("menu-icon");
const searchForm = document.querySelector(".search-form");
menuIcon.addEventListener("click", function () {
searchForm.style.display = searchForm.style.display === "none" || searchForm.style.display === "" ? "flex" : "none";
});
function toggleSearchFormVisibility() {
searchForm.style.display = window.innerWidth > 767 ? "flex" : "none";
}
window.addEventListener("resize", toggleSearchFormVisibility);
toggleSearchFormVisibility();