From 4ebfaf7fd06921703c2d6bebdb4f1a4a335179ef Mon Sep 17 00:00:00 2001 From: yiqiu Date: Sun, 23 Nov 2025 01:26:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E5=A4=A7=E5=8F=91=E5=8F=91=E9=A1=BA?= =?UTF-8?q?=E4=B8=B0=E9=98=BF=E9=81=93=E5=A4=AB=E6=92=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/index.css | 46 ++++++++++++++++++++++------------------------ js/tools.js | 30 ++++-------------------------- 2 files changed, 26 insertions(+), 50 deletions(-) diff --git a/css/index.css b/css/index.css index d4118c0..d57e32d 100644 --- a/css/index.css +++ b/css/index.css @@ -19,40 +19,24 @@ #index #header { z-index: 99999 !important; position: relative; + transition: background 0.3s ease !important; } #index #header { position: sticky !important; } +#index #header:hover, +#index header:hover { + background: rgba(15, 23, 42, 0.6) !important; +} + /* 首页 section-content 统一左右边距为 20px */ #index .section-content { padding-left: var(--container-padding-x); padding-right: var(--container-padding-x); } -/* 首页 Header 深色玻璃态覆盖 - 鼠标悬停变色效果 */ -#index #header { - background: transparent; - transition: background 0.3s ease; -} - -#index #header:hover { - background: rgba(15, 23, 42, 0.6); -} - -#index .nav-shadow { - background: rgba(15, 23, 42, 0.8) !important; - backdrop-filter: blur(20px); - border-bottom: 1px solid rgba(148, 163, 184, 0.15); - box-shadow: 0 4px 24px rgba(15, 23, 42, 0.4); - transition: background 0.3s ease; -} - -#index .nav-shadow:hover { - background: rgba(15, 23, 42, 0.95) !important; -} - /* 首页导航栏:使用统一的容器系统 */ #index .nav-header { max-width: var(--container-max-width); @@ -60,6 +44,19 @@ padding: 0 var(--container-padding-x); } +/* nav-shadow 样式和 hover 效果 */ +#index .nav-shadow { + background: rgba(15, 23, 42, 0.8) !important; + backdrop-filter: blur(20px); + border-bottom: 1px solid rgba(148, 163, 184, 0.15); + box-shadow: 0 4px 24px rgba(15, 23, 42, 0.4); + transition: background 0.3s ease !important; +} + +#index .nav-shadow:hover { + background: rgba(15, 23, 42, 0.95) !important; +} + /* 首页导航文字颜色 */ #index .nav-menu .nav-item { color: #E5E7EB; @@ -423,13 +420,14 @@ ============================================ */ .hot-products { - margin-top: 60px; + margin-top: 0; padding: 40px 0; background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.05) 0%, transparent 60%), rgba(15, 23, 42, 0.6); border: 1px solid rgba(148, 163, 184, 0.15); - border-radius: 16px; + border-top: none; + border-radius: 0 0 16px 16px; backdrop-filter: blur(10px); } diff --git a/js/tools.js b/js/tools.js index e06c783..3181c8d 100644 --- a/js/tools.js +++ b/js/tools.js @@ -1,9 +1,6 @@ $(function () { - console.log('tools.js loaded'); - // 产品详情页的图片预览轮播(仅在存在时初始化) if ($('.gallery-thumbs').length > 0 && $('.gallery-top').length > 0) { - console.log('Initializing gallery swiper'); var galleryThumbs = new Swiper('.gallery-thumbs', { spaceBetween: 10, slidesPerView: 10, @@ -26,56 +23,37 @@ $(function () { // 首页 Banner 轮播(仅在存在时初始化) if ($('.banner-cont').length > 0) { - console.log('Found .banner-cont, initializing banner swiper'); - console.log('Number of slides:', $('.banner-cont .swiper-slide').length); - const mySwiper = new Swiper(".banner-cont", { - loop: true, // 循环模式选项 + loop: true, autoplay: { - delay: 5000, // 5秒自动切换 - disableOnInteraction: false, // 用户操作后继续自动播放 + delay: 5000, + disableOnInteraction: false, }, - speed: 800, // 切换速度 - // 分页器配置 + speed: 800, pagination: { el: ".swiper-pagination", clickable: true, type: 'bullets', }, - // 监听切换事件,重置进度条动画 on: { slideChange: function () { - console.log('Slide changed'); - // 移除所有进度条动画 document.querySelectorAll('.banner-cont .swiper-pagination-bullet').forEach(function(bullet) { bullet.classList.remove('progress-active'); }); - // 给当前激活的添加进度动画 const activeBullet = document.querySelector('.banner-cont .swiper-pagination-bullet-active'); if (activeBullet) { activeBullet.classList.add('progress-active'); - console.log('Added progress-active to bullet'); } }, init: function () { - console.log('Swiper initialized'); - console.log('Pagination bullets:', document.querySelectorAll('.swiper-pagination-bullet').length); - // 初始化时给第一个添加进度动画 setTimeout(function() { const activeBullet = document.querySelector('.banner-cont .swiper-pagination-bullet-active'); if (activeBullet) { activeBullet.classList.add('progress-active'); - console.log('Added initial progress-active to bullet'); - } else { - console.log('No active bullet found'); } }, 100); } } }); - - console.log('Banner swiper created:', mySwiper); - } else { - console.log('.banner-cont not found'); } })