revert: 移除自定义页面过渡动画,使用默认跳转
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
- header.php: 删除 pageEnter/pageLeave CSS 动画 - footer.php: 删除 click 拦截和 doTransition JS - 保留 Logo 动态加载脚本
This commit is contained in:
@@ -7,39 +7,6 @@
|
|||||||
<script src="/{$template_catalog}/template/{$public_themes}/components/asideMenu/asideMenu.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 src="/{$template_catalog}/template/{$public_themes}/components/topMenu/topMenu.js"></script>
|
||||||
|
|
||||||
<!-- 页面过渡动画 -->
|
|
||||||
<script>
|
|
||||||
(function() {
|
|
||||||
var transitioning = false;
|
|
||||||
|
|
||||||
function doTransition(href) {
|
|
||||||
if (transitioning || !href) return;
|
|
||||||
transitioning = true;
|
|
||||||
document.body.classList.add('page-leaving');
|
|
||||||
setTimeout(function() {
|
|
||||||
// 直接用原始赋值跳转
|
|
||||||
Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window.location), 'href')
|
|
||||||
? (window.location.href = href)
|
|
||||||
: (window.location = href);
|
|
||||||
}, 250);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 1) 拦截 <a> 标签点击
|
|
||||||
document.addEventListener('click', function(e) {
|
|
||||||
var link = e.target.closest('a[href]');
|
|
||||||
if (!link) return;
|
|
||||||
var href = link.getAttribute('href');
|
|
||||||
if (!href || href.startsWith('#') || href.startsWith('javascript') ||
|
|
||||||
link.target === '_blank' || e.ctrlKey || e.metaKey || e.shiftKey) return;
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
doTransition(href);
|
|
||||||
}, true); // 用捕获阶段,比 Vue 先拦截
|
|
||||||
|
|
||||||
// 2) 暴露全局函数供 Vue 调用(覆盖常见跳转方法)
|
|
||||||
window.__navigateTo = function(href) { doTransition(href); };
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- 动态加载插件配置 Logo -->
|
<!-- 动态加载插件配置 Logo -->
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -17,23 +17,6 @@
|
|||||||
<!-- 模板样式 -->
|
<!-- 模板样式 -->
|
||||||
<link rel="stylesheet" href="/{$template_catalog}/template/{$public_themes}/css/common/reset.css">
|
<link rel="stylesheet" href="/{$template_catalog}/template/{$public_themes}/css/common/reset.css">
|
||||||
|
|
||||||
<!-- 页面过渡动画 -->
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
animation: pageEnter 0.35s ease both;
|
|
||||||
}
|
|
||||||
body.page-leaving {
|
|
||||||
animation: pageLeave 0.25s ease both;
|
|
||||||
}
|
|
||||||
@keyframes pageEnter {
|
|
||||||
from { opacity: 0; transform: translateY(8px); }
|
|
||||||
to { opacity: 1; transform: translateY(0); }
|
|
||||||
}
|
|
||||||
@keyframes pageLeave {
|
|
||||||
from { opacity: 1; transform: translateY(0); }
|
|
||||||
to { opacity: 0; transform: translateY(-8px); }
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script src="/{$template_catalog}/template/{$themes}/theme/index.js"></script>
|
<script src="/{$template_catalog}/template/{$themes}/theme/index.js"></script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user