link redirect quick fix

This commit is contained in:
KOWX712
2024-12-07 20:52:01 +08:00
parent a2b2da27f8
commit f576b4bb2f
3 changed files with 54 additions and 19 deletions

View File

@@ -125,15 +125,7 @@
<p data-i18n="disclaimer"></p> <p data-i18n="disclaimer"></p>
<br> <br>
<p> <p>
<span data-i18n="telegram_channel"></span> <span id="telegram" data-i18n="telegram_channel"></span><span id="github" data-i18n="github"></span>
<br>
<span>t.me/kowchannel</span>
</p>
<br>
<p>
<span data-i18n="github"></span>
<br>
<span>github.com/KOWX712/Tricky-Addon-Update-Target-List</span>
</p> </p>
<br> <br>
<p data-i18n="acknowledgment"></p> <p data-i18n="acknowledgment"></p>

View File

@@ -41,6 +41,10 @@ const loadingIndicator = document.querySelector('.loading');
const floatingBtn = document.querySelector('.floating-btn'); const floatingBtn = document.querySelector('.floating-btn');
const prompt = document.getElementById('prompt'); const prompt = document.getElementById('prompt');
// About Elements
const telegramLink = document.getElementById('telegram');
const githubLink = document.getElementById('github');
const basePath = "set-path"; const basePath = "set-path";
const ADDITIONAL_APPS = [ const ADDITIONAL_APPS = [
"com.google.android.gms", "com.google.android.gms",
@@ -769,8 +773,28 @@ document.addEventListener('DOMContentLoaded', async () => {
}); });
// Redirect to GitHub release page // Redirect to GitHub release page
updateCard.addEventListener('click', () => { updateCard.addEventListener('click', async() => {
window.location.href = 'https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/latest'; try {
await execCommand('am start -a android.intent.action.VIEW -d https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/latest');
} catch (error) {
console.error('Error opening GitHub Release link:', error);
}
});
telegramLink.addEventListener('click', async () => {
try {
await execCommand('am start -a android.intent.action.VIEW -d https://t.me/kowchannel');
} catch (error) {
console.error('Error opening Telegram link:', error);
}
});
githubLink.addEventListener('click', async () => {
try {
await execCommand('am start -a android.intent.action.VIEW -d https://github.com/KOWX712/Tricky-Addon-Update-Target-List');
} catch (error) {
console.error('Error opening GitHub link:', error);
}
}); });
// Function to execute shell commands // Function to execute shell commands

View File

@@ -348,14 +348,6 @@ body {
font-size: 14px; font-size: 14px;
} }
.about-content p span[data-i18n="telegram_channel"] {
font-weight: bold;
}
.about-content p span[data-i18n="github"] {
font-weight: bold;
}
.about-content p[data-i18n="disclaimer"] { .about-content p[data-i18n="disclaimer"] {
font-style: italic; font-style: italic;
} }
@@ -369,6 +361,25 @@ body {
font-size: 16px; font-size: 16px;
} }
#telegram {
font-weight: bold;
padding: 5px 10px;
background-color: #38A7ED;
color: #fff;
border-radius: 8px;
margin-right: 5px;
transition: background-color 0.2s ease;
}
#github {
font-weight: bold;
padding: 5px 10px;
background-color: #1E1E1E;
color: #fff;
border-radius: 8px;
transition: background-color 0.2s ease;
}
.search-menu-container { .search-menu-container {
display: flex; display: flex;
position: fixed; position: fixed;
@@ -753,6 +764,14 @@ body {
background-color: #830000; background-color: #830000;
} }
#telegram:active {
background-color: #1A78B3;
}
#github:active {
background-color: #585858;
}
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
body { body {
background-color: #121212; background-color: #121212;