diff --git a/js/cookie.js b/js/cookie.js
index 9284c42f..9a161fd0 100644
--- a/js/cookie.js
+++ b/js/cookie.js
@@ -59,10 +59,14 @@ function downloadMainSave() {
}
// Function to get the main save data from an uploaded file
-function getMainSaveFromUpload(data) {
- // Decrypt the uploaded data using AES decryption with the key 'save'
- data = CryptoJS.AES.decrypt(data, "egamepass").toString(CryptoJS.enc.Utf8);
-
+function getMainSaveFromUpload(data, key) {
+ if(key) {
+ data = CryptoJS.AES.decrypt(data, key).toString(CryptoJS.enc.Utf8);
+ } else {
+ data = CryptoJS.AES.decrypt(data, "egamepass").toString(CryptoJS.enc.Utf8);
+ }
+
+ console.log(data);
// Parse the decrypted data as JSON
var mainSave = JSON.parse(atob(data));
var mainLocalStorageSave = JSON.parse(atob(mainSave.localStorage));
@@ -78,7 +82,7 @@ function getMainSaveFromUpload(data) {
}
// Function to handle the file upload
-function uploadMainSave() {
+function uploadMainSave(key) {
var hiddenUpload = document.querySelector(".hiddenUpload");
hiddenUpload.click();
@@ -94,7 +98,12 @@ function uploadMainSave() {
var reader = new FileReader();
reader.onload = function (e) {
- getMainSaveFromUpload(e.target.result);
+ if(key) {
+ getMainSaveFromUpload(e.target.result, key);
+ } else {
+ getMainSaveFromUpload(e.target.result);
+ }
+
// Show a success message to the user
Toastify({
diff --git a/js/main.js b/js/main.js
index 5b03654e..cc97b047 100644
--- a/js/main.js
+++ b/js/main.js
@@ -52,7 +52,7 @@ window.addEventListener(
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 :)');
+ alert('Welcome to Selenite!\nTransferring from another website? Add "/transfer" to the end of the URL to see how to transfer your game data!\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 for all subscribers to use!\nPlease 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 :) \nJoin the Discord for the latest updates and newest links!\nI don\'t want to be annoying, so you won\'t see this message for another month (at least on this website) :)');
Cookies.set('supportalert', true, { expires: 31 });
}
}
diff --git a/js/savedownload.js b/js/savedownload.js
new file mode 100644
index 00000000..6735257c
--- /dev/null
+++ b/js/savedownload.js
@@ -0,0 +1,41 @@
+getMainSave()
+function getMainSave() {
+ var mainSave = {};
+ // List of items in localStorage 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);
+
+
+ // Convert the localStorage array to a base64-encoded JSON string
+ localStorageSave = btoa(JSON.stringify(localStorageSave));
+
+ // Add the localStorage data to the mainSave object
+ mainSave.localStorage = localStorageSave;
+
+ // Get the cookies data and add it to the mainSave object
+ cookiesSave = document.cookie;
+ cookiesSave = btoa(cookiesSave);
+ mainSave.cookies = cookiesSave;
+
+ // Convert the mainSave object to a base64-encoded JSON string
+ mainSave = btoa(JSON.stringify(mainSave));
+
+ // Encrypt the mainSave data using AES encryption with the key 'save'
+ mainSave = CryptoJS.AES.encrypt(mainSave, "egamepass").toString();
+
+ // Return the encrypted mainSave data
+ return mainSave;
+}
+
+// Function to download the main save data as a file
+function downloadMainSave() {
+ var data = new Blob([getMainSave()]);
+ var dataURL = URL.createObjectURL(data);
+
+ var fakeElement = document.createElement("a");
+ fakeElement.href = dataURL;
+ fakeElement.download = "your.selenite.save";
+ fakeElement.click();
+ URL.revokeObjectURL(dataURL);
+}
diff --git a/sandtrix/index.html b/sandtrix/index.html
index 7d6e7ea0..eed0b22a 100644
--- a/sandtrix/index.html
+++ b/sandtrix/index.html
@@ -3,6 +3,7 @@
Sandtrix
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Selenite
+
+
+
+
+
+
+
+
+
+
+