|
@@ -12,7 +12,7 @@
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
<title>${website.seoTitle}</title>
|
|
<title>${website.seoTitle}</title>
|
|
|
<meta name="description" content="${website.seoDescription}">
|
|
<meta name="description" content="${website.seoDescription}">
|
|
|
- <link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20260921-news-red-layout-cleanup">
|
|
|
|
|
|
|
+ <link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20260922-campus-carousel">
|
|
|
</head>
|
|
</head>
|
|
|
<body class="screen-red-theme">
|
|
<body class="screen-red-theme">
|
|
|
<%@ include file="news-red-header.jsp"%>
|
|
<%@ include file="news-red-header.jsp"%>
|
|
@@ -21,16 +21,29 @@
|
|
|
<section class="section" id="campus">
|
|
<section class="section" id="campus">
|
|
|
<div class="section-title"><h2>${empty newsRedCampusNmv.navigationMap.name ? '校园新闻' : newsRedCampusNmv.navigationMap.name}</h2><em>CAMPUS NEWS</em><a class="more" href="${newsRedCampusNmv.navigationMap.url}">更多 →</a></div>
|
|
<div class="section-title"><h2>${empty newsRedCampusNmv.navigationMap.name ? '校园新闻' : newsRedCampusNmv.navigationMap.name}</h2><em>CAMPUS NEWS</em><a class="more" href="${newsRedCampusNmv.navigationMap.url}">更多 →</a></div>
|
|
|
<div class="feature">
|
|
<div class="feature">
|
|
|
- <c:forEach items="${newsRedCampusNmv.articleList}" var="item" varStatus="vs">
|
|
|
|
|
- <c:if test="${vs.first}">
|
|
|
|
|
- <a class="feature-image-link" href="${item.url}" target="${item.target}">
|
|
|
|
|
- <img class="feature-image" src="${empty item.thumbnail ? defaultFeatureImage : item.thumbnail}" alt="${item.title}">
|
|
|
|
|
- <div class="feature-caption">
|
|
|
|
|
- <h3>${item.title}</h3>
|
|
|
|
|
|
|
+ <div class="campus-feature-carousel" data-campus-feature-carousel>
|
|
|
|
|
+ <div class="campus-feature-images">
|
|
|
|
|
+ <c:forEach items="${newsRedCampusCarouselNmv.articleList}" var="item" varStatus="vs">
|
|
|
|
|
+ <a class="campus-feature-slide${vs.first ? ' is-active' : ''}" data-campus-feature-slide="${vs.index}" href="${item.url}" target="${item.target}" aria-hidden="${vs.first ? 'false' : 'true'}">
|
|
|
|
|
+ <img class="feature-image" src="${item.thumbnail}" alt="${item.title}">
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </c:forEach>
|
|
|
|
|
+ <c:if test="${fn:length(newsRedCampusCarouselNmv.articleList) > 1}">
|
|
|
|
|
+ <button class="campus-feature-arrow prev" type="button" aria-label="上一张校园新闻图片">‹</button>
|
|
|
|
|
+ <button class="campus-feature-arrow next" type="button" aria-label="下一张校园新闻图片">›</button>
|
|
|
|
|
+ <div class="campus-feature-dots" aria-label="校园新闻图片轮播">
|
|
|
|
|
+ <c:forEach items="${newsRedCampusCarouselNmv.articleList}" var="item" varStatus="vs">
|
|
|
|
|
+ <button class="${vs.first ? 'is-active' : ''}" type="button" aria-label="查看第 ${vs.count} 张图片" aria-pressed="${vs.first ? 'true' : 'false'}" data-campus-feature-dot="${vs.index}"></button>
|
|
|
|
|
+ </c:forEach>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </c:if>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <c:forEach items="${newsRedCampusCarouselNmv.articleList}" var="item" varStatus="vs">
|
|
|
|
|
+ <a class="feature-caption campus-feature-caption${vs.first ? ' is-active' : ''}" data-campus-feature-caption="${vs.index}" href="${item.url}" target="${item.target}" aria-hidden="${vs.first ? 'false' : 'true'}">
|
|
|
|
|
+ <h3>${item.title}</h3>
|
|
|
</a>
|
|
</a>
|
|
|
- </c:if>
|
|
|
|
|
- </c:forEach>
|
|
|
|
|
|
|
+ </c:forEach>
|
|
|
|
|
+ </div>
|
|
|
<ul class="news-list">
|
|
<ul class="news-list">
|
|
|
<c:forEach items="${newsRedCampusNmv.articleList}" var="item" varStatus="vs">
|
|
<c:forEach items="${newsRedCampusNmv.articleList}" var="item" varStatus="vs">
|
|
|
<c:if test="${not vs.first}"><li><a href="${item.url}" target="${item.target}">${item.title}<time>${fn:substring(item.release_time, 5, 10)}</time></a></li></c:if>
|
|
<c:if test="${not vs.first}"><li><a href="${item.url}" target="${item.target}">${item.title}<time>${fn:substring(item.release_time, 5, 10)}</time></a></li></c:if>
|
|
@@ -94,5 +107,70 @@
|
|
|
</section>
|
|
</section>
|
|
|
</main>
|
|
</main>
|
|
|
<%@ include file="news-red-footer.jsp"%>
|
|
<%@ include file="news-red-footer.jsp"%>
|
|
|
|
|
+ <script>
|
|
|
|
|
+ (function () {
|
|
|
|
|
+ var root = document.querySelector('[data-campus-feature-carousel]');
|
|
|
|
|
+ if (!root) return;
|
|
|
|
|
+ var slides = Array.prototype.slice.call(root.querySelectorAll('[data-campus-feature-slide]'));
|
|
|
|
|
+ var captions = Array.prototype.slice.call(root.querySelectorAll('[data-campus-feature-caption]'));
|
|
|
|
|
+ var dots = Array.prototype.slice.call(root.querySelectorAll('[data-campus-feature-dot]'));
|
|
|
|
|
+ var current = 0;
|
|
|
|
|
+ var timer = null;
|
|
|
|
|
+ if (slides.length < 2) return;
|
|
|
|
|
+
|
|
|
|
|
+ function activate(index) {
|
|
|
|
|
+ current = (index + slides.length) % slides.length;
|
|
|
|
|
+ slides.forEach(function (slide, i) {
|
|
|
|
|
+ slide.classList.toggle('is-active', i === current);
|
|
|
|
|
+ slide.setAttribute('aria-hidden', i === current ? 'false' : 'true');
|
|
|
|
|
+ });
|
|
|
|
|
+ captions.forEach(function (caption, i) {
|
|
|
|
|
+ caption.classList.toggle('is-active', i === current);
|
|
|
|
|
+ caption.setAttribute('aria-hidden', i === current ? 'false' : 'true');
|
|
|
|
|
+ });
|
|
|
|
|
+ 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();
|
|
|
|
|
+ timer = window.setInterval(function () { activate(current + 1); }, 5200);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ root.querySelector('.campus-feature-arrow.prev').addEventListener('click', function () {
|
|
|
|
|
+ activate(current - 1);
|
|
|
|
|
+ start();
|
|
|
|
|
+ });
|
|
|
|
|
+ root.querySelector('.campus-feature-arrow.next').addEventListener('click', function () {
|
|
|
|
|
+ activate(current + 1);
|
|
|
|
|
+ start();
|
|
|
|
|
+ });
|
|
|
|
|
+ dots.forEach(function (dot) {
|
|
|
|
|
+ dot.addEventListener('click', function () {
|
|
|
|
|
+ activate(Number(dot.getAttribute('data-campus-feature-dot')));
|
|
|
|
|
+ start();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ root.addEventListener('mouseenter', stop);
|
|
|
|
|
+ root.addEventListener('mouseleave', start);
|
|
|
|
|
+ root.addEventListener('focusin', stop);
|
|
|
|
|
+ root.addEventListener('focusout', function (event) {
|
|
|
|
|
+ if (!root.contains(event.relatedTarget)) start();
|
|
|
|
|
+ });
|
|
|
|
|
+ document.addEventListener('visibilitychange', function () {
|
|
|
|
|
+ if (document.hidden) stop(); else start();
|
|
|
|
|
+ });
|
|
|
|
|
+ activate(0);
|
|
|
|
|
+ start();
|
|
|
|
|
+ })();
|
|
|
|
|
+ </script>
|
|
|
</body>
|
|
</body>
|
|
|
</html>
|
|
</html>
|