Przeglądaj źródła

简化教育学院首页轮播

将教育学院首页首屏改为参考车辆学院样式的普通图片轮播,移除气球、球类、彩虹等浮动装饰以及标题、说明和按钮叠加层。\n轮播按后台首页轮播文章的缩略图展示,保留自动切换、左右箭头、圆点导航和无障碍状态同步,并补齐桌面与移动端尺寸适配。\n\nValidation:\n- 本地教育学院首页浏览器渲染通过,轮播图 3 张、箭头 2 个、圆点 3 个,无脚本错误。\n- 1440px 与 390px 视口检查无横向溢出,移动端轮播高度 340px。
非繁 1 tydzień temu
rodzic
commit
e5521f11d3

+ 18 - 40
WebRoot/main/ffkj-portal/education-college.css

@@ -66,35 +66,18 @@ ul{list-style:none}
 .edu-menu-mask{position:fixed;inset:0;z-index:70;background:rgba(50,8,16,.5);opacity:0;pointer-events:none;transition:opacity .25s}
 .edu-menu-mask.is-open{opacity:1;pointer-events:auto}
 
-/* 首页首屏 */
-.edu-hero{position:relative;height:347px;overflow:hidden;background:linear-gradient(120deg,#fdf7f2 0%,#f4d8d8 54%,#e2b4b6 100%);isolation:isolate}
-.edu-hero::before,.edu-hero::after{content:"";position:absolute;z-index:0;border-radius:50%;pointer-events:none}
-.edu-hero::before{left:-110px;top:-180px;width:430px;height:430px;background:rgba(255,255,255,.3)}
-.edu-hero::after{right:-70px;bottom:-170px;width:360px;height:360px;background:rgba(163,38,60,.08)}
-.edu-hero-scene{position:absolute;inset:0;z-index:0;opacity:.9}
-.edu-hero-scene svg{width:100%;height:100%}
-.edu-hero-decor{position:absolute;z-index:1;pointer-events:none;filter:drop-shadow(0 5px 10px rgba(163,38,60,.2));animation:eduFloat 5.4s ease-in-out infinite}
-.edu-hero-decor.d1{left:5%;top:18%;font-size:40px}
-.edu-hero-decor.d2{right:7%;top:15%;font-size:32px;animation-delay:.8s}
-.edu-hero-decor.d3{left:11%;bottom:9%;font-size:36px;animation:eduSway 4.8s ease-in-out infinite}
-.edu-hero-decor.d4{right:12%;bottom:13%;font-size:30px;animation-delay:1.2s}
-.edu-hero-decor.d5{left:47%;top:7%;font-size:43px;opacity:.75;animation:eduSway 7s ease-in-out infinite .4s}
-.edu-hero-decor.d6{right:31%;bottom:6%;font-size:31px;animation:eduBob 3.6s ease-in-out infinite}
-.edu-hero-slides,.edu-hero-slide{position:absolute;inset:0}
-.edu-hero-slide{display:grid;place-items:center;padding:22px 20px 36px;text-align:center;color:#5f1420;opacity:0;transform:translateY(12px);transition:opacity .55s ease,transform .55s ease;pointer-events:none}
-.edu-hero-slide.is-active{opacity:1;transform:translateY(0);pointer-events:auto}
-.edu-hero-copy{position:relative;z-index:2;max-width:850px;margin:0 auto}
-.edu-hero-tag{display:inline-block;margin-bottom:14px;padding:4px 18px;border:1px solid rgba(180,50,70,.45);border-radius:99px;background:rgba(255,255,255,.62);color:var(--edu-wine);font-size:12px;font-weight:600;letter-spacing:.22em}
-.edu-hero-title{font-family:"STZhongsong","Songti SC",serif;font-size:40px;font-weight:900;line-height:1.35;letter-spacing:.1em;color:var(--edu-wine-deep);text-shadow:0 2px 0 rgba(255,255,255,.55)}
-.edu-hero-title small{display:block;margin-top:7px;font-family:"Microsoft YaHei","PingFang SC",sans-serif;font-size:15px;font-weight:500;line-height:1.8;letter-spacing:.08em;color:#6c343b;text-shadow:none}
-.edu-hero-btn{display:inline-flex;align-items:center;justify-content:center;min-width:154px;height:40px;margin-top:18px;padding:0 22px;border-radius:22px;background:linear-gradient(100deg,var(--edu-wine),var(--edu-wine-soft));color:#fff;font-size:14px;font-weight:700;box-shadow:0 7px 18px rgba(122,28,44,.22);transition:transform .2s,box-shadow .2s}
-.edu-hero-btn:hover,.edu-hero-btn:focus-visible{transform:translateY(-2px);box-shadow:0 10px 22px rgba(122,28,44,.3)}
-.edu-hero-dots{position:absolute;left:50%;bottom:13px;z-index:4;display:flex;gap:7px;transform:translateX(-50%)}
-.edu-hero-dot{width:7px;height:7px;padding:0;border:0;border-radius:99px;background:rgba(122,28,44,.28);transition:.2s}
-.edu-hero-dot.is-active{width:22px;background:var(--edu-wine)}
-@keyframes eduFloat{0%,100%{transform:translateY(0) rotate(-5deg)}50%{transform:translateY(-18px) rotate(6deg)}}
-@keyframes eduSway{0%,100%{transform:translateX(0) rotate(-7deg)}50%{transform:translateX(15px) rotate(7deg)}}
-@keyframes eduBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-9px)}}
+/* 首页首屏轮播 */
+.edu-hero{position:relative;height:440px;overflow:hidden;background:#2d1118}
+.edu-hero-track{display:flex;width:100%;height:100%;transition:transform .65s ease}
+.edu-hero-slide{position:relative;flex:0 0 100%;display:block;width:100%;height:100%;overflow:hidden}
+.edu-hero-bg{display:block;width:100%;height:100%;object-fit:cover}
+.edu-hero-arrow{position:absolute;top:50%;z-index:4;display:flex;align-items:center;justify-content:center;width:46px;height:46px;padding:0;border:1px solid rgba(255,255,255,.4);border-radius:50%;background:rgba(54,13,23,.38);color:#fff;font-size:28px;line-height:1;transform:translateY(-50%);transition:background .2s,border-color .2s}
+.edu-hero-arrow:hover,.edu-hero-arrow:focus-visible{background:rgba(122,28,44,.82);border-color:#fff}
+.edu-hero-arrow.prev{left:20px}
+.edu-hero-arrow.next{right:20px}
+.edu-hero-dots{position:absolute;left:50%;bottom:22px;z-index:4;display:flex;gap:9px;transform:translateX(-50%)}
+.edu-hero-dot{width:9px;height:9px;padding:0;border:0;border-radius:20px;background:rgba(255,255,255,.5);transition:.2s}
+.edu-hero-dot.is-active{width:28px;background:#fff}
 
 /* 公告条 */
 .edu-notice-section{padding:18px 0 4px}
@@ -303,9 +286,7 @@ ul{list-style:none}
   .edu-brand-logo{width:min(290px,52vw);max-height:60px}
   .edu-top-links{display:none}
   .edu-top-search input{width:132px}
-  .edu-hero{height:340px}
-  .edu-hero-title{font-size:32px}
-  .edu-hero-title small{font-size:14px}
+  .edu-hero{height:420px}
   .edu-news-card,.edu-twin{grid-template-columns:1fr}
   .edu-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
   .edu-footer-main{grid-template-columns:1fr 1fr;gap:30px}
@@ -323,11 +304,9 @@ ul{list-style:none}
   .edu-top-search input{display:none}
   .edu-top-search button{width:38px}
   .edu-nav-toggle{display:flex}
-  .edu-hero{height:355px}
-  .edu-hero-decor.d1,.edu-hero-decor.d2{font-size:27px}
-  .edu-hero-decor.d3,.edu-hero-decor.d4,.edu-hero-decor.d5,.edu-hero-decor.d6{display:none}
-  .edu-hero-title{font-size:29px;letter-spacing:.05em}
-  .edu-hero-title small{font-size:13px}
+  .edu-hero{height:380px}
+  .edu-hero-arrow.prev{left:8px}
+  .edu-hero-arrow.next{right:8px}
   .edu-notice{grid-template-columns:auto minmax(0,1fr);gap:10px;padding-right:12px}
   .edu-notice>.edu-more{display:none}
   .edu-notice-item{display:block;padding:8px 0}
@@ -357,9 +336,8 @@ ul{list-style:none}
 }
 @media (max-width:430px){
   .edu-brand-logo{width:min(190px,64vw)}
-  .edu-hero-tag{letter-spacing:.12em}
-  .edu-hero-title{font-size:25px}
-  .edu-hero-title small{font-size:12px;letter-spacing:.02em}
+  .edu-hero{height:340px}
+  .edu-hero-arrow{display:none}
   .edu-section-title{font-size:23px}
   .edu-section-head{margin-bottom:14px}
   .edu-news-card{padding:12px}

+ 22 - 38
WebRoot/web/upload/ffkj-template/education-index.jsp

@@ -30,56 +30,34 @@
 	<meta name="description" content="${website.seoDescription}">
 	<title>${empty website.seoTitle ? website.name : website.seoTitle}</title>
 	<link rel="icon" href="${empty website.seoIcon ? website.logo : website.seoIcon}?v=20261106-education-1">
-	<link rel="stylesheet" href="/main/ffkj-portal/education-college.css?v=20261108-education-logo-1">
+	<link rel="stylesheet" href="/main/ffkj-portal/education-college.css?v=20261120-plain-carousel-1">
 </head>
 <body class="education-page">
 	<%@ include file="education-header.jsp"%>
 	<main>
 		<h1 class="edu-sr-only">${empty website.seoTitle ? website.name : website.seoTitle}</h1>
-		<section class="edu-hero" aria-label="教育学院首页横幅">
-			<div class="edu-hero-scene" aria-hidden="true">
-				<svg viewBox="0 0 1200 347" preserveAspectRatio="none">
-					<path d="M0,230 C320,170 720,270 1200,200 L1200,347 L0,347 Z" fill="rgba(255,255,255,.14)"/>
-					<path d="M0,270 C420,220 820,300 1200,240 L1200,347 L0,347 Z" fill="rgba(255,255,255,.16)"/>
-					<circle cx="960" cy="90" r="56" fill="none" stroke="rgba(255,255,255,.22)" stroke-width="6"/>
-					<circle cx="960" cy="90" r="32" fill="rgba(255,255,255,.14)"/>
-					<rect x="80" y="150" width="6" height="70" rx="3" fill="rgba(255,255,255,.18)"/>
-					<rect x="100" y="170" width="6" height="50" rx="3" fill="rgba(255,255,255,.13)"/>
-				</svg>
-			</div>
-			<span class="edu-hero-decor d1" aria-hidden="true">🎈</span>
-			<span class="edu-hero-decor d2" aria-hidden="true">🎈</span>
-			<span class="edu-hero-decor d3" aria-hidden="true">⚽</span>
-			<span class="edu-hero-decor d4" aria-hidden="true">🎈</span>
-			<span class="edu-hero-decor d5" aria-hidden="true">🌈</span>
-			<span class="edu-hero-decor d6" aria-hidden="true">🏃</span>
-			<div class="edu-hero-slides" data-education-hero>
+		<section class="edu-hero" data-education-hero aria-label="教育学院首页轮播" aria-roledescription="轮播">
+			<div class="edu-hero-track">
 				<c:choose>
 					<c:when test="${not empty educationHeroNmv.articleList}">
 						<c:forEach items="${educationHeroNmv.articleList}" var="item" varStatus="vs">
-							<article class="edu-hero-slide ${vs.first ? 'is-active' : ''}" data-education-hero-slide aria-hidden="${vs.first ? 'false' : 'true'}">
-								<div class="edu-hero-copy">
-									<span class="edu-hero-tag">立德树人 · 以文化人</span>
-									<h2 class="edu-hero-title">${item.title}<small>${empty item.desc ? '建设有温度、有底蕴、有担当的教师教育高地' : item.desc}</small></h2>
-									<a class="edu-hero-btn" href="${empty item.url ? aboutHref : item.url}" target="${item.target}" rel="noopener">走进教育学院</a>
-								</div>
-							</article>
+							<a class="edu-hero-slide ${vs.first ? 'is-active' : ''}" data-education-hero-slide href="${empty item.url ? aboutHref : item.url}" target="${item.target}" rel="noopener" aria-label="${item.title}" aria-hidden="${vs.first ? 'false' : 'true'}" tabindex="${vs.first ? '0' : '-1'}">
+								<img class="edu-hero-bg" src="${empty item.thumbnail ? educationDefaultImage : item.thumbnail}" alt="">
+							</a>
 						</c:forEach>
 					</c:when>
 					<c:otherwise>
-						<article class="edu-hero-slide is-active" data-education-hero-slide aria-hidden="false">
-							<div class="edu-hero-copy">
-								<span class="edu-hero-tag">立德树人 · 以文化人</span>
-								<h2 class="edu-hero-title">启智润心 育见未来<small>建设有温度、有底蕴、有担当的教师教育高地</small></h2>
-								<a class="edu-hero-btn" href="${aboutHref}">走进教育学院</a>
-							</div>
-						</article>
+						<a class="edu-hero-slide is-active" data-education-hero-slide href="${aboutHref}" aria-label="走进教育学院" aria-hidden="false" tabindex="0">
+							<img class="edu-hero-bg" src="${educationDefaultImage}" alt="">
+						</a>
 					</c:otherwise>
 				</c:choose>
 			</div>
 			<c:if test="${fn:length(educationHeroNmv.articleList) > 1}">
-				<div class="edu-hero-dots" aria-label="首页横幅切换">
-					<c:forEach items="${educationHeroNmv.articleList}" var="item" varStatus="vs"><button class="edu-hero-dot ${vs.first ? 'is-active' : ''}" type="button" data-education-hero-dot="${vs.index}" aria-label="第 ${vs.count} 张横幅" aria-pressed="${vs.first ? 'true' : 'false'}"></button></c:forEach>
+				<button class="edu-hero-arrow prev" type="button" data-education-hero-prev aria-label="上一张">‹</button>
+				<button class="edu-hero-arrow next" type="button" data-education-hero-next aria-label="下一张">›</button>
+				<div class="edu-hero-dots" aria-label="首页轮播切换">
+					<c:forEach items="${educationHeroNmv.articleList}" var="item" varStatus="vs"><button class="edu-hero-dot ${vs.first ? 'is-active' : ''}" type="button" data-education-hero-dot="${vs.index}" aria-label="第 ${vs.count} 张轮播图" aria-pressed="${vs.first ? 'true' : 'false'}"></button></c:forEach>
 				</div>
 			</c:if>
 		</section>
@@ -245,23 +223,29 @@
 	(function () {
 	  var root = document.querySelector('[data-education-hero]');
 	  if (!root) return;
+	  var track = root.querySelector('.edu-hero-track');
 	  var slides = Array.prototype.slice.call(root.querySelectorAll('[data-education-hero-slide]'));
-	  var dots = Array.prototype.slice.call(document.querySelectorAll('[data-education-hero-dot]'));
-	  if (slides.length < 2) return;
+	  var dots = Array.prototype.slice.call(root.querySelectorAll('[data-education-hero-dot]'));
+	  var prev = root.querySelector('[data-education-hero-prev]');
+	  var next = root.querySelector('[data-education-hero-next]');
+	  if (!track || slides.length < 2) return;
 	  var current = 0;
 	  var timer = null;
 	  var reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
 	  function activate(index) {
 	    current = (index + slides.length) % slides.length;
+	    track.style.transform = 'translateX(' + (-current * 100) + '%)';
 	    slides.forEach(function (slide, i) {
 	      slide.classList.toggle('is-active', i === current);
 	      slide.setAttribute('aria-hidden', i === current ? 'false' : 'true');
-	      slide.inert = i !== current;
+	      slide.tabIndex = i === current ? 0 : -1;
 	    });
 	    dots.forEach(function (dot, i) { dot.classList.toggle('is-active', i === current); dot.setAttribute('aria-pressed', i === current ? 'true' : 'false'); });
 	  }
 	  function stop() { if (timer) { window.clearInterval(timer); timer = null; } }
 	  function start() { stop(); if (!reduceMotion) timer = window.setInterval(function () { activate(current + 1); }, 5600); }
+	  if (prev) prev.addEventListener('click', function () { activate(current - 1); start(); });
+	  if (next) next.addEventListener('click', function () { activate(current + 1); start(); });
 	  dots.forEach(function (dot) { dot.addEventListener('click', function () { activate(Number(dot.getAttribute('data-education-hero-dot'))); start(); }); });
 	  root.addEventListener('mouseenter', stop);
 	  root.addEventListener('mouseleave', start);