|
@@ -2,7 +2,7 @@ $(document).ready(function() {
|
|
|
|
|
|
new WOW({
|
|
|
mobile: false,
|
|
|
- animateClass: 'animate__animated',
|
|
|
+ animateClass: 'animate__animated',
|
|
|
}).init();
|
|
|
|
|
|
setTimeout(function() {
|
|
@@ -10,7 +10,7 @@ $(document).ready(function() {
|
|
|
}, 4500);
|
|
|
|
|
|
//Ajax Form Send START
|
|
|
- $('#contact-form').on('submit', function() {
|
|
|
+ $('#contact-form').on('submit', function() {
|
|
|
var th = $(this);
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
@@ -60,7 +60,7 @@ $(document).ready(function() {
|
|
|
},
|
|
|
});
|
|
|
// Banner END
|
|
|
-
|
|
|
+
|
|
|
|
|
|
// Menu START
|
|
|
$('body').on('click', '.hamburger-button', function(e) {
|
|
@@ -72,10 +72,10 @@ $(document).ready(function() {
|
|
|
hamburgerMenuWrap.addClass('menu-active');
|
|
|
hamburgerMenuItem.addClass('menu-item-active');
|
|
|
menuOverlay = $('.menu-overlay');
|
|
|
- menuOverlay.addClass('menu-overlay__active');
|
|
|
+ // menuOverlay.addClass('menu-overlay__active');
|
|
|
});
|
|
|
|
|
|
- $(document).on('mouseup', function(e) {
|
|
|
+ $('.menu-close__wrap').on('mouseup', function(e) {
|
|
|
e.preventDefault();
|
|
|
menuClose = $('.menu-close');
|
|
|
hamburgerMenuWrap = $('.menu-wrap');
|
|
@@ -172,6 +172,13 @@ $(document).ready(function() {
|
|
|
$('.grid-album.is-active:not(' + href + ')').removeClass('animate__animated animate__slideInUp');
|
|
|
|
|
|
albumMasonry();
|
|
|
+
|
|
|
+ let column = $(this).attr('column');
|
|
|
+ if (column == 'pdf' || column == 'video') {
|
|
|
+ $(".download-all").hide();
|
|
|
+ } else {
|
|
|
+ $(".download-all").show();
|
|
|
+ }
|
|
|
});
|
|
|
// Album page END
|
|
|
|
|
@@ -194,18 +201,8 @@ $(document).ready(function() {
|
|
|
});
|
|
|
// Settings END
|
|
|
|
|
|
- // 当鼠标经过 li 元素时
|
|
|
- // $('.menu-nav li').hover(
|
|
|
- // function() {
|
|
|
- // // 显示子菜单
|
|
|
- // $(this).find('.menu-nav-son').stop(true, true).slideDown(200);
|
|
|
- // },
|
|
|
- // function() {
|
|
|
- // // 隐藏子菜单
|
|
|
- // $(this).find('.menu-nav-son').stop(true, true).slideUp(0);
|
|
|
- // }
|
|
|
- // );
|
|
|
- $('.menu-nav li').hover(
|
|
|
+
|
|
|
+ $('.menu-nav-item').hover(
|
|
|
function () {
|
|
|
// 显示当前 li 的子菜单
|
|
|
$(this).find('.menu-nav-son').stop(true, true).slideDown(200);
|
|
@@ -213,31 +210,32 @@ $(document).ready(function() {
|
|
|
);
|
|
|
|
|
|
// 当鼠标离开 .menu-nav ul 时
|
|
|
- $('.menu-nav').mouseleave(function () {
|
|
|
+ $('.menu-nav-item').mouseleave(function () {
|
|
|
// 隐藏所有子菜单
|
|
|
- $('.menu-nav-son').stop(true, true).slideUp(200);
|
|
|
+ $('.menu-nav-son').stop(true, true).slideUp(0);
|
|
|
});
|
|
|
|
|
|
|
|
|
// 创建全屏遮罩层
|
|
|
- $('.album-thumb').on('click', function (event) {
|
|
|
+ $('.album-thumb-detail').on('click', function (event) {
|
|
|
// 如果点击的是 download-icon,阻止后续代码执行
|
|
|
if ($(event.target).closest('.download-icon').length) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // 获取当前点击的 .album-thumb 的父级 .grid-album 元素
|
|
|
+ // 获取当前点击的 .album-thumb-detail 的父级 .grid-album 元素
|
|
|
var $parentAlbum = $(this).closest('.grid-album');
|
|
|
|
|
|
- // 获取当前父级下所有 .album-thumb img 的 src
|
|
|
+ // 获取当前父级下所有 .album-thumb-detail img 的 src
|
|
|
var imageSrcArray = [];
|
|
|
- $parentAlbum.find('.album-thumb img').each(function () {
|
|
|
- console.log($(this).attr('class'));
|
|
|
- imageSrcArray.push($(this).attr('src'));
|
|
|
+ $parentAlbum.find('.album-thumb-detail img').each(function () {
|
|
|
+ src = $(this).attr('src')
|
|
|
+ newSrc = src.split('?')[0];
|
|
|
+ imageSrcArray.push(newSrc);
|
|
|
});
|
|
|
|
|
|
// 获取当前点击图片在数组中的索引
|
|
|
- var $albumThumbs = $parentAlbum.find('.album-thumb');
|
|
|
+ var $albumThumbs = $parentAlbum.find('.album-thumb-detail');
|
|
|
var currentImageIndex = $albumThumbs.index(this);
|
|
|
// console.log(currentImageIndex);
|
|
|
|
|
@@ -318,4 +316,63 @@ $(document).ready(function() {
|
|
|
$(this).siblings('.log-line').toggleClass('active');
|
|
|
});
|
|
|
|
|
|
-});
|
|
|
+ //日志
|
|
|
+ // 检查 update-log 是否存在
|
|
|
+ if ($('.update-log').length > 0) {
|
|
|
+ // 定义一个函数来执行 AJAX 请求
|
|
|
+ function fetchUpdate() {
|
|
|
+ $.ajax({
|
|
|
+ url: '/next-log', // 替换为你的 API 端点
|
|
|
+ method: 'GET', // 根据你的需求选择 GET 或 POST
|
|
|
+ dataType: 'json', // 根据你的 API 返回的数据类型选择
|
|
|
+ success: function(response) {
|
|
|
+ // 假设 response 包含 timestamp 和 message
|
|
|
+ var created_at = response.data.created_at;
|
|
|
+ var action = response.data.action;
|
|
|
+ if (action == 'aa') {
|
|
|
+ action = '新增了';
|
|
|
+ } else {
|
|
|
+ action = '更新了';
|
|
|
+ }
|
|
|
+ var model = response.data.model + ' 的';
|
|
|
+ var content = response.data.content;
|
|
|
+
|
|
|
+ // 更新 timestamp 和 message
|
|
|
+ $('.update-log .update-time').text(created_at);
|
|
|
+ $('.update-log .action').text(action);
|
|
|
+ $('.update-log .model').text(model);
|
|
|
+ $('.update-log .log-content').text(content);
|
|
|
+ },
|
|
|
+ error: function(xhr, status, error) {
|
|
|
+ console.error('AJAX 请求失败:', status, error);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 立即执行一次
|
|
|
+ fetchUpdate();
|
|
|
+ // 每 10 秒执行一次
|
|
|
+ setInterval(fetchUpdate, 20000); // 10000 毫秒 = 10 秒
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 监听 .download-all 的点击事件
|
|
|
+ $('.download-all').on('click', function() {
|
|
|
+ // 查找 .album-tab 中带有 is-active 类的 <a> 标签
|
|
|
+ let activeTab = $('.album-tab a.is-active').attr('href');
|
|
|
+
|
|
|
+ // 将 #album- 替换为空,得到 tab 变量
|
|
|
+ let tab = activeTab.replace('#album-', '');
|
|
|
+
|
|
|
+ // 获取当前 URL 中的 id 参数
|
|
|
+ let currentUrl = window.location.href;
|
|
|
+ let urlParams = new URLSearchParams(currentUrl.split('?')[1]);
|
|
|
+ let id = urlParams.get('id');
|
|
|
+
|
|
|
+ // 拼接新的 URL
|
|
|
+ let newUrl = `/download-all?id=${id}&tab=${tab}`;
|
|
|
+
|
|
|
+ // 跳转到新 URL
|
|
|
+ window.location.href = newUrl;
|
|
|
+ });
|
|
|
+
|
|
|
+});
|