Skip to content

Commit

Permalink
GB/GBC Warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Cattn committed Jan 5, 2023
1 parent a659fba commit 58ff57a
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 2 deletions.
14 changes: 14 additions & 0 deletions launchpad.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@
</div>

</div>

<div id="myModal1" class="modal">

<!-- Modal content -->
<div class="modal-content">
<span class="close">&times;</span>
<div class="center-row">
<p>You may get a warning on GB or GBC Color games about using your camera, you can deny access if you like, we do not collect information, are not able to see, do not track, the camera doesn't even work 99% of the time except for specific applications.</p>
</div>
<div class="space-frame"></div>
<div class="button-row"><a class="bottom-buttons button-frame frame-three" href="#" onclick="dontShowAgain();">Acknowledge This</a></div>
</div>

</div>
</body>
<script src="user_scripts/player-theme.js"></script>
<script src="user_scripts/popup.js"></script>
Expand Down
63 changes: 61 additions & 2 deletions user_scripts/popup.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
let doPopup = false;
let showAgain = true;
let showAgain1 = true;
let doPopup1 = false;
let showAgainStuffDat1 = localStorage.getItem("showAgainStuff1");
if (showAgainStuffDat1 == "true") {
let test1234 = localStorage.getItem("showAgain1");
showAgain1 = JSON.parse(test1234);
}
let showAgainStuffDat = localStorage.getItem("showAgainStuff");
if (showAgainStuffDat == "true") {
let test123 = localStorage.getItem("showAgain");
showAgain = JSON.parse(test123);
}
let showAgainStuff = JSON.parse(showAgainStuffDat);
let showAgainStuff1 = JSON.parse(showAgainStuffDat1);
if (/\bCrOS\b/.test(navigator.userAgent)) {
doPopup = true;
} else {
doPopup = false;
}

if (gameCoreType == 'gba') {
doPopup1 = true;
} else {
doPopup1 = false;
}


function surveyInitialize() {
if (doPopup == true) {
Expand All @@ -22,6 +36,14 @@ function surveyInitialize() {
let userOS = 0;
localStorage.setItem("userOS", JSON.stringify(userOS));
}
if (doPopup1 == true) {
let userGame = 1;
localStorage.setItem("userGame", JSON.stringify(userGame));
}
if (doPopup1 == false) {
let userGame = 0;
localStorage.setItem("userGame", JSON.stringify(userGame));
}
}

function surveyBuild() {
Expand All @@ -46,6 +68,28 @@ window.onclick = function(event) {
}
}

function surveyBuild2() {
var modal = document.getElementById("myModal");

// Get the button that opens the modal
var btn = document.getElementById("myBtn");

// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];

// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}

// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
}

function surveyCheck() {
let userOS = JSON.parse(localStorage.getItem("userOS"));
if (userOS == 1) {
Expand All @@ -55,15 +99,30 @@ function surveyCheck() {
modal.style.display = "block";
}
}
let userGame = JSON.parse(localStorage.getItem("userGame"));
if (userGame == 1) {
if (showAgain1 == true) {
surveyBuild2();
var modal1 = document.getElementById("myModal1");
modal1.style.display = "block";
}
}
}
surveyCheck();
surveyInitialize();

function dontShowAgain() {
let showAgain = false;
showAgainStuff = true;
let showAgain1 = false;
showAgainStuff = true
showAgainStuff1 = true;
localStorage.setItem("showAgainStuff1", JSON.stringify(showAgainStuff1));
localStorage.setItem("showAgain1", JSON.stringify(showAgain1));
localStorage.setItem("showAgainStuff", JSON.stringify(showAgainStuff));
localStorage.setItem("showAgain", JSON.stringify(showAgain));
var modal = document.getElementById("myModal");
modal.style.display = "none";
}
var modal1 = document.getElementById("myModal1");
modal1.style.display = "none";
}

0 comments on commit 58ff57a

Please sign in to comment.