header.ejs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <link rel="stylesheet" href="/stylesheets/header.css">
  2. <header class="header">
  3. <div class="header-left">
  4. <div class="dropdown">
  5. <svg class="dropbtn" style="margin-right: 5px;" width="24px" height="24px" viewBox="0 0 24 24" fill="none"
  6. xmlns="http://www.w3.org/2000/svg">
  7. <path opacity="0.5" d="M21 6L3 6" stroke="#1C274C" stroke-width="2.0" stroke-linecap="round" />
  8. <path opacity="0.5" d="M21 10L3 10" stroke="#1C274C" stroke-width="2.0" stroke-linecap="round" />
  9. <path opacity="0.5" d="M10 14H3" stroke="#1C274C" stroke-width="2.0" stroke-linecap="round" />
  10. <path opacity="0.5" d="M10 18H3" stroke="#1C274C" stroke-width="2.0" stroke-linecap="round" />
  11. <path d="M14 15L17.5 18L21 15" stroke="#1C274C" stroke-width="2.5" stroke-linecap="round"
  12. stroke-linejoin="round" />
  13. </svg>
  14. <div class="dropdown-home-content">
  15. <a href="/<%= lang %>" class="<%= uri == `/${lang}` ? 'selected' : '' %>">
  16. <%= translate.homePage[lang] %>
  17. </a>
  18. <a href="/<%= lang %>/category" class="<%= uri.includes(`/${lang}/category`) ? 'selected' : '' %>">
  19. <%= translate.categoryPage[lang] %>
  20. </a>
  21. <a href="/<%= lang %>/tag" class="<%= uri.includes(`/${lang}/tag`) ? 'selected' : '' %>">
  22. <%= translate.tagPage[lang] %>
  23. </a>
  24. <a href="/<%= lang %>/albums" class="<%= uri.includes(`/${lang}/albums`) ? 'selected' : '' %>">
  25. <%= translate.album[lang] %>
  26. </a>
  27. <a href="/<%= lang %>/special" class="<%= uri.includes(`/${lang}/special`) ? 'selected' : '' %>">
  28. <%= translate.special[lang] %>
  29. </a>
  30. <a href="/<%= lang %>/designers" class="<%= uri.includes(`/${lang}/designers`) ? 'selected' : '' %>">
  31. <%= translate.designerColumn[lang] %>
  32. </a>
  33. <div class="divider"></div>
  34. <!--
  35. <a href="/<%= lang %>/my-works"><%= translate.my[lang] %></a>
  36. <div class="divider"></div>
  37. -->
  38. <a href="/<%= lang %>/info#app" class="<%= uri.includes(`/${lang}/info#app`) ? 'selected' : '' %>">
  39. <%= translate.app[lang] %>
  40. </a>
  41. <a href="/<%= lang %>/info#about" class="<%= uri.includes(`/${lang}/info#about`) ? 'selected' : '' %>">
  42. <%= translate.about[lang] %>
  43. </a>
  44. <a href="/<%= lang %>/info#contact" class="<%= uri.includes(`/${lang}/info#contact`) ? 'selected' : '' %>">
  45. <%= translate.contactUs[lang] %>
  46. </a>
  47. <a href="/policy.html" target="_blank">
  48. <%= translate.policy[lang] %>
  49. </a>
  50. <div class="divider"></div>
  51. <p class="copyright">Copyright &copy; 2025 Art Number Coloring All Rights Reserved</p>
  52. </div>
  53. </div>
  54. <!-- <a href="/<%= lang %>"><img src="/assets/svg/logo.svg" , alt="Art Number Coloring"></a> -->
  55. <a href="/<%= lang %>"><img src="/assets/icon/icon.png" , class="logo" , alt="Art Number Coloring Logo"></a>
  56. <a href="/<%= lang %>"><img src="/assets/svg/logo.svg" , alt="Art Number Coloring"></a>
  57. </div>
  58. <div class="search-container">
  59. <form action="/<%= lang %>/search" method="GET" class="search-box">
  60. <input type="text" name="search" placeholder="Search...">
  61. <button type="submit">
  62. <svg fill="#000000" width="16px" height="16px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
  63. <path
  64. d="M12.027 9.92L16 13.95 14 16l-4.075-3.976A6.465 6.465 0 0 1 6.5 13C2.91 13 0 10.083 0 6.5 0 2.91 2.917 0 6.5 0 10.09 0 13 2.917 13 6.5a6.463 6.463 0 0 1-.973 3.42zM1.997 6.452c0 2.48 2.014 4.5 4.5 4.5 2.48 0 4.5-2.015 4.5-4.5 0-2.48-2.015-4.5-4.5-4.5-2.48 0-4.5 2.014-4.5 4.5z"
  65. fill-rule="evenodd" />
  66. </svg>
  67. </button>
  68. </form>
  69. </div>
  70. <div class="header-right">
  71. <div class="dropdown">
  72. <svg class="dropbtn" width="24px" height="24px" viewBox="0 0 24 24" role="img" xmlns="http://www.w3.org/2000/svg"
  73. aria-labelledby="languageIconTitle" stroke="#000000" stroke-width="1.5" stroke-linecap="round"
  74. stroke-linejoin="round" fill="none" color="#000000">
  75. <title id="languageIconTitle">Language</title>
  76. <circle cx="12" cy="12" r="10" />
  77. <path stroke-linecap="round"
  78. d="M12,22 C14.6666667,19.5757576 16,16.2424242 16,12 C16,7.75757576 14.6666667,4.42424242 12,2 C9.33333333,4.42424242 8,7.75757576 8,12 C8,16.2424242 9.33333333,19.5757576 12,22 Z" />
  79. <path stroke-linecap="round" d="M2.5 9L21.5 9M2.5 15L21.5 15" />
  80. </svg>
  81. <div class="dropdown-content">
  82. <% languages.forEach(lg=> { %>
  83. <a href="<%=`/${lg.code}${uri.substring(3)}` %>" class="<%= lg.code == lang ? 'selected' : '' %>"
  84. style="font-size: 16px">
  85. <%= lg.title %>
  86. </a>
  87. <% }); %>
  88. </div>
  89. <!-- <div class="dropdown-content">
  90. <form id="languageForm" action="/set-lang" method="post">
  91. <select name="lang" onchange="submitLanguageForm()">
  92. <% languages.forEach(lg=> { %>
  93. <option value="<%= lg.code %>" <%=lg.code==lang ? 'selected' : '' %> >
  94. <%= lg.title %>
  95. </option>
  96. <% }); %>
  97. </select>
  98. <input type="hidden" name="uri" value="<%= uri%>">
  99. </form>
  100. </div> -->
  101. </div>
  102. <!-- <a href="/<%= lang %>/app" class="header-right-btn"><%= translate.app[lang] %></a>
  103. <a href="/<%= lang %>/my-works" class="header-right-btn"><%= translate.my[lang] %></a> -->
  104. </div>
  105. </header>
  106. <script>
  107. // 当用户选择语言时提交表单
  108. function submitLanguageForm() {
  109. document.getElementById('languageForm').submit();
  110. }
  111. </script>