darkmode #34
10 changed files with 32 additions and 19 deletions
2
go.mod
2
go.mod
|
@ -2,7 +2,7 @@ module officeHours
|
||||||
|
|
||||||
go 1.18
|
go 1.18
|
||||||
|
|
||||||
require github.com/mattn/go-sqlite3 v1.14.22
|
require github.com/mattn/go-sqlite3 v1.14.24
|
||||||
|
|
||||||
require github.com/go-sql-driver/mysql v1.8.1
|
require github.com/go-sql-driver/mysql v1.8.1
|
||||||
|
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -4,3 +4,5 @@ github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpv
|
||||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||||
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
||||||
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
bootstrap-5.2.3-dist
|
bootstrap-5.3.3-dist
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
6
static/bootstrap-5.3.3-dist/css/bootstrap.min.css
vendored
Normal file
6
static/bootstrap-5.3.3-dist/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
7
static/bootstrap-5.3.3-dist/js/bootstrap.bundle.min.js
vendored
Normal file
7
static/bootstrap-5.3.3-dist/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="de">
|
<html lang="de" data-bs-theme="auto">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="keywords" content="Mathebau, Sprechstunde, Sprechstunden, Mathe, Mathematik, technische, Universität, Darmstadt, TU, Fachschaft">
|
<meta name="keywords" content="Mathebau, Sprechstunde, Sprechstunden, Mathe, Mathematik, technische, Universität, Darmstadt, TU, Fachschaft">
|
||||||
|
@ -42,5 +42,19 @@
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="/static/bootstrap/js/bootstrap.bundle.min.js"></script>
|
<script src="/static/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<!-- switch to dark mode if browser likes it -->
|
||||||
|
<script>
|
||||||
|
;(function () {
|
||||||
|
const htmlElement = document.querySelector("html")
|
||||||
|
if(htmlElement.getAttribute("data-bs-theme") === 'auto') {
|
||||||
|
function updateTheme() {
|
||||||
|
document.querySelector("html").setAttribute("data-bs-theme",
|
||||||
|
window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
|
||||||
|
}
|
||||||
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', updateTheme)
|
||||||
|
updateTheme()
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue