[ Feat] <Settings UI> Support custom access methods

1. [/] 修复了 PLS 下载时, 目录未递归创建导致的 ENOENT 错误。
2. [+] 现在可以通过多种方式访问 Aura 设置 UI 了, 更多详细信息, 请参见 #18。
3. [↑] 优化了 Tooltip 的渲染逻辑。
This commit is contained in:
Minoricew
2025-06-13 16:24:10 +08:00
parent c0249693a8
commit 70ffa3f581
9 changed files with 284 additions and 31 deletions

View File

@@ -7,6 +7,10 @@
transition: opacity 0.25s;
}
.aura-header-icon.aura-header-icon-hidden {
display: none;
}
.aura-header-icon:hover {
opacity: 0.75;
}

View File

@@ -1,4 +1,4 @@
<div class="aura-header-icon">
<div class="aura-header-icon aura-header-icon-hidden">
<div
class="buttonClick__button-click__3bNeY1Ax"
onclick="global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon.showAuraConfig()"

View File

@@ -1,5 +1,54 @@
global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon = {
showAuraConfig: () => {
window.__HUGO_AURA_LOADER__["Aura.UI.Assistant.Config"].active = true;
if (global.__HUGO_AURA_LOADER__["Aura.UI.Assistant.Config"].active) return;
global.__HUGO_AURA_LOADER__["Aura.UI.Assistant.Config"].active = true;
},
};
(() => {
let clickCounter = 0;
let clickTimeout = null;
const onMounted = () => {
if (global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod.showEntryIcon) {
const iconEl = document.getElementsByClassName("aura-header-icon")[0];
iconEl.classList.remove("aura-header-icon-hidden");
}
if (
global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod
.fallbackAccessMethods.hotkey
) {
document.addEventListener("keydown", (event) => {
if (event.ctrlKey && event.shiftKey && event.key === "A") {
global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon.showAuraConfig();
}
});
}
if (
global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod
.fallbackAccessMethods.touch
) {
const mesModelEl = document.getElementsByClassName(
"index__mes-modal__2hRouc6M"
)[0];
const verEl = mesModelEl.children[0];
verEl.onclick = () => {
clickCounter += 1;
if (clickCounter >= 7) {
global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon.showAuraConfig();
clickCounter = 0;
if (clickTimeout) {
clearTimeout(clickTimeout);
}
}
clickTimeout = setTimeout(() => {
clickCounter = 0;
}, 10000);
};
}
};
onMounted();
})();