From 0e5ec512e9182567ac858553193b412387620f88 Mon Sep 17 00:00:00 2001 From: Juthatip McDevitt Date: Mon, 17 Jun 2024 15:10:05 -0500 Subject: [PATCH] added navbar active --- hotel_booking/admin/common.css | 13 +++++--- hotel_booking/admin/components/script.php | 15 +++++++++ hotel_booking/admin/components/sidebar.php | 14 ++++---- hotel_booking/contact.php | 37 +++++++++++++++++----- 4 files changed, 60 insertions(+), 19 deletions(-) diff --git a/hotel_booking/admin/common.css b/hotel_booking/admin/common.css index 34445c8..75c9e8a 100644 --- a/hotel_booking/admin/common.css +++ b/hotel_booking/admin/common.css @@ -49,10 +49,15 @@ z-index: 1000; } .custom-alert-t{ - position: fixed; - top: -700px; - right: 20px; - width: 320px; + position:fixed; + top: 0px; + left: 0px; + width: 100%; + z-index:9999; + border-radius:0px +} +#dashboard-menu .nav-link.active{ + background-color: #77B0AA; } @media (max-width:992px) { #dashboard-menu{ diff --git a/hotel_booking/admin/components/script.php b/hotel_booking/admin/components/script.php index 1d85a3d..96ac30d 100644 --- a/hotel_booking/admin/components/script.php +++ b/hotel_booking/admin/components/script.php @@ -14,4 +14,19 @@ document.body.append(element); } +//navbar-active(admin) + function setActive(){ + let navbar = document.getElementById('dashboard-menu'); + let a_tag = navbar.getElementsByTagName('a'); + + for(i=0; i < a_tag.length; i++){ + let file = a_tag[i].href.split('/').pop(); + let file_name = file.split('.')[0]; + + if(document.location.href.indexOf(file_name) >= 0){ + a_tag[i].classList.add('active') + } + } + } + setActive(); \ No newline at end of file diff --git a/hotel_booking/admin/components/sidebar.php b/hotel_booking/admin/components/sidebar.php index 2cdfd09..00cd3bc 100644 --- a/hotel_booking/admin/components/sidebar.php +++ b/hotel_booking/admin/components/sidebar.php @@ -16,20 +16,20 @@ - \ No newline at end of file + diff --git a/hotel_booking/contact.php b/hotel_booking/contact.php index 4a45182..0a88bb0 100644 --- a/hotel_booking/contact.php +++ b/hotel_booking/contact.php @@ -122,7 +122,11 @@ .accordion:has(.active) .arrow{ transform: rotate(180deg); } - + .custom-alert{ + position: fixed; + top: 25px; + right: 25px; + } @media (max-width:980px) { .contact-container{ @@ -367,17 +371,34 @@

Contact Form

Can't find the contact and information you're looking for? Write to us via this quick form.

-
-
- - - - - +
+ + + + + +
+ +
+ +