cument.getElementById('krpanoSWFObject'); if (krpano) { if (autorotateOn) { krpano.set('autorotate.enabled', true); showHint('自动旋转已开启'); } else { krpano.set('autorotate.enabled', false); showHint('自动旋转已关闭'); } } } catch(e) {} if (btn) { btn.classList.toggle('active', autorotateOn); } } var gyroOn = false; function toggleGyro() { gyroOn = !gyroOn; var btn = document.getElementById('btnGyro'); try { var krpano = document.getElementById('krpanoSWFObject'); if (krpano) { if (gyroOn) { krpano.call('startGyro();'); showHint('陀螺仪已开启'); } else { krpano.call('stopGyro();'); showHint('陀螺仪已关闭'); } } } catch(e) {} if (btn) btn.classList.toggle('active', gyroOn); } function resetView() { try { var krpano = document.getElementById('krpanoSWFObject'); if (krpano) { krpano.set('view.hlookat', 0); krpano.set('view.vlookat', 0); krpano.set('view.fov', 90); } var zoom = document.getElementById('zoomSlider'); if (zoom) zoom.value = 90; showHint('视角已重置'); } catch(e) {} } // ========== Toast提示 ========== var hintTimer; function showHint(text, duration) { duration = duration || 2000; var el = document.getElementById('vrHintToast'); if (!el) return; el.textContent = text; el.classList.add('show'); clearTimeout(hintTimer); hintTimer = setTimeout(function() { el.classList.remove('show'); }, duration); } // ========== 分享面板 ========== var sharePanelOpen = false; function toggleSharePanel() { sharePanelOpen = !sharePanelOpen; var panel = document.getElementById('vrSharePanel'); if (panel) panel.classList.toggle('show', sharePanelOpen); } // 点击外部关闭 document.addEventListener('click', function(e) { var panel = document.getElementById('vrSharePanel'); var btn = document.getElementById('btnShare'); if (panel && sharePanelOpen) { if (!panel.contains(e.target) && !btn.contains(e.target)) { panel.classList.remove('show'); sharePanelOpen = false; } } }); function shareToWechat() { showHint('请在微信中打开后分享'); document.getElementById('vrSharePanel').classList.remove('show'); } function shareToQQ() { var url = 'http://connect.qq.com/widget/shareqq/index.html?url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(_title) + '&desc=' + encodeURIComponent(_content || '') + '&pics=' + encodeURIComponent(_imgUrl || ''); window.open(url, '_blank'); document.getElementById('vrSharePanel').classList.remove('show'); } function shareToWeibo() { var url = 'http://service.weibo.com/share/share.php?url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(_title) + '&pic=' + encodeURIComponent(_imgUrl || ''); window.open(url, '_blank'); document.getElementById('vrSharePanel').classList.remove('show'); } function copyLink() { var input = document.createElement('input'); input.value = location.href; document.body.appendChild(input); input.select(); document.execCommand('Copy'); document.body.removeChild(input); showHint('链接已复制到剪贴板'); document.getElementById('vrSharePanel').classList.remove('show'); } // ========== 收藏 ========== var isFavorited = false; function toggleFavorite() { isFavorited = !isFavorited; var btn = document.getElementById('btnFavorite'); if (btn) btn.classList.toggle('liked', isFavorited); if (isFavorited) { showHint('已添加收藏'); // 调用后端收藏接口 $.post('/tour.php', {ldelim}act: 'favorite', id: '{$pro.pk_works_main}'}, function() {}, 'json'); } else { showHint('已取消收藏'); } } // ========== 评论 ========== function showComments() { showHint('评论功能开发中'); } // ========== 热点卡片 ========== var currentHotspotTarget = ''; function showHotspotCard(img, title, desc, target) { currentHotspotTarget = target; var card = document.getElementById('vrHotspotCard'); var imgEl = document.getElementById('hotspotImg'); var titleEl = document.getElementById('hotspotTitle'); var descEl = document.getElementById('hotspotDesc'); if (imgEl) imgEl.src = img || ''; if (titleEl) titleEl.textContent = title || ''; if (descEl) descEl.textContent = desc || ''; if (card) { card.style.left = '50%'; card.style.top = '50%'; card.style.transform = 'translate(-50%,-50%)'; card.classList.add('show'); } } function closeHotspotCard() { var card = document.getElementById('vrHotspotCard'); if (card) card.classList.remove('show'); } function navigateToHotspot() { if (currentHotspotTarget) { gotoScene(currentHotspotTarget); } closeHotspotCard(); } // ========== 导览 ========== function startTourGuide() { var btn = document.getElementById('vrTourGuideBtn'); var controls = document.getElementById('vrTourControls'); if (btn) btn.style.display = 'none'; if (controls) controls.style.display = 'flex'; try { var krpano = document.getElementById('krpanoSWFObject'); if (krpano) krpano.call('startTourGuide();'); } catch(e) {} } // ========== 搜索 ========== document.getElementById('vrSearchInput').addEventListener('keypress', function(e) { if (e.key === 'Enter') { var q = this.value.trim(); if (q) { location.href = '/search.php?q=' + encodeURIComponent(q); } } }); // ========== 全屏按钮状态 ========== function showFullscreenBtn() { var btn = document.getElementById('btnFullscreen'); if (btn) btn.style.display = 'flex'; } function hideShareAndFootmarkBtn() { // 移动端隐藏一些按钮 } // ========== 置顶导航栏滚动效果 ========== window.addEventListener('scroll', function() { var topbar = document.getElementById('vrTopbar'); if (topbar) topbar.classList.toggle('scrolled', window.scrollY > 10); }); // ========== 键盘快捷键 ========== document.addEventListener('keydown', function(e) { if (e.key === 'ArrowLeft') prevScene(); if (e.key === 'ArrowRight') nextScene(); if (e.key === 'f' || e.key === 'F') { var btn = document.getElementById('btnFullscreen'); if (btn) btn.click(); } if (e.key === 'Escape') { closeHotspotCard(); var panel = document.getElementById('vrSharePanel'); if (panel) panel.classList.remove('show'); } }); // ========== 触控手势支持 ========== var touchStartX = 0; document.addEventListener('touchstart', function(e) { touchStartX = e.touches[0].clientX; }); document.addEventListener('touchend', function(e) { var dx = e.changedTouches[0].clientX - touchStartX; if (Math.abs(dx) > 80) { if (dx > 0) prevScene(); else nextScene(); } }); 松柏ⱽᴿ · 邹圩 | VRLNK⚡CITY
0%
加载中,请稍候...
松柏ⱽᴿ · 邹圩 | VRLNK⚡CITY
AI 作品解读
《松柏ⱽᴿ · 邹圩 | VRLNK⚡CITY》是一组以松林、乡镇风貌为主题的 VR 全景作品,支持沉浸式云端漫游、VR 眼镜与多端浏览。
登录 注册
N
分享到
微信
Q
QQ
WB
微博
复制