You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

54 lines
1.8 KiB

<div class="row">
<div class="two columns" style="max-width: 50px">
<h1 class="mt-2 mode">
<div onclick=setDarkMode(true) id="darkBtn"><%= theme.switch_dark %></div>
<div onclick=setDarkMode(false) id="lightBtn" class=hidden><%= theme.switch_light %></div>
<script >
if (localStorage.getItem('preferredTheme') == 'dark') {
setDarkMode(true)
}
function setDarkMode(isDark) {
var darkBtn = document.getElementById('darkBtn')
var lightBtn = document.getElementById('lightBtn')
if (isDark) {
lightBtn.style.display = "block"
darkBtn.style.display = "none"
localStorage.setItem('preferredTheme', 'dark');
} else {
lightBtn.style.display = "none"
darkBtn.style.display = "block"
localStorage.removeItem('preferredTheme');
}
document.body.classList.toggle("darkmode");
}
</script>
</h1>
</div>
<div class="six columns ml-1">
<h1 class="mt-2">
<%= theme.title %>
</h1>
</div>
<div class="twelve columns">
<div class="row">
<div class="nine columns left">
<a href="<%= config.root %>">Home</a>
<% for (name in theme.menu) { %>
<% if (theme.menu[name]) { %>
<a href="<%- url_for(theme.menu[name]) %>" class="ml"><%- name %></a>
<% } %>
<% } %>
<% if (theme.email) { %>
<% if (typeof obfuscate === "function") { %>
<a href="mailto:<%- obfuscate(theme.email) %>" target="_blank" class="ml">Email</a>
<% } else { %>
<a href="mailto:<%= theme.email %>" target="_blank" class="ml">Email</a>
<% } %>
<% } %>
</div>
</div>
<hr style="margin-bottom: 2.6rem">
</div>
</div>