1
0
mirror of https://gitlab.com/lolmam/Phigros-Android-History.git synced 2026-02-04 16:21:11 +00:00

Added short redirection

This commit is contained in:
2025-09-07 16:19:20 +03:00
parent ddde02673a
commit 3c0a419c0a
2 changed files with 29 additions and 2 deletions

View File

@@ -14,7 +14,7 @@
<header>
<nav>
<ul>
<li><a href="https://phigros.lolmam.top/">Home</a></li>
<li><a href="index">Home</a></li>
<li><a href="versions">Versions</a></li>
<li><a href="install">Install Guide</a></li>
</ul>

View File

@@ -24,7 +24,7 @@
<main class="container">
<h1>Phigros Android Versions</h1>
<p>Welcome to the fan made archive of almost every <strong>Phigros</strong> Android version.
Find available versions, changelogs, and installation help for Google Play, TapTap, and other versions.</p>
Find available versions, changelogs, and installation help for <strong>G</strong> (Google Play), <strong>T</strong> (TapTap), and other versions.</p>
<p id="download-count">Loading downloads...</p>
<section class="archive-stats">
@@ -80,6 +80,33 @@
content.setAttribute("aria-hidden", isOpen ? "false" : "true");
});
}
// short url for jumping to versions
document.addEventListener("DOMContentLoaded", () => {
const allowedMajors = ["1", "2", "3"];
const hash = window.location.hash.trim();
if (!hash.startsWith("#v")) return;
const fullMatch = hash.match(/^#v(\d+)-(\d+)-(\d+)$/);
const majorMatch = hash.match(/^#v(\d+)$/);
let target = null;
let major = null;
if (fullMatch) {
major = fullMatch[1];
if (allowedMajors.includes(major)) {
target = `/versions/versions_${major}.x/${hash}`;
}
} else if (majorMatch) {
major = majorMatch[1];
if (allowedMajors.includes(major)) {
target = `/versions/versions_${major}.x/`;
}
}
if (target) {
window.location.replace(target);
} else {
window.location.replace("/404.html");
}
});
</script>
</body>
</html>