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.

63 lines
1.9 KiB

2 years ago
2 years ago
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. <!--
  33. <div class="six columns ml-1">
  34. <h1 class="mt-2">
  35. <a class="mt-2" href="<%= config.root %>">Hello World.</a>
  36. </h1>
  37. </div>
  38. -->
  39. <div class="twelve columns">
  40. <div class="row">
  41. <div class="nine columns left">
  42. <a href="<%= config.root %>">Home</a>
  43. <% for (name in theme.menu) { %>
  44. <% if (theme.menu[name]) { %>
  45. <a href="<%- url_for(theme.menu[name]) %>" class="ml"><%- name %></a>
  46. <% } %>
  47. <% } %>
  48. <% if (theme.email) { %>
  49. <% if (typeof obfuscate === "function") { %>
  50. <a href="mailto:<%- obfuscate(theme.email) %>" target="_blank" class="ml">Email</a>
  51. <% } else { %>
  52. <a href="mailto:<%= theme.email %>" target="_blank" class="ml">Email</a>
  53. <% } %>
  54. <% } %>
  55. </div>
  56. </div>
  57. <hr style="margin-bottom: 2.6rem">
  58. </div>
  59. </div>