Skip to content

Commit

Permalink
added mobile redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
p-i-c-o committed Jul 14, 2024
1 parent 090f479 commit 74ebafd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apps.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cat S22 Flip</title>
<link rel="stylesheet" href="style.css">
<script>
// Function to detect if the user is on a mobile device
function isMobile() {
return /Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}

// Redirect to mobile.html if on a mobile device
if (isMobile()) {
window.location.href = './mobile.html';
}
</script>

</head>
<body>
<header>
Expand Down
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cat S22 Flip</title>
<link rel="stylesheet" href="style.css">
<script>
// Function to detect if the user is on a mobile device
function isMobile() {
return /Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}

// Redirect to mobile.html if on a mobile device
if (isMobile()) {
window.location.href = './mobile.html';
}
</script>

</head>
<body>
<header>
Expand Down
1 change: 1 addition & 0 deletions mobile.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>Please use Desktop</p>

0 comments on commit 74ebafd

Please sign in to comment.