优化泡泡手机端

This commit is contained in:
jeremygan2021
2026-01-21 22:00:33 +08:00
parent 5dad2533df
commit b97c9f548d
2 changed files with 15 additions and 10 deletions

View File

@@ -799,7 +799,7 @@
const data = await response.json(); const data = await response.json();
if (response.ok) { if (response.ok) {
document.getElementById('success-btn').textContent = payload.name + '前往活动'; document.getElementById('success-btn').textContent = payload.name + '/点击进入活动大厅';
if (CONFIG.enable_seating !== false) { if (CONFIG.enable_seating !== false) {
// Show assigned seat // Show assigned seat
document.getElementById('seat-display').textContent = data.seat || "自由席"; document.getElementById('seat-display').textContent = data.seat || "自由席";

View File

@@ -376,6 +376,8 @@
speed: 1.5, // Floating speed speed: 1.5, // Floating speed
}; };
const isMobile = () => window.innerWidth <= 768;
const SHOW_VISION = {{ 'true' if show.vision_2026 != false else 'false' }}; const SHOW_VISION = {{ 'true' if show.vision_2026 != false else 'false' }};
const SHOW_SCOPE = {{ 'true' if show.business_scope != false else 'false' }}; const SHOW_SCOPE = {{ 'true' if show.business_scope != false else 'false' }};
@@ -630,7 +632,7 @@
startRotationTimer(); startRotationTimer();
// Trigger spotlight for newest // Trigger spotlight for newest
if (currentIndex === 0 && allUsers.length > 0) { if (currentIndex === 0 && allUsers.length > 0 && !isMobile()) {
// Maybe spotlight the very first one // Maybe spotlight the very first one
updateCard(allUsers[0]); updateCard(allUsers[0]);
// Restart spotlight loop // Restart spotlight loop
@@ -647,7 +649,7 @@
if (bubbles.length === 0 && allUsers.length > 0) { if (bubbles.length === 0 && allUsers.length > 0) {
updateDisplay(); updateDisplay();
startRotationTimer(); startRotationTimer();
startSpotlight(); if (!isMobile()) startSpotlight();
} }
} }
} }
@@ -687,15 +689,16 @@
} }
function startSpotlight() { function startSpotlight() {
if (isMobile()) return;
if (spotlightInterval) clearInterval(spotlightInterval); if (spotlightInterval) clearInterval(spotlightInterval);
showNextUser(); showNextUser();
spotlightInterval = setInterval(showNextUser, 8000); spotlightInterval = setInterval(showNextUser, 8000);
} }
function showNextUser() { function showNextUser() {
if (users.length === 0) return; if (displayedUsers.length === 0) return;
const user = users[currentIndex]; const user = displayedUsers[currentIndex];
currentIndex = (currentIndex + 1) % users.length; currentIndex = (currentIndex + 1) % displayedUsers.length;
updateCard(user); updateCard(user);
} }
@@ -706,11 +709,13 @@
// Show clicked user immediately // Show clicked user immediately
updateCard(user); updateCard(user);
// Resume auto-rotation after 15 seconds // Resume auto-rotation after 15 seconds (only on desktop)
if (!isMobile()) {
spotlightInterval = setTimeout(() => { spotlightInterval = setTimeout(() => {
startSpotlight(); startSpotlight();
}, 15000); }, 15000);
} }
}
// Initial Load // Initial Load
fetchData(); fetchData();