// 页面加载完成后执行
document.addEventListener('DOMContentLoaded', function () {
+
// 获取游戏ID
const gameId = new URLSearchParams(window.location.search).get('id');
if (!gameId) {
@@ -261,6 +294,40 @@
});
}
+
+ const swiper = new Swiper('.game-swiper', {
+ slidesPerView: 1,
+ spaceBetween: 30,
+ loop: true,
+ autoplay: {
+ delay: 3000,
+ disableOnInteraction: false,
+ },
+ pagination: {
+ el: '.swiper-pagination',
+ clickable: true,
+ },
+ navigation: {
+ nextEl: '.swiper-button-next',
+ prevEl: '.swiper-button-prev',
+ },
+ });
+
+ // 初始化 Lightbox
+ lightbox.option({
+ 'resizeDuration': 200,
+ 'wrapAround': true,
+ 'albumLabel': "图片 %1 / %2",
+ 'fadeDuration': 300,
+ 'imageFadeDuration': 300,
+ 'positionFromTop': 100,
+ 'maxWidth': 1200,
+ 'maxHeight': 800,
+ 'disableScrolling': true,
+ 'showImageNumberLabel': true,
+ 'alwaysShowNavOnTouchDevices': true
+ });
+
//复制分享码
const codeBtn = document.getElementById('codeBtn');
if (codeBtn) {
@@ -292,23 +359,21 @@
// 返回顶部功能
const goToTop = document.getElementById('goToTop');
-
- // 监听滚动事件
- window.addEventListener('scroll', function () {
- if (window.pageYOffset > 300) {
- goToTop.classList.add('show');
- } else {
- goToTop.classList.remove('show');
- }
- });
-
- // 点击返回顶部
- goToTop.addEventListener('click', function () {
- window.scrollTo({
- top: 0,
- behavior: 'smooth'
+ if (goToTop) {
+ window.addEventListener('scroll', function () {
+ if (window.pageYOffset > 300) {
+ goToTop.classList.add('show');
+ } else {
+ goToTop.classList.remove('show');
+ }
});
- });
+ goToTop.addEventListener('click', function () {
+ window.scrollTo({
+ top: 0,
+ behavior: 'smooth'
+ });
+ });
+ }
});
// 更新游戏访问次数
@@ -393,7 +458,7 @@
.detail-top-right {
width: 30%;
- border-left: 1px solid #eee ;
+ border-left: 1px solid #eee;
margin: 20px;
}
@@ -754,6 +819,25 @@
background-color: #0081ff12;
border-radius: 5px;
}
+
+ .detail-top-card-left {
+ width: 350px;
+ }
+
+ .swiper .swiper-button-prev,
+ .swiper .swiper-button-next {
+ color: #3881fd;
+ background: rgba(255, 255, 255, 0.9);
+ width: 40px;
+ height: 40px;
+ border-radius: 50%;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ }
+
+ .swiper .swiper-button-prev:after,
+ .swiper .swiper-button-next:after {
+ font-size: 18px;
+ }
{include file="component/foot" /}
\ No newline at end of file
diff --git a/runtime/admin/temp/606cb5a28477c3a4a33c90fc473c4624.php b/runtime/admin/temp/606cb5a28477c3a4a33c90fc473c4624.php
index fafc318..6edc76a 100644
--- a/runtime/admin/temp/606cb5a28477c3a4a33c90fc473c4624.php
+++ b/runtime/admin/temp/606cb5a28477c3a4a33c90fc473c4624.php
@@ -1,4 +1,4 @@
-
+
@@ -192,7 +192,10 @@
$image): $mod = ($i % 2 );++$i;?>
-
 $image); ?>)
+
-
 $resource['images']); ?>)
+
-
+