summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authors1nical <[email protected]>2019-08-27 21:45:13 -0700
committers1nical <[email protected]>2019-08-27 21:45:13 -0700
commit222de4e91ac1ba9340b50ab299735ff7d88d0e35 (patch)
tree0fcfaa7a1264952dc80959489635590fdb9062f2
parentadd about redirect to konami nav bar (diff)
downloads1n.pw-admin-222de4e91ac1ba9340b50ab299735ff7d88d0e35.tar.xz
s1n.pw-admin-222de4e91ac1ba9340b50ab299735ff7d88d0e35.zip
seperate mobile/desktop redirects
-rw-r--r--about/index.html1
-rw-r--r--cars/index.html1
-rw-r--r--development/index.html1
-rw-r--r--index.html1
-rw-r--r--js/app.js5
-rw-r--r--js/redirect-to-desktop.js4
-rw-r--r--js/redirect-to-mobile.js4
-rw-r--r--konami/index.html1
-rw-r--r--konami/js/main.js5
-rw-r--r--mobile/index.html1
-rw-r--r--mobile/js/app.js11
11 files changed, 17 insertions, 18 deletions
diff --git a/about/index.html b/about/index.html
index 90c45a9..dfbdc3e 100644
--- a/about/index.html
+++ b/about/index.html
@@ -12,6 +12,7 @@
<link rel="stylesheet" href="/about/css/navigation-bar.css">
<link rel="stylesheet" href="/about/css/loader-animation.css">
<script src="/js/loader-animation.js"></script>
+ <script src="/js/redirect-to-mobile.js"></script>
</head>
<body>
<script src="/js/background-sparkles.js"></script>
diff --git a/cars/index.html b/cars/index.html
index 793f559..391a34c 100644
--- a/cars/index.html
+++ b/cars/index.html
@@ -9,6 +9,7 @@
<meta name="robots" content="noindex">
<link rel="stylesheet" href="/cars/css/main.css">
<title>s1nical - Cars</title>
+ <script src="/js/redirect-to-mobile.js"></script>
</head>
<body>
diff --git a/development/index.html b/development/index.html
index 41ee390..e79f662 100644
--- a/development/index.html
+++ b/development/index.html
@@ -7,6 +7,7 @@
<title>s1nical - Development</title>
<link rel="stylesheet" href="/development/css/main.css">
<script src="/js/hide-context-menu.js"></script>
+ <script src="/js/redirect-to-mobile.js"></script>
<link rel="stylesheet" href="/css/no-text-highlighting.css">
</head>
<body>
diff --git a/index.html b/index.html
index d3d1624..67af1e8 100644
--- a/index.html
+++ b/index.html
@@ -24,6 +24,7 @@
<link rel="author" href="humans.txt" />
<script src="/js/hide-context-menu.js"></script>
<script src="/js/loader-animation.js"></script>
+ <script src="/js/redirect-to-mobile.js"></script>
<script type="application/ld+json">
{
"name": "s1nical",
diff --git a/js/app.js b/js/app.js
index f20085d..48022f1 100644
--- a/js/app.js
+++ b/js/app.js
@@ -11,11 +11,6 @@ if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phon
}
*/
-// CHECKS IF USER IS ON MOBILE
-if( screen.width <= 480 ) {
- location.href = '/mobile';
-}
-
/* Honestly I have NO idea what this is but it was in the original site source code so I kept it :)
**(async () => {
** if (navigator.webdriver || document.visibilityState === 'prerender' || !location.hostname) {
diff --git a/js/redirect-to-desktop.js b/js/redirect-to-desktop.js
new file mode 100644
index 0000000..64d767d
--- /dev/null
+++ b/js/redirect-to-desktop.js
@@ -0,0 +1,4 @@
+// CHECKS IF USER IS ON DESKTOP
+if (screen.width > 480) {
+ location.href = '/index.html';
+} \ No newline at end of file
diff --git a/js/redirect-to-mobile.js b/js/redirect-to-mobile.js
new file mode 100644
index 0000000..5807029
--- /dev/null
+++ b/js/redirect-to-mobile.js
@@ -0,0 +1,4 @@
+// CHECKS IF USER IS ON MOBILE
+if (screen.width <= 480) {
+ location.href = '/mobile';
+} \ No newline at end of file
diff --git a/konami/index.html b/konami/index.html
index 3aedd59..859a2f4 100644
--- a/konami/index.html
+++ b/konami/index.html
@@ -13,6 +13,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<link rel="stylesheet" href="/konami/css/main.css">
<script src="/konami/js/main.js"></script>
+ <script src="/js/redirect-to-mobile.js"></script>
<meta name="description" content="s1nical is a full stack developer.">
<meta property="og:description" content="s1nical is a full stack developer.">
<meta property="og:title" content="s1nical">
diff --git a/konami/js/main.js b/konami/js/main.js
index 9ffed54..c75bb27 100644
--- a/konami/js/main.js
+++ b/konami/js/main.js
@@ -19,11 +19,6 @@ function Scroll() {
}
Scroll();
-// CHECKS IF USER IS ON MOBILE
-if (screen.width <= 480) {
- location.href = '/mobile';
-}
-
// KONAMI CODE FOR TOASTY
// a key map of allowed keys
diff --git a/mobile/index.html b/mobile/index.html
index 311dbcb..b186306 100644
--- a/mobile/index.html
+++ b/mobile/index.html
@@ -10,6 +10,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/trianglify/0.3.1/trianglify.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<link rel="stylesheet" href="/mobile/css/main.css">
+ <script src="/js/redirect-to-desktop.js"></script>
<meta name="description" content="s1nical is a full stack developer.">
<meta property="og:description" content="s1nical is a full stack developer.">
<meta property="og:title" content="s1nical">
diff --git a/mobile/js/app.js b/mobile/js/app.js
index ae22283..af7b893 100644
--- a/mobile/js/app.js
+++ b/mobile/js/app.js
@@ -3,11 +3,6 @@ $(window).on("load", function () {
$(".loader-wrapper").fadeOut("slow");
})
-// CHECKS IF USER IS ON DESKTOP
-if( screen.width > 480 ) {
- location.href = '/index.html';
-}
-
// BACKGROUND SPARKLES
// SCRIPT #1
@@ -46,7 +41,7 @@ var time = 10,
pathCollection = $paths.get(),
count = $paths.length;
-console.log(count);
+// console.log(count);
pathCollection.sort(function () {
return Math.random() * 10 > 5 ? 1 : -1;
@@ -80,7 +75,7 @@ setTimeout(function () {
});
}, 2000);
-// Honestly I have NO idea what this is but it was in the original site source code so I kept it :)
+/* Honestly I have NO idea what this is but it was in the original site source code so I kept it :)
(async () => {
if (navigator.webdriver || document.visibilityState === 'prerender' || !location.hostname) {
return;
@@ -88,4 +83,4 @@ setTimeout(function () {
document.querySelector('a[href="/cdn-cgi/l/email-protection"]').href = `\x6dailto:hi\x40${location.hostname}`;
})();
-
+*/ \ No newline at end of file