diff --git a/source/AddCourse.html b/source/AddCourse.html deleted file mode 100644 index 737855079506242a7798f0e52b730051cc50d2f6..0000000000000000000000000000000000000000 --- a/source/AddCourse.html +++ /dev/null @@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html lang="de"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Course Website</title> - <link rel="stylesheet" type="text/css" href="style.css"> -</head> -<body> - <nav class="navbar"> - <div class="logo"> - <a href="Homepage.html">LOGO</a> - </div> - <div class="nav-dots"> - <h1>HOME</h1> - </div> - <a href="#" class="account-btn">Account</a> - </nav> -</body> -</html> \ No newline at end of file diff --git a/source/Homepage.html b/source/Homepage.html index 2fd50930840c85ef72b97bfc3de474921f7b058a..299c6abe6eab502254a1ae5e2e05ea7b4e28fd7a 100644 --- a/source/Homepage.html +++ b/source/Homepage.html @@ -5,6 +5,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Homepage</title> <link rel="stylesheet" type="text/css" href="style.css"> + <script src="script.js" defer></script> </head> <body> <nav class="navbar"> @@ -18,11 +19,11 @@ </nav> <main class="main-content"> <div class="left-column"> - <div class="box"> - <a href="Add-course.html">Add Course</a> + <div class="box" data-href="Add-course.html"> + Add Course </div> - <div class="box"> - <a href="Cosmetic-shop.html">Cosmetic Shop</a> + <div class="box" data-href="Cosmetic-shop.html"> + Cosmetic Shop </div> </div> @@ -38,4 +39,5 @@ </div> </main> </body> + </html> \ No newline at end of file diff --git a/source/script.js b/source/script.js new file mode 100644 index 0000000000000000000000000000000000000000..de0599a3013ef4f6f685a95b6d904eec8cbc3fec --- /dev/null +++ b/source/script.js @@ -0,0 +1,9 @@ + +const boxes = document.querySelectorAll('.box'); + +boxes.forEach((box) => { + box.addEventListener('click', function(e) { + alert('will redirect to:' + e.target.getAttribute('data-href')); + window.location.href = e.target.getAttribute('data-href'); + }); +}); \ No newline at end of file