-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from firezone/feat/ui
feat: initial UI
- Loading branch information
Showing
21 changed files
with
10,883 additions
and
547 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: mix | ||
directory: . | ||
schedule: | ||
interval: weekly | ||
- package-ecosystem: npm | ||
directory: assets | ||
schedule: | ||
interval: weekly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# These are used for the dev environment. | ||
# This should match the versions used in the built product. | ||
elixir 1.17.0-otp-27 | ||
elixir 1.17.1-otp-27 | ||
erlang 27.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
let DarkModeToggle = { | ||
mounted() { | ||
var themeToggleDarkIcon = document.getElementById("theme-toggle-dark-icon"); | ||
var themeToggleLightIcon = document.getElementById( | ||
"theme-toggle-light-icon", | ||
); | ||
|
||
// Change the icons inside the button based on previous settings | ||
if ( | ||
localStorage.getItem("color-theme") === "dark" || | ||
(!("color-theme" in localStorage) && | ||
window.matchMedia("(prefers-color-scheme: dark)").matches) | ||
) { | ||
themeToggleLightIcon.classList.remove("hidden"); | ||
} else { | ||
themeToggleDarkIcon.classList.remove("hidden"); | ||
} | ||
|
||
var themeToggleBtn = document.getElementById("theme-toggle"); | ||
|
||
// Add event listener to the button | ||
themeToggleBtn.addEventListener("click", function () { | ||
// toggle icons inside button | ||
themeToggleDarkIcon.classList.toggle("hidden"); | ||
themeToggleLightIcon.classList.toggle("hidden"); | ||
|
||
// if set via local storage previously | ||
if (localStorage.getItem("color-theme")) { | ||
if (localStorage.getItem("color-theme") === "light") { | ||
document.documentElement.classList.add("dark"); | ||
localStorage.setItem("color-theme", "dark"); | ||
console.log("set to dark"); | ||
} else { | ||
document.documentElement.classList.remove("dark"); | ||
localStorage.setItem("color-theme", "light"); | ||
} | ||
|
||
// if NOT set via local storage previously | ||
} else { | ||
console.log("not found in local storage"); | ||
if (document.documentElement.classList.contains("dark")) { | ||
document.documentElement.classList.remove("dark"); | ||
localStorage.setItem("color-theme", "light"); | ||
} else { | ||
document.documentElement.classList.add("dark"); | ||
localStorage.setItem("color-theme", "dark"); | ||
} | ||
} | ||
}); | ||
}, | ||
}; | ||
|
||
export { DarkModeToggle }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "probe", | ||
"version": "0.1.0", | ||
"description": "Probe assets", | ||
"main": "tailwind.config.js", | ||
"scripts": { | ||
"test": "npm test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/firezone/probe.git" | ||
}, | ||
"author": "", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/firezone/probe/issues" | ||
}, | ||
"homepage": "https://github.com/firezone/probe#readme", | ||
"dependencies": { | ||
"flowbite": "^2.4.1" | ||
} | ||
} |
Oops, something went wrong.