misc: drop header block

This commit is contained in:
KOWX712
2025-04-02 00:20:38 +08:00
parent 6ed1ec07a8
commit 487b2ed434
4 changed files with 12 additions and 44 deletions

View File

@@ -24,7 +24,6 @@
<body>
<!-- Header -->
<div class="header-block"></div>
<div class="header">
<div id="title" data-i18n="header.title"></div><span id="module-version"></span>
<button id="help-button" class="help-button">

View File

@@ -13,7 +13,6 @@ export async function fetchAppList() {
try {
const targetFileContent = await execCommand('cat /data/adb/tricky_store/target.txt');
targetList = processTargetList(targetFileContent);
console.log("Current target list:", targetList);
} catch (error) {
toast("Failed to read target.txt!");
console.error("Failed to read target.txt file:", error);
@@ -107,7 +106,6 @@ export async function fetchAppList() {
checkbox.checked = targetList.includes(packageName);
appListContainer.appendChild(appElement);
});
console.log("App list with names and packages rendered successfully.");
} catch (error) {
toast("Failed to fetch app list!");
console.error("Failed to fetch or render app list with names:", error);

View File

@@ -6,7 +6,6 @@ import { updateCheck } from './update.js';
import { securityPatch } from './security_patch.js';
// Header Elements
const headerBlock = document.querySelector('.header-block');
const title = document.querySelector('.header');
export const noConnection = document.querySelector('.no-connection');
@@ -86,12 +85,7 @@ async function checkTrickyStoreVersion() {
TS_version=$(grep "versionCode=" "/data/adb/modules/tricky_store/module.prop" | cut -d'=' -f2)
[ "$TS_version" -ge 158 ] || echo "NO"
`);
if (version.trim() !== "NO") {
console.log("Tricky Store version is 158 or higher, displaying element.");
securityPatchElement.style.display = "flex";
} else {
console.log("Tricky Store version is below 158, leaving security patch element hidden.");
}
if (version.trim() !== "NO") securityPatchElement.style.display = "flex";
} catch (error) {
toast("Failed to check Tricky Store version!");
console.error("Error while checking Tricky Store version:", error);
@@ -103,12 +97,7 @@ async function checkMagisk() {
const selectDenylistElement = document.getElementById('select-denylist');
try {
const magiskEnv = await execCommand(`command -v magisk >/dev/null 2>&1 || echo "NO"`);
if (magiskEnv.trim() !== "NO") {
console.log("Denylist conditions met, displaying element.");
selectDenylistElement.style.display = "flex";
} else {
console.log("not running on Magisk, leaving denylist element hidden.");
}
if (magiskEnv.trim() !== "NO") selectDenylistElement.style.display = "flex";
} catch (error) {
toast("Failed to check Magisk!");
console.error("Error while checking denylist conditions:", error);
@@ -161,7 +150,6 @@ document.getElementById("save").addEventListener("click", async () => {
});
const updatedTargetContent = modifiedAppsList.join("\n");
await execCommand(`echo "${updatedTargetContent}" | sort -u > /data/adb/tricky_store/target.txt`);
console.log("target.txt updated successfully.");
showPrompt("prompt.saved_target");
for (const app of appsWithExclamation) {
await execCommand(`sed -i 's/^${app}$/${app}!/' /data/adb/tricky_store/target.txt`);
@@ -169,7 +157,6 @@ document.getElementById("save").addEventListener("click", async () => {
for (const app of appsWithQuestion) {
await execCommand(`sed -i 's/^${app}$/${app}?/' /data/adb/tricky_store/target.txt`);
}
console.log("App names modified in target.txt.");
} catch (error) {
console.error("Failed to update target.txt:", error);
showPrompt("prompt.save_error", false);
@@ -211,7 +198,6 @@ document.querySelector(".uninstall-container").addEventListener("click", () => {
async function uninstallWebUI() {
try {
await execCommand(`sh ${basePath}/common/get_extra.sh --uninstall`);
console.log("uninstall script executed successfully.");
showPrompt("prompt.uninstall_prompt");
} catch (error) {
console.error("Failed to execute uninstall command:", error);
@@ -222,21 +208,18 @@ async function uninstallWebUI() {
// Function to check if running in MMRL
async function checkMMRL() {
if (typeof ksu !== 'undefined' && ksu.mmrl) {
// Adjust elements position for MMRL
headerBlock.style.display = 'block';
// Set status bars theme based on device theme
try {
$tricky_store.setLightStatusBars(!window.matchMedia('(prefers-color-scheme: dark)').matches)
} catch (error) {
console.log("Error setting status bars theme:", error)
console.error("Error setting status bars theme:", error)
}
// Request API permission, supported version: 33045+
try {
$tricky_store.requestAdvancedKernelSUAPI();
} catch (error) {
console.log("Error requesting API:", error);
console.error("Error requesting API:", error);
}
// Check permissions
@@ -328,12 +311,10 @@ window.addEventListener('scroll', () => {
}, 200);
if (isRefreshing) return;
if (window.scrollY > lastScrollY && window.scrollY > scrollThreshold) {
title.style.transform = 'translateY(-80px)';
headerBlock.style.transform = 'translateY(-80px)';
title.style.transform = 'translateY(-100%)';
searchMenuContainer.style.transform = 'translateY(-40px)';
hideFloatingBtn();
} else if (window.scrollY < lastScrollY) {
headerBlock.style.transform = 'translateY(0)';
title.style.transform = 'translateY(0)';
searchMenuContainer.style.transform = 'translateY(0)';
hideFloatingBtn(false);

View File

@@ -3,32 +3,22 @@
align-items: center;
justify-content: space-between;
position: fixed;
top: var(--top-inset);
top: 0;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
padding: 0 5px;
padding-top: var(--top-inset);
height: 40px;
width: calc(100% - 10px);
max-width: 1100px;
background-color: var(--bg-primary);
transition: transform 0.4s ease;
z-index: 1100;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
user-select: none;
}
.header-block {
background-color: var(--bg-primary);
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1100;
transition: transform 0.4s ease;
height: var(--top-inset);
}
#module-version,
#title {
padding-left: 5px;