初版:小白超人(从线上实例导出)

This commit is contained in:
deploy
2026-10-29 15:20:39 +08:00
commit b77a309873
100 changed files with 32168 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
(function () {
'use strict';
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
window.uiNavigate = function (url) {
if (reduceMotion) {
window.location.href = url;
return;
}
document.body.classList.add('ui-page-leaving');
window.setTimeout(function () { window.location.href = url; }, 170);
};
window.uiCloseWindow = function () {
if (reduceMotion) {
window.close();
return;
}
document.body.classList.add('ui-page-leaving');
window.setTimeout(function () { window.close(); }, 170);
};
document.addEventListener('click', function (event) {
const link = event.target.closest('a[href]');
if (!link || event.defaultPrevented || event.button !== 0 || event.metaKey ||
event.ctrlKey || event.shiftKey || event.altKey || link.target === '_blank' ||
link.hasAttribute('download')) return;
const destination = new URL(link.href, window.location.href);
if (destination.origin !== window.location.origin ||
(destination.pathname === window.location.pathname && destination.hash)) return;
event.preventDefault();
window.uiNavigate(destination.href);
});
})();