feat(theme): 新增三套高校官网风皮肤 poly-blue/agri-forest/jade-normal
build / build-push (push) Successful in 51s
build / build-push (push) Successful in 51s
以 default 为基座(文件最全:含事项库 service/guide 两模板),设计语言与配色取自 真实高校官网 CSS(浙理工 #0558A5+橙、信阳农林 #1C6E19+麦穗金、信阳师大 #008D3F+暖橙)。 三包均自带九段 home-blocks、:root 契约变量别名、中文防塌列三件套、真实实拍截图 (1920 无头截图缩样)。 - UniversitySkinContractTest(7 用例):九段 fragment/homeStyle 分发/防塌列/变量别名/ 层序/自有截图/主色色域(蓝或绿通道主导,粉紫禁入) - ThemeRegistryTest +哨兵:三包注册成功且主色与 default/scholar-blue 及彼此互异 - jade-normal 修复:news_grid 全宽封面变体把正文列压成 0 宽致 390px 溢出 47px, 增 .jn-feat-a--stack 纵向变体,复测 overflowX=0 - 门禁:ThemeContractIT 14 主题×7 路由全绿;全量 mvn test 393/393 绿
This commit is contained in:
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,87 @@
|
||||
/* agri-forest 皮肤包脚本:页头日期 + 首页轮播(自动播放/圆点/箭头/悬停暂停/键盘),无任何外部依赖 */
|
||||
(function () {
|
||||
/* 页头工具行日期(本地时间,YYYY年M月D日 星期X) */
|
||||
var dateEl = document.getElementById('siteDate');
|
||||
if (dateEl) {
|
||||
var now = new Date();
|
||||
var week = ['日', '一', '二', '三', '四', '五', '六'][now.getDay()];
|
||||
dateEl.textContent = now.getFullYear() + '年' + (now.getMonth() + 1) + '月'
|
||||
+ now.getDate() + '日 星期' + week;
|
||||
}
|
||||
|
||||
/* 轮播 */
|
||||
var root = document.querySelector('.af-banner');
|
||||
var slides = document.querySelectorAll('.af-banner-slide');
|
||||
var dots = document.querySelectorAll('.af-banner-dots button');
|
||||
var prevBtn = document.querySelector('.af-banner-arrow.prev');
|
||||
var nextBtn = document.querySelector('.af-banner-arrow.next');
|
||||
if (!slides.length || !root) {
|
||||
return;
|
||||
}
|
||||
var current = 0;
|
||||
var timer = null;
|
||||
var INTERVAL = 5000;
|
||||
|
||||
function show(index) {
|
||||
slides[current].classList.remove('active');
|
||||
if (dots[current]) {
|
||||
dots[current].classList.remove('active');
|
||||
}
|
||||
current = (index + slides.length) % slides.length;
|
||||
slides[current].classList.add('active');
|
||||
if (dots[current]) {
|
||||
dots[current].classList.add('active');
|
||||
}
|
||||
}
|
||||
|
||||
function start() {
|
||||
stop();
|
||||
if (slides.length > 1) {
|
||||
timer = window.setInterval(function () {
|
||||
show(current + 1);
|
||||
}, INTERVAL);
|
||||
}
|
||||
}
|
||||
|
||||
function stop() {
|
||||
if (timer) {
|
||||
window.clearInterval(timer);
|
||||
timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
dots.forEach(function (dot, index) {
|
||||
dot.addEventListener('click', function () {
|
||||
show(index);
|
||||
start();
|
||||
});
|
||||
});
|
||||
if (prevBtn) {
|
||||
prevBtn.addEventListener('click', function () {
|
||||
show(current - 1);
|
||||
start();
|
||||
});
|
||||
}
|
||||
if (nextBtn) {
|
||||
nextBtn.addEventListener('click', function () {
|
||||
show(current + 1);
|
||||
start();
|
||||
});
|
||||
}
|
||||
root.addEventListener('mouseenter', stop);
|
||||
root.addEventListener('mouseleave', start);
|
||||
root.addEventListener('focusin', stop);
|
||||
root.addEventListener('focusout', start);
|
||||
root.setAttribute('tabindex', '-1');
|
||||
root.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'ArrowLeft') {
|
||||
show(current - 1);
|
||||
start();
|
||||
} else if (e.key === 'ArrowRight') {
|
||||
show(current + 1);
|
||||
start();
|
||||
}
|
||||
});
|
||||
|
||||
start();
|
||||
})();
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 122 KiB |
Reference in New Issue
Block a user