Skip to content

Commit

Permalink
add a website adjuster
Browse files Browse the repository at this point in the history
  • Loading branch information
JeelDobariya38 committed Jul 4, 2024
1 parent cf34884 commit 98472b3
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 68 deletions.
6 changes: 5 additions & 1 deletion create-script.html → desktop-create-script.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<html lang="en">

<head>
<!-- It load First Due, To Redirects Handling -->
<script src="./scripts/website_adjust.js"></script>

<!-- Normal Head Content -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ScriptMaker | Create</title>
<title>Script Maker | Create</title>

<script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.0/typed.js"
integrity="sha512-ioFpA4cD4gmoOhHglW4f6gep7w+YL7UMKtXx4ebJ5NN4SscmnZYYmSjkA+DaHGvBI4wpYVPx2C7DmmV9TgbIbQ=="
Expand Down
File renamed without changes.
60 changes: 60 additions & 0 deletions desktop-homepage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">

<head>
<!-- It load First Due, To Redirects Handling -->
<script src="./scripts/website_adjust.js"></script>

<!-- Normal Head Content -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Script Maker | Home</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.0/typed.js"
integrity="sha512-ioFpA4cD4gmoOhHglW4f6gep7w+YL7UMKtXx4ebJ5NN4SscmnZYYmSjkA+DaHGvBI4wpYVPx2C7DmmV9TgbIbQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
<link rel="icon" type="image/x-icon" href="./assets/favicon.ico">
<link rel="stylesheet" href="./styles/style.css">
<link rel="stylesheet" href="./styles/tailwind/output.css">
<script src="./scripts/utils.js"></script>
<script src="./scripts/script.js"></script>
</head>

<body class="dark-theme">
<main>
<div class="flex-center flex-col full-screen">
<h1 class="text-6xl">ScriptMaker</h1>
<p class="text-lg">
Make Scripts that <span id="typer" class="text-slate-400"></span>
</p>
<div class="flex-center gap-8 p-4">
<a href="desktop-explore.html">
<div class="btn"><i class="icon fa-solid fa-plus"></i>Explore</div>
</a>
<a href="desktop-create-script.html">
<div class="btn"><i class="icon fa-solid fa-arrow-up-right-from-square"></i>Create</div>
</a>
</div>
</div>
</main>

<footer class="flex justify-center">
<a href="https://github.com/JeelDobariya38/ScriptMaker">
<div class="p-4 flex items-center gap-2">
<h2 class="text-lg font-black">Repository: </h2>
<p class="text-sm font-bold text-blue-500">JeelDobariya38/ScriptMaker</p>
</div>
</a>
<a href="https://raw.githubusercontent.com/JeelDobariya38/ScriptMaker/master/LICENSE.txt">
<div class="p-4 flex items-center gap-2">
<h2 class="text-lg font-black">License: </h2>
<p class="text-sm font-bold text-blue-500">MIT</p>
</div>
</a>
</footer>
</body>

</html>
66 changes: 12 additions & 54 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,60 +1,18 @@
<!DOCTYPE html>
<html lang="en">

<head>
<!-- It load First Due, To Redirects Handling -->
<script src="./scripts/website_adjust.js"></script>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Script Maker | Inital Page</title>
</head>

<!-- Normal Head Content -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ScriptMaker | Home</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.0/typed.js"
integrity="sha512-ioFpA4cD4gmoOhHglW4f6gep7w+YL7UMKtXx4ebJ5NN4SscmnZYYmSjkA+DaHGvBI4wpYVPx2C7DmmV9TgbIbQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
<link rel="icon" type="image/x-icon" href="./assets/favicon.ico">
<link rel="stylesheet" href="./styles/style.css">
<link rel="stylesheet" href="./styles/tailwind/output.css">
<script src="./scripts/utils.js"></script>
<script src="./scripts/script.js"></script>
</head>

<body class="dark-theme">
<main>
<div class="flex-center flex-col full-screen">
<h1 class="text-6xl">ScriptMaker</h1>
<p class="text-lg">
Make Scripts that <span id="typer" class="text-slate-400"></span>
</p>
<div class="flex-center gap-8 p-4">
<a href="explore.html">
<div class="btn"><i class="icon fa-solid fa-plus"></i>Explore</div>
</a>
<a href="create-script.html">
<div class="btn"><i class="icon fa-solid fa-arrow-up-right-from-square"></i>Create</div>
</a>
</div>
</div>
</main>

<footer class="flex justify-center">
<a href="https://github.com/JeelDobariya38/ScriptMaker">
<div class="p-4 flex items-center gap-2">
<h2 class="text-lg font-black">Repository: </h2>
<p class="text-sm font-bold text-blue-500">JeelDobariya38/ScriptMaker</p>
</div>
</a>
<a href="https://raw.githubusercontent.com/JeelDobariya38/ScriptMaker/master/LICENSE.txt">
<div class="p-4 flex items-center gap-2">
<h2 class="text-lg font-black">License: </h2>
<p class="text-sm font-bold text-blue-500">MIT</p>
</div>
</a>
</footer>
</body>
<body>
<h1>Script Maker | Inital Page</h1>
<p>Please Wait we redirecting you!!</p>
<script>
window.location.pathname += "mobile-homepage.html";
</script>
</body>

</html>
8 changes: 6 additions & 2 deletions small_create-script.html → mobile-create-script.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<html lang="en">

<head>
<!-- It load First Due, To Redirects Handling -->
<script src="./scripts/website_adjust.js"></script>

<!-- Normal Head Content -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ScriptMaker | Create</title>
<title>Script Maker | Create</title>

<script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.0/typed.js"
integrity="sha512-ioFpA4cD4gmoOhHglW4f6gep7w+YL7UMKtXx4ebJ5NN4SscmnZYYmSjkA+DaHGvBI4wpYVPx2C7DmmV9TgbIbQ=="
Expand All @@ -19,7 +23,7 @@
<script src="./scripts/utils.js"></script>
<script src="./scripts/compile.js"></script>
<script src="./scripts/extract_script_content.js"></script>
<script src="./scripts/createclick.js"></script>
<script src="./scripts/clickcreate.js"></script>
<script src="./scripts/script.js"></script>
</head>

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions smallscreens_homepage.html → mobile-homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Normal Head Content -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ScriptMaker | Home</title>
<title>Script Maker | Home</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.0/typed.js"
integrity="sha512-ioFpA4cD4gmoOhHglW4f6gep7w+YL7UMKtXx4ebJ5NN4SscmnZYYmSjkA+DaHGvBI4wpYVPx2C7DmmV9TgbIbQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Expand All @@ -30,10 +30,10 @@ <h1 class="text-4xl font-black">ScriptMaker</h1>
Make Scripts that <span id="typer" class="text-slate-400">
</p>
<div class="flex-center gap-2 p-4">
<a href="small_explore.html">
<a href="mobile-explore.html">
<div class="btn"><i class="icon fa-solid fa-plus"></i>Explore</div>
</a>
<a href="small_create-script.html">
<a href="mobile-create-script.html">
<div class="btn"><i class="icon fa-solid fa-arrow-up-right-from-square"></i>Create</div>
</a>
</div>
Expand Down
File renamed without changes.
22 changes: 14 additions & 8 deletions scripts/website_adjust.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
function getMobileWebsite() {
return window.location.href.replace("index.html", "smallscreens_homepage.html");
return window.location.href.replace("desktop", "mobile");
}

function getDestopWebsite() {
return window.location.href.replace("smallscreens_homepage.html", "index.html");
return window.location.href.replace("mobile", "desktop");
}


function checkScreenWidth() {
if (window.innerWidth <= 650) {
if (window.innerWidth <= 768) { // from approx tablet onwards...
console.log("It seems like you are on a Phone!!!!");
if (window.location.href.includes("index.html")) {
if (window.location.href.includes("desktop")) {
window.location.href = getMobileWebsite();
}
} else {
console.log("It seems like you are on a Desktop!!!!");
if (window.location.href.includes("homepage.html")) {
if (window.location.href.includes("mobile")) {
window.location.href = getDestopWebsite();
}
}
}

if (!window.location.pathname.includes(".html")) {
window.location.pathname += "index.html";
function Setup_Adjuster() {
if (!window.location.pathname.includes(".html")) {
window.location.pathname += "mobile-homepage.html";
}

window.addEventListener("load", checkScreenWidth);
window.addEventListener("resize", checkScreenWidth);
}
window.onload = checkScreenWidth;

Setup_Adjuster();

0 comments on commit 98472b3

Please sign in to comment.