xingong-header.jsp 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <%@ page pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
  4. <c:set var="xgDisplayTitle" value="${empty website.seoTitle ? website.name : website.seoTitle}"/>
  5. <header class="header">
  6. <div class="wm" aria-hidden="true">
  7. <svg class="l" viewBox="0 0 300 118" fill="none" stroke="#fff" stroke-width="1.4">
  8. <circle cx="60" cy="59" r="34"/><circle cx="60" cy="59" r="20"/>
  9. <path d="M8 92 L52 60 L18 44 L60 24"/>
  10. <text x="112" y="40" fill="#fff" stroke="none" font-size="20" font-family="serif">∑ ∫ π</text>
  11. <text x="112" y="72" fill="#fff" stroke="none" font-size="16" font-family="serif">f(x)=ax²+bx+c</text>
  12. </svg>
  13. <svg class="r" viewBox="0 0 300 118" fill="none" stroke="#fff" stroke-width="1.4">
  14. <path d="M292 18 H210 V52 H150 V86 H60 M292 58 H240 V96 H150"/>
  15. <circle cx="286" cy="18" r="5"/><circle cx="286" cy="58" r="5"/><circle cx="60" cy="86" r="5"/>
  16. <rect x="150" y="42" width="34" height="20" rx="3"/><path d="M184 52 H210"/>
  17. </svg>
  18. </div>
  19. <div class="wrap">
  20. <a class="brand" href="/" aria-label="${website.name}首页">
  21. <c:choose>
  22. <c:when test="${not empty website.logo}"><img class="brand-logo-image" src="${website.logo}" alt="${website.name}"></c:when>
  23. <c:otherwise><span class="brand-text-fallback"><span class="s1">${website.name}</span><span class="s2">School of Information Engineering</span></span></c:otherwise>
  24. </c:choose>
  25. </a>
  26. <form class="search" action="/search" method="get" role="search">
  27. <input type="search" name="str" value="${fn:escapeXml(str)}" placeholder="搜索文章…" aria-label="站内搜索">
  28. <button class="btn" type="submit" aria-label="提交搜索">
  29. <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.4" stroke-linecap="round"><circle cx="10.5" cy="10.5" r="7"/><path d="M20 20 l-4.6-4.6"/></svg>
  30. </button>
  31. </form>
  32. <button class="xg-mobile-menu" type="button" aria-label="打开导航" aria-controls="xg-mobile-drawer" aria-expanded="false"><span></span><span></span><span></span></button>
  33. </div>
  34. </header>
  35. <nav class="nav" aria-label="主导航">
  36. <ul>
  37. <c:forEach items="${navList}" var="item">
  38. <c:if test="${item.name ne '首页子栏目'}">
  39. <li class="${not empty item.children ? 'has-children' : ''}${empty navigation and item.name eq '首页' ? ' on' : ''}">
  40. <a href="${item.href}" target="${item.target}">${item.name}</a>
  41. <c:if test="${not empty item.children}">
  42. <ul class="xg-nav-panel">
  43. <c:forEach items="${item.children}" var="child">
  44. <li><a href="${child.href}" target="${child.target}">${child.name}</a></li>
  45. </c:forEach>
  46. </ul>
  47. </c:if>
  48. </li>
  49. </c:if>
  50. </c:forEach>
  51. </ul>
  52. </nav>
  53. <div class="xg-drawer-layer" id="xg-mobile-drawer" hidden>
  54. <button class="xg-drawer-mask" type="button" aria-label="关闭导航"></button>
  55. <aside class="xg-drawer" aria-label="移动端导航">
  56. <div class="xg-drawer-head"><strong>${xgDisplayTitle}</strong><button type="button" aria-label="关闭导航">×</button></div>
  57. <nav class="xg-drawer-nav">
  58. <a href="/">首页</a>
  59. <c:forEach items="${navList}" var="item">
  60. <c:if test="${item.name ne '首页子栏目'}">
  61. <a href="${item.href}" target="${item.target}">${item.name}</a>
  62. <c:if test="${not empty item.children}">
  63. <div class="xg-drawer-children">
  64. <c:forEach items="${item.children}" var="child"><a href="${child.href}" target="${child.target}">${child.name}</a></c:forEach>
  65. </div>
  66. </c:if>
  67. </c:if>
  68. </c:forEach>
  69. </nav>
  70. </aside>
  71. </div>