diff --git a/.gitignore b/.gitignore index e69de29..cb76b31 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +resources/ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..12caa8b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "tabWidth": 4, + "printWidth": 10000 +} \ No newline at end of file diff --git a/404.html b/404.html index 16975b7..ef64c88 100644 --- a/404.html +++ b/404.html @@ -32,9 +32,22 @@ @@ -57,8 +70,33 @@

Trying to access a page such as login, register, or a user page? Those are only available on official links.

Join the Discord to find official links.

+<<<<<<< HEAD +======= + + + + + +>>>>>>> c2041b6 (first dev commit) +======= + + + + + + + + + + + + + + + +>>>>>>> c2041b6 (first dev commit) diff --git a/js/games.js b/js/games.js index c8cee27..0c0ede6 100644 --- a/js/games.js +++ b/js/games.js @@ -1,3 +1,4 @@ +<<<<<<< HEAD $.getJSON("/data/games.json", function (data) { if (document.readyState === "complete") { loadGames(data); @@ -197,3 +198,58 @@ function recommendedGames() { $("#recommend").text("Click to view recommended games!"); } } +======= +document.addEventListener("DOMContentLoaded", loadGames); +let elements = []; +async function loadGames() { + // taken from mdn + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort + let data = await (await fetch("/data/games.json")).json(); + sorted = data.sort((a, b) => { + const n1 = a.name.toUpperCase(); + const n2 = b.name.toUpperCase(); + if (n1 < n2) { + return -1; + } + if (n1 > n2) { + return 1; + } + // shouldnt happen but just incase + return 0; + }); + let gamesElement = document.getElementById("games"); + sorted.forEach(element => { + let newElement = document.createElement("game"); + newElement.setAttribute("data-target", element.directory); + let image = document.createElement("img"); + image.src = `/semag/${element.directory}/${element.image}` + let title = document.createElement("h1"); + title.innerText = element.name; + newElement.appendChild(image); + newElement.appendChild(title); + gamesElement.appendChild(newElement); + newElement.addEventListener("click", ()=>{ + location.href=`/loader.html?title=${encodeURIComponent(element.name)}&dir=${element.directory}&img=${element.image}` + }) + elements.push(newElement); + }); +} +document.addEventListener("DOMContentLoaded", ()=>{ + document.getElementById("gamesearch").addEventListener("input", ()=>{ + let input = document.getElementById("gamesearch").value.toUpperCase(); + let total = 0; + if(elements.length > 0) { + elements.forEach((element) => { + let title = element.childNodes[1].innerText.toUpperCase(); + if(title.includes(input)) { + element.style.display = "flex"; + } else { + element.style.display = "none"; + total++; + } + }) + } + document.getElementById("noResults").style.display = total >= elements.length ? "flex" : "none" + }) +}) +>>>>>>> c2041b6 (first dev commit) diff --git a/js/main.js b/js/main.js index 49862cd..fd50c0f 100644 --- a/js/main.js +++ b/js/main.js @@ -1,3 +1,4 @@ +<<<<<<< HEAD var interval; document.addEventListener("DOMContentLoaded", function () { if (localStorage.getItem("theme")) { @@ -161,4 +162,218 @@ document.head.appendChild(cookieConsentScript); let cookieConsentStyle = document.createElement("link"); cookieConsentStyle.href = "/js/cookieConsent.css"; cookieConsentStyle.rel = "stylesheet"; -document.head.appendChild(cookieConsentStyle); \ No newline at end of file +document.head.appendChild(cookieConsentStyle); +======= +function setBackground() { + let randomNumbers = [100-Math.abs(Math.floor(Math.random() * 200) - 99), 100-Math.abs(Math.floor(Math.random() * 200) - 99)]; + document.body.style.setProperty("--gradient-x", randomNumbers[0] + "%"); + document.body.style.setProperty("--gradient-y", randomNumbers[1] + "%"); + setTimeout(setBackground, 30000) +} +function loadPJS() { + let div = document.createElement("div"); + div.id = "particles-js"; + document.body.appendChild(div); + let script = document.createElement("script"); + script.src = "https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"; + document.head.appendChild(script); + script.addEventListener("load", ()=>{ + particlesJS.load('particles-js', "js/particlesjs-config.json", ()=>{}); + }); +} + +function cursor() { + let cursor = document.createElement("div"); + cursor.style.width = "30px"; + cursor.style.height = "30px"; + cursor.style.backgroundColor = "var(--color-1)"; + cursor.style.position = "absolute"; + cursor.style.borderRadius = "100%"; + // cursor.style.filter = "blur(40px)"; + cursor.style.pointerEvents = "none"; + document.body.appendChild(cursor); + document.addEventListener("mousemove", (e) => { + cursor.style.top = `${e.clientY - 15}px`; + cursor.style.left = `${e.clientX - 15}px`; + }) +} + +document.addEventListener("DOMContentLoaded", ()=>{ + setBackground(); + loadPJS(); + cursor(); +}) + +document.addEventListener("scroll", ()=>{ + console.log("scroll"); + document.getElementById("particles-js").style.top = window.scrollY + "px"; +}) + + + + +// var interval; +// document.addEventListener("DOMContentLoaded", function () { +// if (localStorage.getItem("theme")) { +// localStorage.setItem("selenite.theme", localStorage.getItem("theme")); +// localStorage.removeItem("theme"); +// } +// if (localStorage.getItem("selenite.theme")) { +// document.body.setAttribute("theme", localStorage.getItem("selenite.theme")); +// } else { +// document.body.setAttribute("theme", "main"); +// } +// if (document.querySelectorAll("[id=adcontainer]")) { +// for (let i = 0; i < document.querySelectorAll("[id=adcontainer]").length; i++) { +// if (Math.random() < 0.5 || localStorage.getItem("selenite.adblock") == "true") document.querySelectorAll("[id=adcontainer]")[i].innerHTML = ""; +// } +// } +// const iconSetting = document.querySelector("input#discordIcon"); +// const blockClose = document.querySelector("input#blockClose"); +// const openBlank = document.getElementById("blank"); +// const bgTheme = document.querySelector("input#bgTheme"); +// // if (document.querySelector("widgetbot-crate")) { +// // if (localStorage.getItem("selenite.discordIcon") == "true") { +// // const widget = document.querySelector("widgetbot-crate"); +// // widget.setAttribute("style", "display:none"); +// // } +// // } +// if (document.querySelector("input#discordIcon")) { +// if (localStorage.getItem("selenite.discordIcon") == "true") { +// iconSetting.checked = true; +// } +// iconSetting.addEventListener("click", () => { +// localStorage.setItem("selenite.discordIcon", iconSetting.checked); +// }); +// } +// if (document.querySelector("input#blockClose")) { +// if (localStorage.getItem("selenite.blockClose") == "true") { +// blockClose.checked = true; +// } +// blockClose.addEventListener("click", () => { +// localStorage.setItem("selenite.blockClose", blockClose.checked); +// }); +// } +// if (document.querySelector("input#tabDisguise")) { +// if (localStorage.getItem("selenite.tabDisguise") == "true") { +// tabDisguise.checked = true; +// } +// tabDisguise.addEventListener("click", () => { +// localStorage.setItem("selenite.tabDisguise", tabDisguise.checked); +// }); +// } +// if (document.querySelector("input#bgTheme")) { +// bgTheme.checked = true; +// } +// document.getElementById("blank").addEventListener("click", () => { +// win = window.open(); +// win.document.body.style.margin = "0"; +// win.document.body.style.height = "100vh"; +// html = ` +//
`; +// win.document.querySelector("html").innerHTML = html; +// win.eval(`let selenite = document.getElementById("selenite");console.log(selenite);selenite.setAttribute("src", "${location.origin}");console.log(selenite);document.getElementById("goBack").addEventListener("click", function () {selenite.contentDocument.location.href = selenite.contentDocument.location.origin;});document.getElementById("reload").addEventListener("click", function () {selenite.contentDocument.location.href = selenite.contentDocument.location.href;})`); +// location.href = "https://google.com"; +// close(); +// }); +// if ($("#panicmode").length > 0) { +// $("#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 }); +// }); +// $.get("https://raw.githubusercontent.com/car-axle-client/car-axle-client/v10/dist/build.js", function (data) { +// $(".caraxle").prop({ href: `javascript:${encodeURI(data)}` }); +// }); +// } +// }); +// function setPanicMode() { +// if (!$("#panic").val().startsWith("https")) { +// document.cookie = "panicurl=https://" + $("#panic").val(); +// return; +// } + +// document.cookie = "panicurl=" + $("#panic").val(); +// } +// function copyToClipboard(text) { +// navigator.clipboard.writeText(text); +// alert("Copied text!"); +// } +// function setTheme(theme) { +// localStorage.setItem("selenite.theme", theme); +// document.body.setAttribute("theme", theme); +// if (theme != "custom") { +// document.getElementById("customMenu").style.display = "none"; +// document.body.style = ""; +// } +// } +// function setPanicMode() { +// if (!$("#panic").val().startsWith("https")) { +// document.cookie = "panicurl=https://" + $("#panic").val(); +// return; +// } +// document.cookie = "panicurl=" + $("#panic").val(); +// } +// function setPassword() { +// localStorage.setItem("selenite.password", enc.encode(document.getElementById("pass").value)); +// } +// function delPassword() { +// location.hash = ""; +// localStorage.removeItem("selenite.passwordAtt"); +// localStorage.removeItem("selenite.password"); +// } + +// $(document).ready(function () { +// if (!window.location.href.startsWith("about:")) { +// $("#webicon").attr("placeholder", window.location.href.replace(/\/[^\/]*$/, "/")); +// } +// }); +// function loadScript(a, b) { +// var c = document.createElement("script"); +// (c.type = "text/javascript"), (c.src = a), (c.onload = b), document.head.appendChild(c); +// } +// function toast(message, onclick) { +// const toast = document.createElement("div"); +// toast.setAttribute("id", "toast"); +// console.log(message.time); +// toast.innerHTML = `

${message.title}${message.time ? ` - ${timeAgo(new Date(message.time * 1000))}` : ""}

${message.message}

`; +// toast.style.animation = "toastFade 6s"; +// document.body.appendChild(toast); +// if (onclick) { +// toast.addEventListener("click", onclick); +// toast.style.cursor = "pointer"; +// } +// setTimeout(() => { +// toast.remove(); +// }, 6000); +// } +// function timeAgo(input) { +// const date = input instanceof Date ? input : new Date(input); +// const formatter = new Intl.RelativeTimeFormat("en"); +// const ranges = { +// years: 3600 * 24 * 365, +// months: 3600 * 24 * 30, +// weeks: 3600 * 24 * 7, +// days: 3600 * 24, +// hours: 3600, +// minutes: 60, +// seconds: 1, +// }; +// const secondsElapsed = (date.getTime() - Date.now()) / 1000; +// for (let key in ranges) { +// if (ranges[key] < Math.abs(secondsElapsed)) { +// const delta = secondsElapsed / ranges[key]; +// return formatter.format(Math.round(delta), key); +// } +// } +// } +// let cookieConsentScript = document.createElement("script"); +// cookieConsentScript.src = "/js/cookieConsent.js"; +// document.head.appendChild(cookieConsentScript); +// let cookieConsentStyle = document.createElement("link"); +// cookieConsentStyle.href = "/js/cookieConsent.css"; +// cookieConsentStyle.rel = "stylesheet"; +// document.head.appendChild(cookieConsentStyle); +>>>>>>> c2041b6 (first dev commit) diff --git a/js/particlesjs-config.json b/js/particlesjs-config.json new file mode 100755 index 0000000..afa918c --- /dev/null +++ b/js/particlesjs-config.json @@ -0,0 +1,105 @@ +{ + "particles": { + "number": { + "value": 100, + "density": { + "enable": true, + "value_area": 800 + } + }, + "color": { + "value": "#ffffff" + }, + "shape": { + "type": "circle", + "stroke": { + "width": 0, + "color": "#000000" + }, + "polygon": { + "nb_sides": 1 + } + }, + "opacity": { + "value": 1, + "random": true, + "anim": { + "enable": true, + "speed": 1, + "opacity_min": 0, + "sync": false + } + }, + "size": { + "value": 5, + "random": true, + "anim": { + "enable": true, + "speed": 1, + "size_min": 0.3, + "sync": false + } + }, + "line_linked": { + "enable": false, + "distance": 150, + "color": "#ffffff", + "opacity": 0.4, + "width": 1 + }, + "move": { + "enable": true, + "speed": 0.4, + "direction": "bottom", + "random": true, + "straight": false, + "out_mode": "out", + "bounce": false, + "attract": { + "enable": true, + "rotateX": 5000, + "rotateY": 5000 + } + } + }, + "interactivity": { + "detect_on": "window", + "events": { + "onhover": { + "enable": true, + "mode": "grab" + }, + "onclick": { + "enable": false, + "mode": "repulse" + }, + "resize": true + }, + "modes": { + "grab": { + "distance": 200, + "line_linked": { + "opacity": 0.3 + } + }, + "bubble": { + "distance": 250, + "size": 0, + "duration": 2, + "opacity": 0, + "speed": 3 + }, + "repulse": { + "distance": 50, + "duration": 1 + }, + "push": { + "particles_nb": 4 + }, + "remove": { + "particles_nb": 2 + } + } + }, + "retina_detect": true +} \ No newline at end of file diff --git a/loader.html b/loader.html index a84c4ad..b8ad011 100644 --- a/loader.html +++ b/loader.html @@ -16,6 +16,7 @@ + + + + +>>>>>>> c2041b6 (first dev commit) Selenite +<<<<<<< HEAD
@@ -73,5 +98,18 @@ Donate About +======= + +
+ +
+ +

Selenite

+
+ +
+
+
+>>>>>>> c2041b6 (first dev commit) diff --git a/projects.html b/projects.html index ce7eb50..65d9df8 100644 --- a/projects.html +++ b/projects.html @@ -17,7 +17,13 @@ +<<<<<<< HEAD +======= + + + +>>>>>>> c2041b6 (first dev commit) @@ -31,6 +37,7 @@ crossorigin="anonymous"> +<<<<<<< HEAD
+======= + +
+ + + + + + + + + + + + + + + + +
+ + +

nothing was found! try a new search query.

+
+>>>>>>> c2041b6 (first dev commit)