mirror of
https://github.com/ash-project/ash_hq.git
synced 2024-09-20 21:33:10 +12:00
43 lines
1.6 KiB
Elixir
43 lines
1.6 KiB
Elixir
<!DOCTYPE html>
|
|
<html lang="en" class="<%= "h-full #{@configured_theme}" %>">
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<%= csrf_meta_tag() %>
|
|
<%= live_title_tag assigns[:page_title] || "Ash Framework" %>
|
|
<%= if Application.get_env(:ash_hq, :analytics?) do %>
|
|
<script defer data-domain="ash-hq.org" src="https://plausible.io/js/plausible.js"></script>
|
|
<% end %>
|
|
<link phx-track-static rel="stylesheet" href="<%= Routes.static_path(@conn, "/assets/app.css") %>"/>
|
|
<script>
|
|
const configuredThemeRow = document.cookie
|
|
.split('; ')
|
|
.find(row => row.startsWith('theme='))
|
|
|
|
if (!configuredThemeRow || configuredThemeRow === "theme=system") {
|
|
let theme;
|
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
theme = "dark";
|
|
} else {
|
|
theme = "light";
|
|
}
|
|
|
|
document.documentElement.classList.add(theme);
|
|
if(theme === "dark") {
|
|
document.documentElement.classList.remove("light");
|
|
} else {
|
|
document.documentElement.classList.remove("dark");
|
|
};
|
|
|
|
document.cookie = 'theme=system;path=/';
|
|
}
|
|
</script>
|
|
</head>
|
|
<body class="h-full">
|
|
<%= @inner_content %>
|
|
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
|
<script>mermaid.init(".mermaid")</script>
|
|
<script defer phx-track-static type="text/javascript" src="<%= Routes.static_path(@conn, "/assets/app.js") %>"></script>
|
|
</body>
|
|
</html>
|