-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript3.js
More file actions
81 lines (66 loc) · 2.81 KB
/
script3.js
File metadata and controls
81 lines (66 loc) · 2.81 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Countdown Timer Script
function updateCountdown() {
const eventDate = new Date("2025-02-13T00:00:00Z").getTime();
const currentTime = new Date().getTime();
const timeDifference = eventDate - currentTime;
const days = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
const hours = Math.floor((timeDifference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
const timerElement = document.getElementById("timer");
timerElement.innerHTML = `${days}d ${hours}h ${minutes}m ${seconds}s`;
// Refresh every second
setTimeout(updateCountdown, 1000);
}
updateCountdown();
function initMap() {
const festLocation = { lat: 28.7041, lng: 77.1025 }; // Example: Coordinates for New Delhi
const map = new google.maps.Map(document.getElementById("map-container"), {
zoom: 15,
center: festLocation,
});
const marker = new google.maps.Marker({
position: festLocation,
map: map,
title: "Time Travel Fest Location",
});
}
function click() {
let btn = document.getElementsByClassName(".tickets");
btn.addEventListener("click", function() {
window.location.href = "https://docs.google.com/forms/d/e/1FAIpQLSdoHz54mGROyAz_oRzLXOazWG15frOfgFKJGr8KsijqpijabA/viewform?usp=dialog"
});
}
// let currentIndex = 0;
// const slides = document.querySelector(".slides");
// const totalSlides = document.querySelectorAll(".slides img").length;
// function nextSlide() {
// currentIndex++;
// if (currentIndex >= totalSlides) {
// currentIndex = 0; // Loop back to first slide
// }
// slides.style.transform = `translateX(${-currentIndex * 600}px)`;
// }
// // Change slide every 3 seconds
// setInterval(nextSlide, 3000);
function uploadPhoto() {
const fileInput = document.getElementById("upload-file");
const uploadedPhotosContainer = document.getElementById("uploaded-photos");
if (fileInput.files.length === 0) {
alert("Please select a file to upload.");
return;
}
const file = fileInput.files[0];
const reader = new FileReader();
reader.onload = function (event) {
const img = document.createElement("img");
img.src = event.target.result;
img.classList.add("uploaded-image"); // Add a CSS class for styling
const imgContainer = document.createElement("div");
imgContainer.classList.add("photo-container"); // Add a wrapper div
imgContainer.appendChild(img);
uploadedPhotosContainer.appendChild(imgContainer);
};
reader.readAsDataURL(file);
fileInput.value = ""; // Clear file input after upload
}