a bit of housekeeping work on the website

This commit is contained in:
Sky 2023-08-26 13:54:31 -04:00
parent a963928c53
commit 4f4773ddae
4 changed files with 39 additions and 16 deletions

View File

@ -57,7 +57,7 @@
</ul> </ul>
<h2>Bookmarklets</h2> <h2>Bookmarklets</h2>
<a href='%3Chtml%3E%3Chead%3E%3Cscript%20src%3Dhttps%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F3.7.0%2Fjquery.min.js%3E%3C%2Fscript%3E%3Cscript%3Elet%20currentver%3D%22v1.0.0%22%3Bvar%20ver%2Ccdnurl%3Bfunction%20loadGames%28%29%7B%24%28%22%23backarrow%22%29.hide%28%29%2C%24.getJSON%28cdnurl%2B%22%2Fgames.json%22%2Cfunction%28t%29%7Bfor%28let%20e%3D0%3Be%3Ct.length%3Be%2B%2B%29%7Bvar%20n%3D%24%28%22%3Cdiv%3E%22%29.prop%28%7Bclass%3A%22game%22%2Cstyle%3A%22cursor%3A%20pointer%3B%22%2Cid%3At%5Be%5D.directory%7D%29.append%28%24%28%22%3Cimg%3E%22%29.prop%28%7Bsrc%3Acdnurl%2B%22%2F%22%2Bt%5Be%5D.directory%2B%22%2F%22%2Bt%5Be%5D.image%2Calt%3At%5Be%5D.name%2B%22%20logo%22%7D%29%29.append%28%24%28%22%3Ch1%3E%22%29.text%28t%5Be%5D.name%29%29%3B%24%28%22%23games%22%29.append%28n%29%7D%7D%29%7Dfunction%20redirectGame%28e%2Ct%29%7Bvar%20n%3Ddocument.createElement%28%22iframe%22%29%3B%24%28%22%23games%22%29.hide%28%29%2C%24%28%22%23backarrow%22%29.show%28%29%2C%24%28%22%23gametitle%22%29.show%28%29%2C%24%28%22%23gametitle%22%29.text%28t%29%2Cn.src%3Dcdnurl%2B%22%2F%22%2Be%2B%22%2Findex.html%22%2Cdocument.body.appendChild%28n%29%7Dfunction%20exitGame%28%29%7B%24%28%22iframe%22%29.remove%28%29%2C%24%28%22%23backarrow%22%29.hide%28%29%2C%24%28%22%23gametitle%22%29.hide%28%29%2C%24%28%22%23games%22%29.show%28%29%7Dasync%20function%20getCDN%28%29%7BcheckVer%28%29%2C%24.getJSON%28%22https%3A%2F%2Fraw.githubusercontent.com%2Fskysthelimitt%2Fselenite-optimized%2Fmain%2Flinks.json%22%2Casync%20function%28e%29%7Bcdnurls%3De.urls%3Bfor%28let%20e%3D0%3Be%3Ccdnurls.length%3Be%2B%2B%29%7Bif%28%28await%28await%20fetch%28cdnurls%5Be%5D%2B%22%2FREADME.md%22%29%29.text%28%29%29.startsWith%28%22%23%23%20Selenite%22%29%29%7Bconsole.log%28%22CDN%20Found%3A%20%22%2Bcdnurls%5Be%5D%29%2Ccdnurl%3Dcdnurls%5Be%5D%2CloadGames%28%29%3Bbreak%7Dconsole.log%28%22CDN%20Blocked%3A%20%22%2Bcdnurls%5Be%5D%29%7Dcdnurl%7C%7Calert%28%22looks%20like%20none%20of%20the%20cdns%20are%20available%2C%20please%20check%20again%20later.%22%29%7D%29%7Dasync%20function%20checkVer%28%29%7B%28await%28await%20fetch%28%22https%3A%2F%2Fraw.githubusercontent.com%2Fskysthelimitt%2Fselenite-optimized%2Fmain%2Fver%22%29%29.text%28%29%29.startsWith%28currentver%29%7C%7Cconfirm%28%22Your%20Selenite%20Optimized%20version%20is%20currently%20out%20of%20date.%20Click%20OK%20to%20update%2C%20or%20click%20cancel%20to%20continue.%22%29%26%26window.location.replace%28%22https%3A%2F%2Fraw.githubusercontent.com%2Fskysthelimitt%2Fselenite-optimized%2Fmain%2Fbuild%2Fbookmark.txt%22%29%7DgetCDN%28%29%2C%24%28document%29.ready%28function%28%29%7B%24%28document%29.on%28%22click%22%2C%22.game%22%2Cfunction%28e%29%7BredirectGame%28%24%28this%29.attr%28%22id%22%29%2C%24%28this%29.find%28%22h1%22%29.text%28%29%29%7D%29%7D%29%3B%3C%2Fscript%3E%3Cstyle%3E%23title%2C.game%7Bdisplay%3Ainline-block%7D.game%7Bwidth%3A13%25%3Bbackground-color%3A%23000%3Bpadding%3A1%25%3Bborder-radius%3A10%25%3Bmargin%3A2%25%3Btransition-duration%3A.5s%7D.game%3Ahover%7Btransform%3Ascale%281.05%29%7D.game%20h1%7Bfont-size%3A.85em%3Bcolor%3A%23fff%7D.game%20img%7Bwidth%3A100%25%3Baspect-ratio%3A1%2F1%7Diframe%7Bwidth%3A100%25%3Bheight%3A95%25%7D%23title%7Bheight%3A5%25%7D%3C%2Fstyle%3E%3C%2Fhead%3E%3Cbody%3E%3Cdiv%20id%3Dtitle%3E%3Cimg%20src%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgoogle%2Fmaterial-design-icons%2Fmaster%2Fsymbols%2Fweb%2Farrow_back%2Fmaterialsymbolsrounded%2Farrow_back_48px.svg%20style%3Dcursor%3Apointer%20id%3Dbackarrow%20onclick%3DexitGame%28%29%3E%3Cspan%20id%3Dgametitle%3Esorry%20it%20looks%20so%20bad%2C%20have%20to%20keep%20the%20website%20as%20minimal%20as%20possible%3C%2Fspan%3E%3C%2Fdiv%3E%3Cdiv%20id%3Dgames%3E%3C%2Fdiv%3E%3C%2Fbody%3E%3C%2Fhtml%3E' class="bookmarklet">Selenite Minified</a> <a class="seleniteminified bookmarklet">Selenite Minified</a>
<p>Drag the link above to your bookmarks bar. This is a minified version of Selenite, that you can open at any time, without relying on a single website.</p> <p>Drag the link above to your bookmarks bar. This is a minified version of Selenite, that you can open at any time, without relying on a single website.</p>
<a href='javascript:console.log(document.body.contentEditable="true"==document.body.contentEditable?"false":"true");' class="bookmarklet">Edit any page</a> <a href='javascript:console.log(document.body.contentEditable="true"==document.body.contentEditable?"false":"true");' class="bookmarklet">Edit any page</a>
<p>Drag the link above to your bookmarks bar. This allows you to edit the text of any webpage.</p> <p>Drag the link above to your bookmarks bar. This allows you to edit the text of any webpage.</p>

View File

@ -2,7 +2,7 @@
function getMainSave() { function getMainSave() {
var mainSave = {}; var mainSave = {};
// List of items in localStorage that should not be saved // List of items in localStorage that should not be saved
var localStorageDontSave = ["sdsadawdasdasd"]; var localStorageDontSave = ["supportalert"];
// Convert localStorage to an array of key-value pairs and remove the items that should not be saved // Convert localStorage to an array of key-value pairs and remove the items that should not be saved
localStorageSave = Object.entries(localStorage); localStorageSave = Object.entries(localStorage);

View File

@ -158,13 +158,13 @@ function selectRandomGame() {
position: "center", // `left`, `center` or `right` position: "center", // `left`, `center` or `right`
style: { style: {
background: background:
"linear-gradient(42deg, rgba(36, 69, 128, 1) 100%, rgb(24, 17, 87) 0%)", "linear-gradient(var(--bg-1), var(--bg-2))",
boxShadow: "0px 0px 5px 5px var(--input-bg-color)",
width: "25%", width: "25%",
}, },
onClick: function () {}, // Callback after click onClick: function () {}, // Callback after click
}).showToast(); }).showToast();
setTimeout(() => { setTimeout(() => {
redirectGame(gamelist[randomgame].directory); redirectGame(gamelist[randomgame].directory);
s;
}, 3000); }, 3000);
} }

View File

@ -8,28 +8,51 @@ function check() {
if ($("#panicmode").length > 0) { if ($("#panicmode").length > 0) {
$("#panicmode").prop({ href: panicurl }); $("#panicmode").prop({ href: panicurl });
} }
if ($(".seleniteminified").length > 0) {
$.get("https://raw.githubusercontent.com/skysthelimitt/selenite-optimized/main/build/bookmark.txt", function(data) {
$(".seleniteminified").prop({ href: data });
})
}
} }
window.onload = function () { window.onload = function () {
checkAlert();
interval = setInterval(check, 50); interval = setInterval(check, 50);
}; };
window.addEventListener("error", function (event) { window.addEventListener(
"error",
function (event) {
if (event.target instanceof HTMLImageElement) { if (event.target instanceof HTMLImageElement) {
alert( alert(
"Error: Image failed to load." + "Error: Image failed to load." +
"\nFull Image URL: " + event.target.src + "\nFull Image URL: " +
'\nPlease take a screenshot WITH THIS ERROR VISIBLE and click "Report a Bug" or go to https://forms.gle/j75WUn6UhdqsRZgf7' event.target.src +
) '\nPlease take a screenshot WITH THIS ERROR VISIBLE and click "Report a Bug" or go to https://forms.gle/j75WUn6UhdqsRZgf7'
);
event.target.src = "/favicon.png"; event.target.src = "/favicon.png";
} else { } else {
alert ( alert(
"Error: " + event.message + "Error: " +
"\nScript: " + event.filename + event.message +
"\nLine: " + event.lineno + "\nScript: " +
"\nColumn: " + event.colno + event.filename +
"\nStackTrace: " + event.error + "\nLine: " +
'\nPlease take a screenshot WITH THIS ERROR VISIBLE and click "Report a Bug" or go to https://forms.gle/j75WUn6UhdqsRZgf7' event.lineno +
"\nColumn: " +
event.colno +
"\nStackTrace: " +
event.error +
'\nPlease take a screenshot WITH THIS ERROR VISIBLE and click "Report a Bug" or go to https://forms.gle/j75WUn6UhdqsRZgf7'
); );
} }
}, true); },
true
);
function checkAlert() {
if(!Cookies.get("supportalert")) {
alert('Welcome to Selenite!\nI\'m a single developer that works on this website, so I would appreciate your support! You can pay on Patreon by clicking the "Support" button, which will have private links, or disable your adblock to help support me!\nI work on this website for free, so any support would be appreciated! Please share this website with anyone you know, so this website can expand even more!\nGo to bookmarklets and then add "Selenite Minified" to your bookmarks to have an unblocked version 24/7 :) \nI don\'t want to be annoying, so you won\'t see this message for another 30 days :)');
Cookies.set('supportalert', true, { expires: 31 });
}
}