adding stuff

This commit is contained in:
2025-10-09 12:14:14 +01:00
parent f38a4f688a
commit dbb410b1e6
18 changed files with 55 additions and 1269 deletions
+30 -39
View File
@@ -19,7 +19,7 @@
<!-- Live Location Notification Bubble -->
<div class="notification-container">
<div class="live-location-bubble" id="locationBubble">
<!--<div class="live-location-bubble" id="locationBubble">
<div class="map-container">
<img src="cdn/map.png" alt="Map" />
</div>
@@ -32,10 +32,10 @@
</button>
<div class="location-text">Live Location</div>
<div class="location-users" id="locationUsers">
<!-- Users will be added dynamically -->
</div>
</div>
</div>
</div>-->
</div>
<!-- Messages Container -->
@@ -97,39 +97,39 @@
// Toggle location tracking
const locationBubble = document.getElementById("locationBubble");
const joinButton = document.getElementById("joinButton");
let isExpanded = false;
// const locationBubble = document.getElementById("locationBubble");
// const joinButton = document.getElementById("joinButton");
// let isExpanded = false;
locationBubble.addEventListener("click", function (e) {
// Don't toggle expanded state if clicking the join button
if (e.target.id === "joinButton") return;
// locationBubble.addEventListener("click", function (e) {
// // Don't toggle expanded state if clicking the join button
// if (e.target.id === "joinButton") return;
isExpanded = !isExpanded;
this.classList.toggle("expanded", isExpanded);
});
// isExpanded = !isExpanded;
// this.classList.toggle("expanded", isExpanded);
// });
joinButton.addEventListener("click", function (e) {
e.stopPropagation();
currentUserInLocation = !currentUserInLocation;
this.classList.toggle("active", currentUserInLocation);
this.textContent = currentUserInLocation ? "Leave" : "Join";
locationBubble.classList.toggle(
"active",
currentUserInLocation,
);
// joinButton.addEventListener("click", function (e) {
// e.stopPropagation();
// currentUserInLocation = !currentUserInLocation;
// this.classList.toggle("active", currentUserInLocation);
// this.textContent = currentUserInLocation ? "Leave" : "Join";
// locationBubble.classList.toggle(
// "active",
// currentUserInLocation,
// );
// Animate click
this.style.transform = "scale(0.95)";
setTimeout(() => {
this.style.transform = "";
}, 150);
// // Animate click
// this.style.transform = "scale(0.95)";
// setTimeout(() => {
// this.style.transform = "";
// }, 150);
updateLocationUsers();
});
// updateLocationUsers();
// });
// Initialize location users
updateLocationUsers();
// // Initialize location users
// updateLocationUsers();
// Handle message sending
const input = document.querySelector("input");
@@ -162,15 +162,6 @@
messagesContainer.scrollHeight;
}
function getCurrentTime() {
const now = new Date();
return now.toLocaleTimeString("en-GB", {
hour: "numeric",
minute: "2-digit",
hour12: true,
});
}
function sendMessage() {
const message = input.value.trim();
if (message) {