Browse Source

优化红色全屏风轮播与底部间距

为全屏风红色系首页轮播增加参考深圳职业学院的缓慢缩小效果,并在红色主题下把轮播节奏调整为 6 秒。

调整红色主题底部地址栏与二维码栏的间距,移动端保留原有单列居中布局。

为 screen-index.jsp 增加红色主题专用脚本版本号,避免旧缓存影响预览,同时保持其他主题使用原有版本。

Validation:

- git diff --check -- WebRoot/main/ffkj-portal/portal-source.css WebRoot/main/ffkj-portal/portal-zq.js WebRoot/web/upload/ffkj-template/portal-source.css WebRoot/web/upload/ffkj-template/screen-index.jsp

- 本地浏览器验证 http://ffkj-screen-red.localhost:4188/:轮播缩放从约 1.106 降到约 1.024,地址和二维码间距计算值符合标注。
非繁 5 months ago
parent
commit
39d62acdf5

+ 27 - 0
WebRoot/main/ffkj-portal/portal-source.css

@@ -381,6 +381,12 @@ body.screen-red-theme .screen-footer-main > * {
   min-width: 0;
 }
 
+body.screen-red-theme .screen-footer-address {
+  margin-top: 3px;
+  margin-right: 28px;
+  padding: 3px 2px 2px 0;
+}
+
 body.screen-red-theme .screen-footer-address p {
   margin: 3px 0;
   font-size: 13px;
@@ -393,6 +399,8 @@ body.screen-red-theme .screen-footer-qrcode {
   gap: 8px 10px;
   align-items: start;
   justify-content: center;
+  margin: 6px 0 2px -59px;
+  padding: 9px 15px 0 0;
 }
 
 body.screen-red-theme .screen-footer-qrcode .screen-qr-link {
@@ -618,11 +626,15 @@ body.screen-red-theme .screen-shell .campus-news-list li:last-child {
   body.screen-red-theme .screen-footer-philosophy {
     justify-self: center;
     max-width: 420px;
+    margin-right: 0;
+    padding: 0;
     text-align: center;
   }
 
   body.screen-red-theme .screen-footer-qrcode {
     justify-content: center;
+    margin: 0;
+    padding: 0;
   }
 
   body.screen-red-theme .screen-footer-logo {
@@ -8128,6 +8140,21 @@ body.screen-red-theme .screen-hero-slide {
   justify-content: flex-start;
 }
 
+body.screen-red-theme .screen-hero-slide img {
+  transform: scale(1.12);
+  transition: none;
+}
+
+body.screen-red-theme .screen-hero-slide.active.is-zooming img {
+  transform: scale(1);
+  transition: transform 6s cubic-bezier(0.22, 1, 0.36, 1);
+}
+
+body.screen-red-theme .screen-hero-slide.is-leaving img {
+  transform: scale(1.02);
+  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
+}
+
 body.screen-red-theme .screen-hero-slide .screen-hero-summary {
   position: absolute;
   left: 50%;

+ 32 - 1
WebRoot/main/ffkj-portal/portal-zq.js

@@ -284,6 +284,10 @@
       var dots = Array.prototype.slice.call(root.querySelectorAll(dotSelector));
       var index = 0;
       var timer = 0;
+      var carouselInterval = interval;
+      if (document.body.classList.contains("screen-red-theme") && root.classList.contains("screen-hero-frame")) {
+        carouselInterval = 6000;
+      }
 
       function show(next, direction) {
         var previousIndex = index;
@@ -310,6 +314,7 @@
             }, 1200);
           }
         });
+        restartScreenHeroZoom(root, items, index);
         dots.forEach(function (dot, dotIndex) {
           dot.classList.toggle(activeClass, dotIndex === index);
         });
@@ -320,7 +325,7 @@
         stop();
         timer = window.setInterval(function () {
           show(index + 1, 1);
-        }, interval);
+        }, carouselInterval);
       }
 
       function stop() {
@@ -346,6 +351,32 @@
     });
   }
 
+  function restartScreenHeroZoom(root, items, activeIndex) {
+    if (!document.body.classList.contains("screen-red-theme") || !root.classList.contains("screen-hero-frame")) return;
+    if (window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
+    var activeItem = items[activeIndex];
+    if (!activeItem) return;
+    items.forEach(function (item) {
+      item.classList.remove("is-zooming");
+    });
+    if (root._screenHeroZoomFrame) {
+      if (window.cancelAnimationFrame) {
+        window.cancelAnimationFrame(root._screenHeroZoomFrame);
+      } else {
+        window.clearTimeout(root._screenHeroZoomFrame);
+      }
+      root._screenHeroZoomFrame = 0;
+    }
+    activeItem.offsetWidth;
+    var nextFrame = window.requestAnimationFrame || function (callback) {
+      return window.setTimeout(callback, 16);
+    };
+    root._screenHeroZoomFrame = nextFrame(function () {
+      activeItem.classList.add("is-zooming");
+      root._screenHeroZoomFrame = 0;
+    });
+  }
+
   function setupStudyPanelFit() {
     var carousel = document.querySelector(".colorful-carousel");
     var panel = document.querySelector(".study-panel");

+ 27 - 0
WebRoot/web/upload/ffkj-template/portal-source.css

@@ -381,6 +381,12 @@ body.screen-red-theme .screen-footer-main > * {
   min-width: 0;
 }
 
+body.screen-red-theme .screen-footer-address {
+  margin-top: 3px;
+  margin-right: 28px;
+  padding: 3px 2px 2px 0;
+}
+
 body.screen-red-theme .screen-footer-address p {
   margin: 3px 0;
   font-size: 13px;
@@ -393,6 +399,8 @@ body.screen-red-theme .screen-footer-qrcode {
   gap: 8px 10px;
   align-items: start;
   justify-content: center;
+  margin: 6px 0 2px -59px;
+  padding: 9px 15px 0 0;
 }
 
 body.screen-red-theme .screen-footer-qrcode .screen-qr-link {
@@ -618,11 +626,15 @@ body.screen-red-theme .screen-shell .campus-news-list li:last-child {
   body.screen-red-theme .screen-footer-philosophy {
     justify-self: center;
     max-width: 420px;
+    margin-right: 0;
+    padding: 0;
     text-align: center;
   }
 
   body.screen-red-theme .screen-footer-qrcode {
     justify-content: center;
+    margin: 0;
+    padding: 0;
   }
 
   body.screen-red-theme .screen-footer-logo {
@@ -8125,6 +8137,21 @@ body.screen-red-theme .screen-hero-slide {
   justify-content: flex-start;
 }
 
+body.screen-red-theme .screen-hero-slide img {
+  transform: scale(1.12);
+  transition: none;
+}
+
+body.screen-red-theme .screen-hero-slide.active.is-zooming img {
+  transform: scale(1);
+  transition: transform 6s cubic-bezier(0.22, 1, 0.36, 1);
+}
+
+body.screen-red-theme .screen-hero-slide.is-leaving img {
+  transform: scale(1.02);
+  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
+}
+
 body.screen-red-theme .screen-hero-slide .screen-hero-summary {
   position: absolute;
   left: 50%;

+ 3 - 1
WebRoot/web/upload/ffkj-template/screen-index.jsp

@@ -7,8 +7,10 @@
 <c:set var="screenShowMediaDate" value="${portalThemeClass eq 'screen-red-theme'}"/>
 <c:set var="screenShowHeroSummary" value="${portalThemeClass eq 'screen-red-theme'}"/>
 <c:set var="screenPortalCssVersion" value="20260623-news-bg"/>
+<c:set var="screenPortalJsVersion" value="20260623-hero-wheel-return"/>
 <c:if test="${portalThemeClass eq 'screen-red-theme'}">
 	<c:set var="screenPortalCssVersion" value="20260624-screen-red-image-dots"/>
+	<c:set var="screenPortalJsVersion" value="20260624-screen-red-hero-zoom"/>
 </c:if>
 <!doctype html>
 <html lang="zh-CN">
@@ -463,6 +465,6 @@
 			</div>
 		</footer>
 	</div>
-	<script src="/main/ffkj-portal/portal-zq.js?v=20260623-hero-wheel-return"></script>
+	<script src="/main/ffkj-portal/portal-zq.js?v=${screenPortalJsVersion}"></script>
 </body>
 </html>