修复动画掉帧的问题,增加昼夜切换的过渡动画
This commit is contained in:
1 parent
94471c4c89
commit
624d0bda0f
7 files changed
+246
-131
No files matched your search
@@ -1,35 +1,24 @@
|
||||
function checkParent(element, classNames) {
|
||||
while (element) {
|
||||
if (element.classList && classNames.some(cn => element.classList.contains(cn))) {
|
||||
return true;
|
||||
}
|
||||
element = element.parentElement;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
var excludedClasses = ['talks_comments','tiaozhuan-button', 'floating-tools']; // 添加需要排除的a标签类名class
|
||||
window.addEventListener('load', (event) => {
|
||||
document.body.addEventListener('click', function(e) {
|
||||
let target = e.target;
|
||||
while (target && target.nodeName !== 'A') {
|
||||
target = target.parentNode;
|
||||
}
|
||||
if (target && target.nodeName === 'A' &&
|
||||
!checkParent(target, excludedClasses) &&
|
||||
!target.href.startsWith('javascript:') &&
|
||||
!target.href.includes('usj.cc') &&
|
||||
!target.href.includes('douban.com') &&
|
||||
!target.href.includes('bilibili.com') &&
|
||||
!target.href.includes('github.com') &&
|
||||
!target.href.includes('zql.im') &&
|
||||
!target.href.includes('5b2.cn') &&
|
||||
!target.href.includes('https://beian.miit.gov.cn') &&
|
||||
!target.href.includes('https://www.upyun.com') &&
|
||||
target.hostname !== window.location.hostname) {
|
||||
var excludedClasses = ['talks_comments','tiaozhuan-button', 'floating-tools'];
|
||||
window.addEventListener('load', function() {
|
||||
document.body.addEventListener('click', function(e) {
|
||||
var target = e.target.closest('a');
|
||||
if (!target) return;
|
||||
|
||||
if (target.href.startsWith('javascript:') ||
|
||||
target.hostname === window.location.hostname ||
|
||||
target.href.includes('usj.cc') ||
|
||||
target.href.includes('douban.com') ||
|
||||
target.href.includes('bilibili.com') ||
|
||||
target.href.includes('github.com') ||
|
||||
target.href.includes('zql.im') ||
|
||||
target.href.includes('5b2.cn') ||
|
||||
target.href.includes('beian.miit.gov.cn') ||
|
||||
target.href.includes('upyun.com')) return;
|
||||
|
||||
if (excludedClasses.some(function(cn) { return target.classList.contains(cn); })) return;
|
||||
|
||||
e.preventDefault();
|
||||
let encodedUrl = btoa(target.href); // Base64 encode the URL
|
||||
let url = '/tiaozhuan.html?target=' + encodedUrl;
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
});
|
||||
});
|
||||
var encodedUrl = btoa(target.href);
|
||||
window.open('/tiaozhuan.html?target=' + encodedUrl, '_blank');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user