From e4b54c1a72d83fb2340b0dc9a3fbfebbd2a2a0f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Ku=C5=BEela?= Date: Tue, 27 Feb 2024 09:34:30 +0100 Subject: [PATCH] Initial Commit --- index.css | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 20 +++++++++++++++++++ index.js | 25 +++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 index.css create mode 100644 index.html create mode 100644 index.js diff --git a/index.css b/index.css new file mode 100644 index 0000000..1946323 --- /dev/null +++ b/index.css @@ -0,0 +1,58 @@ +hero { + background: black; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100%; + width: 100%; + perspective: 1000px; +} + +heading { + color: white; + font-family: "Uni Sans CAPS"; + font-weight: bold; + font-size: 128px; +} + +subheading { + color: white; + font-family: "Uni Sans CAPS"; + font-weight: normal; + font-size: 32px; +} + +body { + margin: 0; +} + +downloadbutton { + border-radius: 16px; + height: 75px; + width: 333px; + background: white; + color: black; + font-size: 24px; + font-family: 'Uni Sans CAPS'; + font-weight: bold; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + transition: width 0.5s ease-in-out, background 0.5s ease-in-out, color 0.5s ease-in-out +} + +downloadbutton[disabled] { + background: #666; + color: #333; + width: 275px; +}; + +a#downloadbutton { + all: unset; + text-decoration: none; + cursor: pointer; + top: 20px; + position: relative; +} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..c8724f0 --- /dev/null +++ b/index.html @@ -0,0 +1,20 @@ + + + + + × deadforge × + + + + + + + + + DeadForge + A launcher by DeadCode + Download + + + + \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..918557c --- /dev/null +++ b/index.js @@ -0,0 +1,25 @@ +const heading = document.querySelector('heading'); +const subheading = document.querySelector('subheading'); +const button = document.querySelector('downloadbutton'); +const buttonlink = document.querySelector("a#downloadbutton") + +document.addEventListener('mousemove', (e) => { + const offsetX = (window.innerWidth / 2 - e.clientX) * 0.05; // Adjust the factor to control the movement intensity + const offsetY = (window.innerHeight / 2 - e.clientY) * 0.05; // Adjust the factor to control the movement intensity + + heading.style.transform = `translate(${offsetX}px, ${offsetY}px)`; + subheading.style.transform = `translate(${offsetX * 1.5}px, ${offsetY * 1.5}px)`; // Adjust the factor for faster movement + button.style.transform = `translate(${offsetX * 2}px, ${offsetY * 2}px)`; +}); + +var xmlhttp = new XMLHttpRequest(); +xmlhttp.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + var JS = JSON.parse(this.responseText); + button.textContent += " " + JS[0].tag_name; + buttonlink.setAttribute("href", JS[0].html_url); + button.removeAttribute("disabled"); + } +}; +xmlhttp.open("GET", "https://api.github.com/repos/DeadCodeGames/DeadForge-Launcher/releases", true); +xmlhttp.send(); \ No newline at end of file