Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed-directing-to-different-pages-from-plan-a-trip-page-and-image-slider-to-stop-when-it-reaches-the-last-image #1588

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<!DOCTYPE html>
<html lang="en">

Expand Down Expand Up @@ -499,13 +498,13 @@

</script>

<!-- sticky animation -->
<script type="text/javascript">
window.addEventListener("scroll", function () {
var header = document.querySelector("nav");
header.classList.toggle("sticky", window.scrollY > 50)
})
</script>
<!-- sticky animation -->
<script type="text/javascript">
window.addEventListener("scroll", function () {
var header = document.querySelector("nav");
header.classList.toggle("sticky", window.scrollY > 50)
})
</script>

<div id="pre-loader">
<h1>TourGuide . . .</h1>
Expand Down Expand Up @@ -546,29 +545,29 @@ <h1>TourGuide . . .</h1>
<img src="/favicon.ico" class="sitelogo">

<a href="#" class="nav__logo" data-aos="fade-right">Tourguide<span>.</span></a>
</div>
</div>

<ul class="navLinks">
<ul class="navLinks">
<li class="link" id="View-link" data-aos=""><a href="mapa.html">View</a></li>
<li class="link" id="LogIn-link" data-aos=""><a href="newLogin.html">Log In</a></li>
<li class="link" data-aos=""><a href="#Home">Home</a></li>
<li class="link" data-aos=""><a href="index.html">Home</a></li>
<li class="link" data-aos=""><a href="./about.html">About</a></li>
<li class="link dropdown" data-aos="">
<a href="#Services" class="dropdown">Services</a>
<ul class="dropdown-menu">
<li><a href="#Destinations">Destination</a></li>
<li><a href="#trip">Prices</a></li>
<li><a href="#ReviewGallery">Trip Gallery</a></li>
<li><a href="#tourist">Tourist Guide</a></li>
<li><a href="#hotel">Hotel & Resort</a></li>
<li><a href="#tourist">Tourist Guide</a></li>
</ul>
</li>
<li class="link" data-aos=""><a href="./topdeals/topdeals.html">Top Deals</a></li>
<li class="link" data-aos=""><a href="./packages.html">Packages</a></li>
<li class="link" data-aos=""><a href="#testimonials">Testimonial</a></li>
<li class="link" data-aos=""><a href="feedback.html">Rate Us?</a></li>
<li class="link" data-aos=""><a href="#cnt-form">Contact Us</a></li>
</ul>
</ul>

<a href="newLogin.html" class="contact-btn" id="nav-login-btn"><button class="btn login" id="btn-style"
data-aos="fade-down">Login/SignUp</button></a>
Expand Down Expand Up @@ -598,19 +597,19 @@ <h1>TourGuide . . .</h1>
</div>

<script>
window.addEventListener('scroll', function() {
// Get the current scroll position
const winScroll = document.documentElement.scrollTop || document.body.scrollTop;
// Get the total scrollable height
const height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
// Calculate the percentage scrolled
const scrolled = (winScroll / height) * 100;
// Set the progress bar width
document.getElementById('progress-bar').style.width = scrolled + '%';
});
window.addEventListener('scroll', function () {
// Get the current scroll position
const winScroll = document.documentElement.scrollTop || document.body.scrollTop;

// Get the total scrollable height
const height = document.documentElement.scrollHeight - document.documentElement.clientHeight;

// Calculate the percentage scrolled
const scrolled = (winScroll / height) * 100;

// Set the progress bar width
document.getElementById('progress-bar').style.width = scrolled + '%';
});

</script>
</div>
Expand Down Expand Up @@ -2139,9 +2138,10 @@ <h4>Contact Us</h4>
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

</script>
<script type="text/javascript"
src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>


<!-- <div class="footer__col">
<label for="google_translate_element" style="display: block; font-weight: bold; margin-bottom: 5px;">Select Language:</label>
Expand Down
118 changes: 108 additions & 10 deletions plantrip.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@
<div style="display: flex; flex-direction: row; align-items: center;">
<img src="./img/tour1.png" class="sitelogo">

<a href="#" class="nav__logo aos-init aos-animate" data-aos="fade-right">Tourguide<span>.</span></a>
<a href="index.html" class="nav__logo aos-init aos-animate" data-aos="fade-right">Tourguide<span>.</span></a>
</div>

<ul class="navLinks">
<li class="link aos-init aos-animate" id="View-link" data-aos=""><a href="mapa.html">View</a></li>
<li class="link aos-init aos-animate" id="LogIn-link" data-aos=""><a href="newLogin.html">Log In</a></li>
<li class="link aos-init aos-animate" data-aos=""><a href="#Home">Home</a></li>
<li class="link aos-init aos-animate" data-aos=""><a href="#AboutUs">About</a></li>
<li class="link dropdown aos-init aos-animate" data-aos="">
<li class="link aos-init aos-animate" data-aos=""><a href="index.html">Home</a></li>
<li class="link aos-init aos-animate" data-aos=""><a href="about.html">About</a></li>
<!-- <li class="link dropdown aos-init aos-animate" data-aos="">
<a href="#Services" class="dropdown">Services</a>
<ul class="dropdown-menu">
<li><a href="#Destinations">Destination</a></li>
Expand All @@ -183,7 +183,7 @@
<li><a href="#tourist">Tourist Guide</a></li>
<li><a href="#hotel">Hotel &amp; Resort</a></li>
</ul>
</li>
</li> -->
<li class="link aos-init aos-animate" data-aos=""><a href="#testimonials">Testimonial</a></li>
<li class="link aos-init aos-animate" data-aos=""><a href="feedback.html">Rate Us?</a></li>
<li class="link aos-init aos-animate" data-aos=""><a href="#cnt-form">Contact Us</a></li>
Expand Down Expand Up @@ -268,8 +268,8 @@ <h3>Thailand</h3>
</div>
</div>
<div class="carousel-controls">
<button class="carousel-button" onclick="prevSlide()">&#9664;</button>
<button class="carousel-button" onclick="nextSlide()">&#9654;</button>
<button class="carousel-button" id = "prev-btn" onclick="prevSlide()">&#9664;</button>
<button class="carousel-button" id = "next-btn" onclick="nextSlide()">&#9654;</button>
</div>
</div>
<script>
Expand All @@ -283,29 +283,127 @@ <h3>Thailand</h3>
let currentSlide = 0;
const slides = document.querySelectorAll('.trip-card');
const totalSlides = slides.length;
const slidesInView = 3.5; // Set this to the number of visible slides in the container
const slideWidth = slides[0].offsetWidth + 20; // Including margin
const maxTranslateX = (totalSlides - slidesInView) * slideWidth;

function updateCarousel() {
const carousel = document.getElementById('trip-carousel');
const slideWidth = slides[0].offsetWidth + 20; // Including margin
carousel.style.transform = `translateX(-${currentSlide * slideWidth}px)`;
const translateX = -currentSlide * slideWidth;
carousel.style.transform = `translateX(${Math.max(translateX, -maxTranslateX)}px)`;
}

function updateArrows() {
document.getElementById('prev-btn').disabled = currentSlide === 0;
document.getElementById('next-btn').disabled = currentSlide >= totalSlides - slidesInView;
}

function prevSlide() {
if (currentSlide > 0) {
currentSlide--;
updateCarousel();
updateArrows();
}
}

function nextSlide() {
if (currentSlide < totalSlides - 1) {
if (currentSlide < totalSlides - slidesInView) {
currentSlide++;
updateCarousel();
updateArrows();
}
}

window.addEventListener('resize', updateCarousel);
document.addEventListener('DOMContentLoaded', updateCarousel);




// Autocomplete functionality
function autocomplete(inp, arr) {
var currentFocus;
inp.addEventListener("input", function(e) {
var a, b, i, val = this.value;
closeAllLists();
if (!val) { return false; }
currentFocus = -1;
a = document.createElement("DIV");
a.setAttribute("id", this.id + "autocomplete-list");
a.setAttribute("class", "autocomplete-items");
this.parentNode.appendChild(a);
for (i = 0; i < arr.length; i++) {
if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
b = document.createElement("DIV");
b.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
b.innerHTML += arr[i].substr(val.length);
b.innerHTML += "<input type='hidden' value='" + arr[i] + "'>";
b.addEventListener("click", function(e) {
inp.value = this.getElementsByTagName("input")[0].value;
closeAllLists();
});
a.appendChild(b);
}
}
});
inp.addEventListener("keydown", function(e) {
var x = document.getElementById(this.id + "autocomplete-list");
if (x) x = x.getElementsByTagName("div");
if (e.keyCode == 40) {
currentFocus++;
addActive(x);
} else if (e.keyCode == 38) {
currentFocus--;
addActive(x);
} else if (e.keyCode == 13) {
e.preventDefault();
if (currentFocus > -1) {
if (x) x[currentFocus].click();
}
}
});
function addActive(x) {
if (!x) return false;
removeActive(x);
if (currentFocus >= x.length) currentFocus = 0;
if (currentFocus < 0) currentFocus = (x.length - 1);
x[currentFocus].classList.add("autocomplete-active");
}
function removeActive(x) {
for (var i = 0; i < x.length; i++) {
x[i].classList.remove("autocomplete-active");
}
}
function closeAllLists(elmnt) {
var x = document.getElementsByClassName("autocomplete-items");
for (var i = 0; i < x.length; i++) {
if (elmnt != x[i] && elmnt != inp) {
x[i].parentNode.removeChild(x[i]);
}
}
}
document.addEventListener("click", function (e) {
closeAllLists(e.target);
});
}

var destinations = [
"Agra", "Amritsar", "Andaman Islands", "Bangalore", "Chennai", "Darjeeling",
"Delhi", "Goa", "Hampi", "Hyderabad", "Jaipur", "Jaisalmer", "Kochi",
"Kolkata", "Leh", "Mumbai", "Munnar", "Mysore", "Ooty", "Pondicherry",
"Pushkar", "Ranthambore", "Rishikesh", "Shimla", "Udaipur", "Varanasi",
"Aizawl", "Alleppey", "Alwar", "Badrinath", "Bhubaneswar", "Bikaner",
"Chandigarh", "Chikmagalur", "Coorg", "Daman and Diu", "Dharamshala",
"Gangtok", "Gulmarg", "Haridwar", "Imphal", "Jabalpur", "Jodhpur",
"Kanha National Park", "Kanyakumari", "Kaziranga National Park", "Khajuraho",
"Kodaikanal", "Konark", "Kovalam", "Lakshadweep", "Lonavala", "Mahabalipuram",
"Manali", "Mount Abu", "Munnar", "Nagaland", "Nainital", "Nashik",
"Pahalgam", "Patna", "Ranchi", "Shillong", "Srinagar", "Surat", "Tawang",
"Tirupati", "Trivandrum", "Ujjain", "Vadodara", "Varkala", "Vijayawada",
"Ziro Valley", "Zanskar Valley"
];

autocomplete(document.getElementById("destination"), destinations);
</script>
</body>
</html>
Loading