feat: 会员中心全局页面跳转过渡动画
All checks were successful
continuous-integration/drone/push Build is passing

header.php: CSS 入场动画(fadeIn + translateY)
footer.php: JS 拦截链接点击,先淡出再跳转
- 入场: 0.35s 从下方8px渐显
- 离场: 0.25s 向上8px渐隐
- 跳过: 锚点/javascript:/新窗口/修饰键
This commit is contained in:
yiqiu
2026-03-19 18:48:39 +08:00
parent 89a60864dc
commit 3e2939463c
2 changed files with 35 additions and 0 deletions

View File

@@ -6,6 +6,23 @@
<script src="/{$template_catalog}/template/{$themes}/components/coinActive/coinActive.js"></script>
<script src="/{$template_catalog}/template/{$public_themes}/components/asideMenu/asideMenu.js"></script>
<script src="/{$template_catalog}/template/{$public_themes}/components/topMenu/topMenu.js"></script>
<!-- 页面过渡动画 -->
<script>
(function() {
document.addEventListener('click', function(e) {
var link = e.target.closest('a[href]');
if (!link) return;
var href = link.getAttribute('href');
// 跳过锚点、javascript:、新窗口、带修饰键
if (!href || href.startsWith('#') || href.startsWith('javascript') ||
link.target === '_blank' || e.ctrlKey || e.metaKey || e.shiftKey) return;
e.preventDefault();
document.body.classList.add('page-leaving');
setTimeout(function() { window.location.href = href; }, 250);
});
})();
</script>
</body>
</html>