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

2 years ago
  1. <div class="row">
  2. <div class="two columns" style="max-width: 50px">
  3. <h1 class="mt-2 mode">
  4. <div onclick=setDarkMode(true) id="darkBtn"><%= theme.switch_dark %></div>
  5. <div onclick=setDarkMode(false) id="lightBtn" class=hidden><%= theme.switch_light %></div>
  6. <script >
  7. if (localStorage.getItem('preferredTheme') == 'dark') {
  8. setDarkMode(true)
  9. }
  10. function setDarkMode(isDark) {
  11. var darkBtn = document.getElementById('darkBtn')
  12. var lightBtn = document.getElementById('lightBtn')
  13. if (isDark) {
  14. lightBtn.style.display = "block"
  15. darkBtn.style.display = "none"
  16. localStorage.setItem('preferredTheme', 'dark');
  17. } else {
  18. lightBtn.style.display = "none"
  19. darkBtn.style.display = "block"
  20. localStorage.removeItem('preferredTheme');
  21. }
  22. document.body.classList.toggle("darkmode");
  23. }
  24. </script>
  25. </h1>
  26. </div>
  27. <div class="six columns ml-1">
  28. <h1 class="mt-2">
  29. <%= theme.title %>
  30. </h1>
  31. </div>
  32. <div class="twelve columns">
  33. <div class="row">
  34. <div class="nine columns left">
  35. <a href="<%= config.root %>">Home</a>
  36. <% for (name in theme.menu) { %>
  37. <% if (theme.menu[name]) { %>
  38. <a href="<%- url_for(theme.menu[name]) %>" class="ml"><%- name %></a>
  39. <% } %>
  40. <% } %>
  41. <% if (theme.email) { %>
  42. <% if (typeof obfuscate === "function") { %>
  43. <a href="mailto:<%- obfuscate(theme.email) %>" target="_blank" class="ml">Email</a>
  44. <% } else { %>
  45. <a href="mailto:<%= theme.email %>" target="_blank" class="ml">Email</a>
  46. <% } %>
  47. <% } %>
  48. </div>
  49. </div>
  50. <hr style="margin-bottom: 2.6rem">
  51. </div>
  52. </div>