added site checking

This commit is contained in:
Thomas G 2022-06-19 15:33:17 +10:00
parent c7f928cdf3
commit c7ac8a345c
7 changed files with 27 additions and 10 deletions

View File

@ -36,7 +36,7 @@
</div> </div>
</header> </header>
<header class="invisible" id="alert"> <header class="invisible" id="alert">
<p class="alerttext" >ALERT TEXT</p> <p class="alerttext" id="alerttext">ALERT TEXT</p>
</header> </header>
<div class="content"> <div class="content">
<p>Games Page</p> <p>Games Page</p>

View File

@ -36,7 +36,7 @@
</div> </div>
</header> </header>
<header class="invisible" id="alert"> <header class="invisible" id="alert">
<p class="alerttext" >ALERT TEXT</p> <p class="alerttext" id="alerttext">ALERT TEXT</p>
</header> </header>
<div class="content"> <div class="content">
<h1>Hello, OnlyTwentyCharacters!</h1> <h1>Hello, OnlyTwentyCharacters!</h1>

View File

@ -36,7 +36,7 @@
</div> </div>
</header> </header>
<header class="invisible" id="alert"> <header class="invisible" id="alert">
<p class="alerttext" >ALERT TEXT</p> <p class="alerttext" id="alerttext">ALERT TEXT</p>
</header> </header>
<div class="content"> <div class="content">
<h1>WELCOME TO MORBLOX!!!</h1> <h1>WELCOME TO MORBLOX!!!</h1>

View File

@ -36,7 +36,7 @@
</div> </div>
</header> </header>
<header class="invisible" id="alert"> <header class="invisible" id="alert">
<p class="alerttext" >ALERT TEXT</p> <p class="alerttext" id="alerttext">ALERT TEXT</p>
</header> </header>
<div class="content"> <div class="content">
<p>nothing</p> <p>nothing</p>

View File

@ -1,8 +1,8 @@
#alert { #alert {
height: 50px; height: fit-content;
margin: 0px; margin: 0px;
padding-left: 5px; padding-top: 1px;
padding-top: 0px; padding-bottom: 1px;
width: 100%; width: 100%;
text-align: center; text-align: center;
background: linear-gradient(#f07575 10%, #e13b3b 49%, #d22 50%, #de2323 100%); background: linear-gradient(#f07575 10%, #e13b3b 49%, #d22 50%, #de2323 100%);
@ -59,7 +59,7 @@ html {
font-family: "Helvetica"; font-family: "Helvetica";
src: url('Helvetica.ttf') format('truetype'),; src: url('Helvetica.ttf') format('truetype'),;
font-style: normal; font-style: normal;
background-color: rgb(75, 75, 75); background-color: #4b4b4b;
color: white; color: white;
} }
body { body {

17
main.js
View File

@ -10,3 +10,20 @@ window.addEventListener('resize', function() {
logo_full.className = ""; logo_full.className = "";
} }
}); });
window.onload = function() {
var alert = document.getElementById("alert")
var alerttext = document.getElementById("alerttext")
if (window.location.hostname == "") {
alerttext.innerHTML = "You are using this locally.";
alert.className = "";
} else if (window.location.hostname == "github.com") {
alerttext.innerHTML = "You are using this on the github pages site.";
alert.className = "";
} else if (window.location.hostname == "MORBLOX.com") {
alerttext.innerHTML = "You are using MORBLOX.com";
alert.className = "";
} else if (window.location.hostname == "morblox.us") {
alerttext.innerHTML = "You are using morblox.us";
alert.className = "";
}
};

View File

@ -36,7 +36,7 @@
</div> </div>
</header> </header>
<header class="invisible" id="alert"> <header class="invisible" id="alert">
<p class="alerttext" >ALERT TEXT</p> <p class="alerttext" id="alerttext">ALERT TEXT</p>
</header> </header>
<div class="content"> <div class="content">