Skip to content

Commit

Permalink
Redesign entire site in one commit 😎
Browse files Browse the repository at this point in the history
  • Loading branch information
Declan Chidlow committed Jun 6, 2024
1 parent 7248495 commit 488877b
Show file tree
Hide file tree
Showing 74 changed files with 2,153 additions and 2,339 deletions.
254 changes: 130 additions & 124 deletions config/global/assets/Emoji_Hero.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 0 additions & 12 deletions config/global/assets/changelog_banner.svg

This file was deleted.

635 changes: 142 additions & 493 deletions config/global/assets/embed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions config/global/assets/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 8 additions & 6 deletions config/global/elements/footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<footer>
Mutant Remix is not affiliated with <a href="https://adduce.vale.rocks">mutant.tech</a>.
This is a transformation of the original Mutant Standard emoji pack, which is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International License.
Site built with <a href="https://adduce.vale.rocks">Adduce</a>.
</footer>
</main>

<footer>
Mutant Remix is not affiliated with <a href="https://adduce.vale.rocks">mutant.tech</a>. This is a transformation of the original Mutant Standard emoji pack, which is licensed under the Creative
Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Site built with <a href="https://adduce.vale.rocks">Adduce</a>.
</footer>
</body>
</html>
38 changes: 15 additions & 23 deletions config/global/elements/head.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:site_name" content="Mutant Remix" />
<meta name="author" content="Revolt" />
<meta property="og:locale" content="en_AU" />
<meta property="og:url" content="https://mutant.revolt.chat" />

<title>Mutant Remix</title>
<link rel="icon" type="image/svg" href="/assets/favicon.svg">

<meta property="og:title" content="Mutant Remix" />
<meta property="og:site_name" content="Mutant Remix">
<meta property="og:url" content="https://mutant.revolt.chat" />
<meta name="author" content="Revolt">
<meta property="og:image" content="https://mutant.revolt.chat/assets/embed.svg" />
<meta property="og:description" content="An emoji pack so good, you'll never want to use another." />

<meta property="twitter:title" content="Mutant Remix" />
<meta property="twitter:site" content="@revoltchat" />
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:image" content="https://mutant.revolt.chat/assets/embed.svg" />
<meta property="twitter:image:alt" content='Image consisting of emojis exploding outwards with the text "An emoji pack so good, you will never want to
use another."' />
<meta property="twitter:description" content="An emoji pack so good, you'll never want to use another." />

<meta property="og:image:type" content="image/svg" />
<meta property="og:image:width" content="1280" />
<meta property="og:image:height" content="720" />
<link rel="stylesheet" href="/styles/style.css">
<link rel="icon" type="image/svg" href="/assets/favicon.svg" />

<meta property="og:image" content="https://mutant.revolt.chat/assets/embed.svg" />
<meta property="og:image:type" content="image/svg" />
<meta property="og:image:width" content="1280" />
<meta property="og:image:height" content="720" />
22 changes: 12 additions & 10 deletions config/global/elements/navbar.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<nav>
<a href="/"><img style="height: 2.5rem; width: auto; display: inline;" src="assets/Mutant_Remix_Wordmark.svg"
alt="Mutant Remix"></a>
<ul>
<li><a href="https://github.com/mutant-remix/mutant-remix/blob/master/CONTRIBUTING.md">contributing</a></li>
<li><a href="/demo">demo</a></li>
<li><a href="https://github.com/mutant-remix/mutant-remix/releases">download</a></li>
</ul>
</nav>
<header id="navbar">
<a href="/">
<img src="assets/Mutant_Remix_Wordmark.svg" id="navlanding" alt="Mutant Remix logo" />
</a>
<nav>
<ul>
<li><a href="/releases">Releases</a></li>
<li><a href="/downloads">Downloads</a></li>
</ul>
</nav>
</header>

<div id="content">
<main>
35 changes: 35 additions & 0 deletions config/global/scripts/downloads.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
document.addEventListener("DOMContentLoaded", function () {
const repoOwner = "mutant-remix";
const repoName = "mutant-remix";

async function fetchLatestRelease() {
try {
const response = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/releases/latest`);
if (!response.ok) {
throw new Error(`An error occurred: ${response.statusText}`);
}
const data = await response.json();
const latestVersion = data.tag_name;
return latestVersion;
} catch (error) {
console.error("Error fetching latest release:", error);
}
}

async function updateButtonsWithLatestRelease() {
try {
const latestVersion = await fetchLatestRelease();
if (!latestVersion) return;
const buttons = document.querySelectorAll('button[onclick*="https://github.com/mutant-remix/mutant-remix/releases/download/"]');
buttons.forEach((button) => {
const oldOnclick = button.getAttribute("onclick");
const newOnclick = oldOnclick.replace(/v00/g, latestVersion);
button.setAttribute("onclick", newOnclick);
});
} catch (error) {
console.error("Error updating buttons with latest release:", error);
}
}

updateButtonsWithLatestRelease();
});
72 changes: 72 additions & 0 deletions config/global/scripts/releases.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
document.addEventListener("DOMContentLoaded", function () {
const repoOwner = "mutant-remix";
const repoName = "mutant-remix";

const releasesContainer = document.getElementById("releases");

async function fetchReleases() {
try {
const response = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/releases`);
if (!response.ok) {
throw new Error(`An error occurred: ${response.statusText}`);
}
const releases = await response.json();
displayReleases(releases);
} catch (error) {
console.error("Error fetching releases:", error);
releasesContainer.innerHTML = `<p>Error fetching releases: ${error.message}</p>`;
}
}

function displayReleases(releases) {
releasesContainer.innerHTML = "";
releases.forEach((release) => {
const changelog = extractChangelog(release.body);
const releaseElement = document.createElement("div");
releaseElement.classList.add("release");
releaseElement.innerHTML = `
<a href="${release.html_url}">
<h2>${release.name}</h2>
<p>${formatDate(new Date(release.published_at))}</p>
<div>${changelog}</div>
</a>
`;
releasesContainer.appendChild(releaseElement);
});
}

function extractChangelog(body) {
const changelogIndex = body.indexOf("## Changelog");
if (changelogIndex === -1) return "No changelog available.";
const changelogContent = body.slice(changelogIndex + "## Changelog".length);
const nextHeadingIndex = changelogContent.search(/## [^\n]+\n/);
return nextHeadingIndex === -1 ? changelogContent.trim() : changelogContent.slice(0, nextHeadingIndex).trim();
}

function formatDate(date) {
const options = { year: "numeric", month: "long", day: "numeric" };
const formattedDate = date.toLocaleDateString("en-US", options);
const day = date.getDate();
let daySuffix;
if (day > 3 && day < 21) {
daySuffix = "th";
} else {
switch (day % 10) {
case 1:
daySuffix = "st";
break;
case 2:
daySuffix = "nd";
break;
case 3:
daySuffix = "rd";
break;
default:
daySuffix = "th";
}
}
return formattedDate.replace(/\d+/, `${day}${daySuffix}`);
}

fetchReleases();
});
63 changes: 0 additions & 63 deletions config/global/style/button.css

This file was deleted.

22 changes: 0 additions & 22 deletions config/global/style/colours.css

This file was deleted.

20 changes: 0 additions & 20 deletions config/global/style/footer.css

This file was deleted.

22 changes: 0 additions & 22 deletions config/global/style/navbar.css

This file was deleted.

8 changes: 0 additions & 8 deletions config/global/style/style.css

This file was deleted.

Loading

0 comments on commit 488877b

Please sign in to comment.