topbar.eta 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <% const timeIcon = `
  2. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  3. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  4. <circle cx="12" cy="12" r="10" />
  5. <path d="M12 6v6l4 2" />
  6. </g>
  7. </svg>
  8. ` %>
  9. <% const dateIcon = `
  10. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  11. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  12. <path d="M8 2v4m8-4v4" />
  13. <rect width="18" height="18" x="3" y="4" rx="2" />
  14. <path d="M3 10h18M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01" />
  15. </g>
  16. </svg>
  17. ` %>
  18. <% const ipIcon = `
  19. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  20. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  21. <rect width="6" height="6" x="16" y="16" rx="1" />
  22. <rect width="6" height="6" x="2" y="16" rx="1" />
  23. <rect width="6" height="6" x="9" y="2" rx="1" />
  24. <path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3m-7-4V8" />
  25. </g>
  26. </svg>
  27. ` %>
  28. <% const homeIcon = `
  29. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  30. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  31. <path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" />
  32. <path d="M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
  33. </g>
  34. </svg>
  35. ` %>
  36. <% const historyIcon = `
  37. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  38. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  39. <path d="M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8" />
  40. <path d="M3 3v5h5m4-1v5l4 2" />
  41. </g>
  42. </svg>
  43. ` %>
  44. <% const settingsIcon = `
  45. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  46. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  47. <path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0a2.34 2.34 0 0 0 3.319 1.915a2.34 2.34 0 0 1 2.33 4.033a2.34 2.34 0 0 0 0 3.831a2.34 2.34 0 0 1-2.33 4.033a2.34 2.34 0 0 0-3.319 1.915a2.34 2.34 0 0 1-4.659 0a2.34 2.34 0 0 0-3.32-1.915a2.34 2.34 0 0 1-2.33-4.033a2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" />
  48. <circle cx="12" cy="12" r="3" />
  49. </g>
  50. </svg>
  51. ` %>
  52. <% const skFlag = `
  53. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512">
  54. <mask id="SVGuywqVbel">
  55. <circle cx="256" cy="256" r="256" fill="#fff" />
  56. </mask>
  57. <g mask="url(#SVGuywqVbel)">
  58. <path fill="#0052b4" d="m0 160l256-32l256 32v192l-256 32L0 352z" />
  59. <path fill="#eee" d="M0 0h512v160H0z" />
  60. <path fill="#d80027" d="M0 352h512v160H0z" />
  61. <path fill="#eee" d="M64 63v217c0 104 144 137 144 137s144-33 144-137V63z" />
  62. <path fill="#d80027" d="M96 95v185a83 78 0 0 0 9 34h206a83 77 0 0 0 9-34V95z" />
  63. <path fill="#eee" d="M288 224h-64v-32h32v-32h-32v-32h-32v32h-32v32h32v32h-64v32h64v32h32v-32h64z" />
  64. <path fill="#0052b4" d="M152 359a247 231 0 0 0 56 24c12-3 34-11 56-24a123 115 0 0 0 47-45a60 56 0 0 0-34-10l-14 2a60 56 0 0 0-110 0a60 56 0 0 0-14-2c-12 0-24 4-34 10a123 115 0 0 0 47 45" />
  65. </g>
  66. </svg>
  67. ` %>
  68. <% const date = new Date() %>
  69. <header>
  70. <div class="links">
  71. <a role="button" href="/"><%~ skFlag %></a>
  72. </div>
  73. <p><%~ timeIcon %> <span id="topbarTime"><%= date.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: true }) %></span></p>
  74. <p><%~ dateIcon %> <span id="topbarDate"><%= date.toLocaleDateString('en-US', { weekday: "long", year: "numeric", month: "long", day: "numeric" }) %></span></p>
  75. <div class="links">
  76. <a role="button" href="/en"><%~ homeIcon %></a>
  77. <a role="button" href="/en/history"><%~ historyIcon %></a>
  78. <a role="button" href="/en/settings"><%~ settingsIcon %></a>
  79. </div>
  80. <script defer>
  81. setInterval(() => {
  82. const topbarTime = document.querySelector("#topbarTime")
  83. const topbarDate = document.querySelector("#topbarDate")
  84. const date = new Date()
  85. const timeString = date.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: true })
  86. const dateString = date.toLocaleDateString('en-US', { weekday: "long", year: "numeric", month: "long", day: "numeric" })
  87. topbarTime.textContent = timeString
  88. if (topbarDate.textContent !== dateString) {
  89. topbarDate.textContent = dateString
  90. }
  91. }, 1000)
  92. </script>
  93. </header>