inital-release
This commit is contained in:
16
public/redirect.js
Normal file
16
public/redirect.js
Normal file
@@ -0,0 +1,16 @@
|
||||
// Device Detection and Redirect
|
||||
(function() {
|
||||
// Check if we're already on the correct page
|
||||
const currentPage = window.location.pathname.split('/').pop() || 'index.html'
|
||||
|
||||
// Detect mobile device
|
||||
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
|
||||
|| window.innerWidth < 768
|
||||
|
||||
// Only redirect if needed and not in an infinite loop
|
||||
if (isMobile && !currentPage.includes('mobile.html')) {
|
||||
window.location.href = 'mobile.html'
|
||||
} else if (!isMobile && currentPage.includes('mobile.html')) {
|
||||
window.location.href = 'index.html'
|
||||
}
|
||||
})()
|
||||
Reference in New Issue
Block a user