From 7791a570c694ff985ccb76176c37d600460bdb16 Mon Sep 17 00:00:00 2001 From: HerrWaechter <len.kalski@stud.uni-hannover.de> Date: Thu, 2 Jan 2025 15:47:55 +0100 Subject: [PATCH] Searchable Courses --- source/Add-course.html | 22 ------ source/AddCourse.html | 74 +++++++++++++++++++ .../{Cosmetic-shop.html => CosmeticShop.html} | 0 3 files changed, 74 insertions(+), 22 deletions(-) delete mode 100644 source/Add-course.html create mode 100644 source/AddCourse.html rename source/{Cosmetic-shop.html => CosmeticShop.html} (100%) diff --git a/source/Add-course.html b/source/Add-course.html deleted file mode 100644 index 7515dda..0000000 --- a/source/Add-course.html +++ /dev/null @@ -1,22 +0,0 @@ -<!DOCTYPE html> -<html lang="de"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Add Course</title> - <link rel="stylesheet" type="text/css" href="style.css"> - <script src="script.js" defer></script> -</head> -<body> - <nav class="navbar"> - <div class="logo"><a href="Homepage.html">LOGO</a></div> - <div class="nav-dots"> - <h1>Add Course</h1> - </div> - <a href="#" class="account-btn">Account</a> - </nav> - <main class="main-content"> - - </main> -</body> -</html> \ No newline at end of file diff --git a/source/AddCourse.html b/source/AddCourse.html new file mode 100644 index 0000000..d01d9da --- /dev/null +++ b/source/AddCourse.html @@ -0,0 +1,74 @@ +<!DOCTYPE html> +<html lang="de"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Add Course</title> + <link rel="stylesheet" type="text/css" href="style.css"> + <script src="script.js" defer></script> + <style> + .main-content { + grid-template-columns: 1fr; + } + #input { + width: 100%; + height: 100%; + padding: 0px; + margin: 0px; + } + #UL { + display: grid; + grid-template-columns: 1fr 1fr 1fr 1fr; + grid-gap: 10px; + } + </style> +</head> +<body> + <nav class="navbar"> + <div class="logo"><a href="Homepage.html">LOGO</a></div> + <div class="nav-dots"> + <h1>Add Course</h1> + </div> + <a href="#" class="account-btn">Account</a> + </nav> + <main class="main-content"> + <input type="text" id="input" onkeyup="search()" placeholder="Search..."> + + <ul id="UL"> + <li class="box" data-href="joinGroup.html"> + Course 1 + </li> + <li class="box" data-href="joinGroup.html"> + Course 2 + </li> + <li class="box" data-href="joinGroup.html"> + Prog + </li> + <li class="box" data-href="joinGroup.html"> + Prog 2 + </li> + <li class="box" data-href="joinGroup.html"> + Test + </li> + </ul> + </main> +</body> +<script> + function search() { + var input, filter, div, ul, li, a, i, txtValue; + input = document.getElementById('input'); + filter = input.value.toUpperCase(); + ul = document.getElementById("UL"); + li = ul.getElementsByTagName('li'); + + for (i = 0; i < li.length; i++) { + txtValue = li[i].textContent || li[i].innerText; + if (txtValue.toUpperCase().indexOf(filter) > -1) { + li[i].style.display = ""; + } else { + li[i].style.display = "none"; + } + } + } +</script> +</html> \ No newline at end of file diff --git a/source/Cosmetic-shop.html b/source/CosmeticShop.html similarity index 100% rename from source/Cosmetic-shop.html rename to source/CosmeticShop.html -- GitLab