Skip to content

Commit

Permalink
Let's get this thing merged!
Browse files Browse the repository at this point in the history
  • Loading branch information
hwittenborn committed Jun 2, 2023
1 parent 5ff1e3b commit a1697c1
Show file tree
Hide file tree
Showing 9 changed files with 769 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Hugo stuff.
/resources/_gen/
resources/_gen/
public
.hugo_build.lock

# NodeJS
Expand Down
13 changes: 11 additions & 2 deletions themes/makedeb/assets/scss/homepage_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,19 @@ $phone-width: 550px;
justify-content: center;
padding-top: 1em;

a * {
.authelia,
.prism-launcher {
margin: 0.75rem 1rem;
align-self: center;
}

.authelia {
width: 10rem;
}

.prism-launcher {
width: auto;
height: 3.5rem;
padding: 0.75rem 1rem;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions themes/makedeb/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ <h2>It's All Just Bash</h2>
<h2>Ready for Production.</h2>
<p>makedeb is already being used by various groups to create and package their Debian applications, including:</p>
<div class="groups-using-makedeb">
<a href="https://www.authelia.com/"><img src="media/authelia-logo.png"></a>
<a href="https://prismlauncher.org/"><img src="media/prismlauncher-logo.svg"></a>
<a class="authelia" href="https://www.authelia.com/"><img src="media/authelia-logo-light.svg"></a>
<a class="prism-launcher" href="https://prismlauncher.org/"><img src="media/prismlauncher-logo-light.svg"></a>
</div>
</div>
<div class="supporters">
Expand Down
38 changes: 29 additions & 9 deletions themes/makedeb/static/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ toggleThemeBtn.addEventListener("click", function () {
if (body.className == "dark") {
document.body.className = "light";
toggleThemeBtn.classList.remove("active");
changeBtnIcon("moon");
setImages("dark");
localStorage.removeItem("theme");
} else {
toggleThemeBtn.classList.add("active");
document.body.className = "dark";
changeBtnIcon("sun");
setImages("light");
localStorage.setItem("theme", "dark");
}
});
Expand All @@ -24,26 +24,46 @@ function initialThemeLoad() {
const theme = localStorage.getItem("theme");
if (theme == "dark") {
document.body.className = "dark";
changeBtnIcon("sun");
setImages("light");
toggleThemeBtn.classList.add("active");
} else {
changeBtnIcon("moon");
setImages("dark");
}
}

/**
* Changes theme toggle button's icon
* @param {"sun" | "moon"} iconType - icon type to be displayed
* Set the images on the page to the specified theme type.
* @param {"light" | "dark"} imageType - image set to be displayed
*/
function changeBtnIcon(iconType) {
function setImages(imageType) {
const sunIcon = document.getElementById("sun-icon");
const moonIcon = document.getElementById("moon-icon");
if (iconType == "sun") {
const autheliaLogo = document.querySelector(
".groups-using-makedeb .authelia img"
);
const prismLauncherLogo = document.querySelector(
".groups-using-makedeb .prism-launcher img"
);

console.log(new URL("wow", autheliaLogo.src));

if (imageType == "light") {
moonIcon.classList.remove("active-icon");
sunIcon.classList.add("active-icon");
autheliaLogo.src = new URL("authelia-logo-light.svg", autheliaLogo.src);
prismLauncherLogo.src = new URL(
"prismlauncher-logo-light.svg",
autheliaLogo.src
);
}
if (iconType == "moon") {

if (imageType == "dark") {
sunIcon.classList.remove("active-icon");
moonIcon.classList.add("active-icon");
autheliaLogo.src = new URL("authelia-logo-dark.svg", autheliaLogo.src);
prismLauncherLogo.src = new URL(
"prismlauncher-logo-dark.svg",
autheliaLogo.src
);
}
}
173 changes: 173 additions & 0 deletions themes/makedeb/static/media/authelia-logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a1697c1

Please sign in to comment.