Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
3kh0 committed May 20, 2024
1 parent 51d6e1c commit e61d18b
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
Welcome to 3kh0 lite, a lightweight, fast, clean game site.

## Features
- No tracking
- No ads
- No bloat
- Fast
- Clean
- Lightweight
- Obama approves 👍

## Get your copy
Expand Down
1 change: 1 addition & 0 deletions ads.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
google.com, pub-5756835229788588, DIRECT, f08c47fec0942fa0
5 changes: 2 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ <h1 style="font-size: 3em; text-align: center;">
</h1>
<span id="subtitle" style="font-size: 1.5em;">...</span>
<p style="text-align: center; max-width: 600px; margin: 20px auto;">
Welcome to 3kh0 lite, a lightweight, lightning fast, and simple game site.<br /><br />
Yes, no tracking, no ads, no garbage. It is privacy-respecting and <b>DOES</b> have games.<br />
Welcome to 3kh0 lite, a lightweight, lightning fast, and simple game site.<br />
<a href="/projects.html" style="text-decoration: none;"><button style="cursor: pointer; background-color: #22c55e; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; border-radius: 20px; margin-top: 20px;">Start playing!</button></a><br />
<br />
<a href="/misc.html" style="text-decoration: none;"><button style="cursor: pointer; background-color: #b625cc; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; border-radius: 20px; margin-top: 5px;">Tab Cloak and about:blank</button></a>
<a href="/misc.html" style="text-decoration: none;"><button style="cursor: pointer; background-color: #b625cc; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; border-radius: 20px; margin-top: 5px;">Tools and settings</button></a>
</p>
<p style="text-align: center; max-width: 600px; margin: 20px auto;">
&copy; 3kh0, 2024. All rights reserved. You are welcome to use and/or duplicate material from the <a href="https://github.com/3kh0/3kh0-lite" style="color: #22c55e;">GitHub repository</a> with proper credit to 3kh0.<br /><br />
Expand Down
20 changes: 18 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
console.warn(
"%cHello!!", "color: red; font-weight: 600; background: yellow; padding: 0 5px; border-radius: 5px",
"%cHello!!",
"color: red; font-weight: 600; background: yellow; padding: 0 5px; border-radius: 5px",
"Feel free to use anything you find here for your projects; credit is appreciated but not required! Visit my website at https://3kh0.net for more information."
);

// this setting controls if ads are shown,
// more info on the README.md file
var adStatus = localStorage.getItem("adConsent") === 'true'; // default: true

if (!adStatus) {
(function () {
var script = document.createElement("script");
script.async = true;
script.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5756835229788588";
script.crossOrigin = "anonymous";
document.head.appendChild(script);
console.log("Ads enabled, thank you for your support!");
})();
}

const local_title = localStorage.getItem("title");
const local_icon = localStorage.getItem("icon");
if (window.localStorage.hasOwnProperty("title")) {
Expand All @@ -12,4 +28,4 @@ if (window.localStorage.hasOwnProperty("title")) {
if (window.localStorage.hasOwnProperty("icon")) {
document.querySelector("link[rel=icon]").href = local_icon;
console.log("Icon set to: " + local_icon);
}
}
14 changes: 13 additions & 1 deletion js/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,16 @@ document.getElementById("create").onclick = function () {
iframe.allow = "fullscreen";
iframe.src = url.value;
win.document.body.appendChild(iframe);
};
};

var adConsentCheckbox = document.getElementById("adConsent");

adConsentCheckbox.checked = localStorage.getItem("adConsent") === 'true';

adConsentCheckbox.addEventListener('change', function () {
localStorage.setItem("adConsent", this.checked);
console.log("Ad consent status: " + this.checked);
alert("Changes saved.");
});

var adStatus = adConsentCheckbox.checked;
12 changes: 11 additions & 1 deletion misc.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
</style>
</head>
<body style="background-color: #121212; color: #ffffff; font-family: 'Roboto', sans-serif; margin: 0; padding: 5%; display: flex; flex-direction: column; justify-content: center; align-items: center;">
<body style="background-color: #121212; color: #ffffff; font-family: sans-serif; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh;">
<h2 style="text-align: center; font-size: 2em; margin-bottom: 1em;">Miscellaneous stuff</h2>
<div style="width: 100%; max-width: 600px; margin-bottom: 2em;">
<div>
Expand Down Expand Up @@ -40,6 +40,16 @@ <h1>Tab Cloaker</h1>
<button onclick="resetTabSettings();" style="padding: 10px 20px; border: none; border-radius: 10px; background-color: #b625cc; color: #ffffff;">Reset</button>
</div>
</div>
<div style="width: 100%; max-width: 600px; margin-bottom: 2em;">
<div>
<h1>Ads consent</h1>
<div>
<p>Sometimes, ads are shown to support the creator, if you would not like to see ads or it slows down your computer too much, you can disable them here.</p>
<label for="adConsent">Do not show ads at all:</label>
<input type="checkbox" id="adConsent" name="adConsent">
</div>
</div>
</div>
<p style="text-align: center; margin-top: 2em;">
<a href="/index.html" style="text-decoration: none;">
<button style="cursor: pointer; background-color: #22c55e; border: none; color: white; padding: 15px 32px; text-decoration: none; display: inline-block; font-size: 16px; border-radius: 20px; margin-top: 5px;">
Expand Down
2 changes: 1 addition & 1 deletion projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<body style="background-color: #121212; color: #ffffff; font-family: sans-serif; text-decoration: none; text-align: center;">
<h1 style="font-size: 3em; text-align: center;">Projects</h1>
<input type="text" id="search" onkeyup="searchGames()" placeholder="Search for games..." style="width: 100%; font-size: 18px; padding: 6px 20px; margin: auto; border-radius: 30px; max-width: 600px; margin-bottom: 10px;" />
<div id="loader" style="display: block; border: 16px solid #f3f3f3; border-top: 16px solid #3498db; border-radius: 50%; width: 120px; height: 120px; animation: spin 2s linear infinite; margin: auto; margin-top: 1rem;"></div>
<div id="loader" style="display: block; border: 16px solid #f3f3f3; border-top: 16px solid #3498db; border-radius: 50%; width: 120px; height: 120px; animation: spin 0.3s linear infinite; margin: auto; margin-top: 1rem;"></div>
<div id="game-container" class="flex-container"></div>
<p class="text-center">
<a href="/index.html" style="text-decoration: none;">
Expand Down

0 comments on commit e61d18b

Please sign in to comment.