更新动画效果

This commit is contained in:
DelLevin-Home
2026-05-18 21:34:01 +08:00
parent 5c22d3f59d
commit afc019b1fd
6 changed files with 193 additions and 26 deletions

View File

@@ -20,6 +20,9 @@
top: 210px;
right: 80px;
z-index: 999;
display: block !important;
visibility: visible !important;
opacity: 1 !important;
}
/* 透明桥梁:向左延伸覆盖预览面板区域,确保鼠标滑入时 hover 不中断 */
@@ -76,13 +79,15 @@
width: 80px;
height: 80px;
cursor: pointer;
display: flex;
display: flex !important;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
visibility: visible !important;
opacity: 1 !important;
}
.btn-label {
@@ -114,6 +119,102 @@
stroke: #333;
}
/* 自定义确认弹窗样式 */
.custom-confirm-modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
z-index: 99999;
justify-content: center;
align-items: center;
animation: fadeIn 0.2s ease;
}
.custom-confirm-modal.active {
display: flex;
}
.custom-confirm-content {
background: linear-gradient(
135deg,
rgba(255, 255, 255, 0.95) 0%,
rgba(255, 255, 255, 0.9) 100%
);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.6);
border-radius: 16px;
padding: 24px;
max-width: 400px;
width: 90%;
box-shadow:
0 20px 60px rgba(0, 0, 0, 0.3),
0 0 0 1px rgba(255, 255, 255, 0.4) inset;
animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.custom-confirm-message {
font-size: 15px;
color: #333;
line-height: 1.6;
margin-bottom: 20px;
word-break: break-word;
}
.custom-confirm-buttons {
display: flex;
gap: 12px;
justify-content: flex-end;
}
.confirm-btn-cancel,
.confirm-btn-ok {
padding: 8px 20px;
border: none;
border-radius: 8px;
font-size: 14px;
cursor: pointer;
transition: all 0.2s ease;
font-weight: 500;
}
.confirm-btn-cancel {
background: rgba(0, 0, 0, 0.05);
color: #666;
}
.confirm-btn-cancel:hover {
background: rgba(0, 0, 0, 0.1);
}
.confirm-btn-ok {
background: #1a73e8;
color: #fff;
}
.confirm-btn-ok:hover {
background: #1557b0;
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
/* Hover 浮动预览面板 */
.guestbook-preview,
.blog-posts-preview,

View File

@@ -653,6 +653,7 @@ body {
.mooknote-download {
text-align: center;
margin-top: 30px;
margin-bottom: 60px;
padding-top: 20px;
border-top: 1px dashed #eee;
}
@@ -695,8 +696,7 @@ body {
.tool-item:hover,
.game-item:hover {
transform: translateY(-3px);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
border-color: #000;
}
.tool-name,

View File

@@ -213,7 +213,7 @@
const category = post.categories && post.categories.length > 0 ? post.categories[0].name : '未分类';
const digest = post.digest || '';
let html = `<div class="blog-post-item" onclick="window.open('${post.permalink}', '_blank')">`;
let html = `<div class="blog-post-item" onclick="showCustomConfirm('确定要打开网站吗?\\n${post.permalink}', () => window.open('${post.permalink}', '_blank'))">`;
html += `<div class="blog-post-title">${escapeHtml(post.title)}</div>`;
if (digest) {
html += `<div class="blog-post-digest">${escapeHtml(digest)}</div>`;

View File

@@ -168,11 +168,11 @@
window.openPhotoLightbox = function(photoIndex) {
currentPhotoIndex = photoIndex;
// 检查是否已经存在 lightbox
let lightbox = document.querySelector('.photo-lightbox');
// 检查是否已经存在 lightbox使用特定的类名避免与MookNote冲突
let lightbox = document.querySelector('.photo-album-lightbox');
if (!lightbox) {
lightbox = document.createElement('div');
lightbox.className = 'photo-lightbox';
lightbox.className = 'photo-lightbox photo-album-lightbox'; // 同时保留两个类名以兼容CSS
lightbox.innerHTML = `
<span class="photo-lightbox-close">&times;</span>
<span class="photo-lightbox-nav photo-lightbox-prev">&#10094;</span>
@@ -208,7 +208,7 @@
// 更新 Lightbox 图片
function updateLightboxImage() {
const lightbox = document.querySelector('.photo-lightbox');
const lightbox = document.querySelector('.photo-album-lightbox');
if (!lightbox || !allPhotos[currentPhotoIndex]) return;
const img = lightbox.querySelector('img');
@@ -255,6 +255,10 @@
// 处理键盘事件
function handleLightboxKeydown(e) {
// 只在旅途剪影的lightbox激活时处理
const albumLightbox = document.querySelector('.photo-album-lightbox');
if (!albumLightbox || !albumLightbox.classList.contains('active')) return;
if (e.key === 'ArrowLeft') {
showPreviousPhoto();
} else if (e.key === 'ArrowRight') {
@@ -266,7 +270,7 @@
// 关闭照片放大查看器
function closePhotoLightbox() {
const lightbox = document.querySelector('.photo-lightbox');
const lightbox = document.querySelector('.photo-album-lightbox');
if (lightbox) {
lightbox.classList.remove('active');

View File

@@ -100,7 +100,9 @@ function renderWebsites(websitesArray) {
} else {
linkElement.onclick = (e) => {
e.preventDefault();
window.open(item.url, '_blank');
showCustomConfirm(`确定要打开网站吗?\n${item.url}`, () => {
window.open(item.url, '_blank');
});
};
}
@@ -126,7 +128,11 @@ function renderWebsites(websitesArray) {
if (item.url === 'https://mooknote.iletter.top/#/') {
card.onclick = () => openMookNoteModal();
} else {
card.onclick = () => window.open(item.url, '_blank');
card.onclick = () => {
showCustomConfirm(`确定要打开网站吗?\n${item.url}`, () => {
window.open(item.url, '_blank');
});
};
}
const title = currentLang === 'en' ? item.linkText_en : item.linkText_zh;
@@ -220,7 +226,7 @@ window.nextMooknoteImage = function() {
// 全屏预览功能
window.openMooknoteLightbox = function(index) {
lightboxImageIndex = index;
const lightbox = document.getElementById('mooknote-lightbox');
const lightbox = document.querySelector('.mooknote-lightbox');
const img = lightbox.querySelector('.lightbox-img');
const counter = lightbox.querySelector('.lightbox-counter');
@@ -230,7 +236,7 @@ window.openMooknoteLightbox = function(index) {
};
window.closeMooknoteLightbox = function() {
const lightbox = document.getElementById('mooknote-lightbox');
const lightbox = document.querySelector('.mooknote-lightbox');
lightbox.classList.remove('active');
};
@@ -245,7 +251,7 @@ window.nextLightboxImage = function() {
};
function updateLightboxImage() {
const lightbox = document.getElementById('mooknote-lightbox');
const lightbox = document.querySelector('.mooknote-lightbox');
const img = lightbox.querySelector('.lightbox-img');
const counter = lightbox.querySelector('.lightbox-counter');
@@ -255,8 +261,8 @@ function updateLightboxImage() {
// 键盘事件支持
document.addEventListener('keydown', (e) => {
const lightbox = document.getElementById('mooknote-lightbox');
if (!lightbox.classList.contains('active')) return;
const lightbox = document.querySelector('.mooknote-lightbox');
if (!lightbox || !lightbox.classList.contains('active')) return;
if (e.key === 'Escape') {
closeMooknoteLightbox();