header.ejs 5.8 KB

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