header.html 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!-- Navigation -->
  2. <nav class="nav" id="nav">
  3. <div class="nav-container">
  4. <a href="index.html" class="logo">
  5. <div class="logo-icon">
  6. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="40" height="40">
  7. <defs>
  8. <linearGradient id="ayGrad" x1="0%" y1="0%" x2="100%" y2="100%">
  9. <stop offset="0%" style="stop-color:#0066cc"/>
  10. <stop offset="100%" style="stop-color:#0088ff"/>
  11. </linearGradient>
  12. </defs>
  13. <rect x="2" y="2" width="46" height="46" rx="8" fill="url(#ayGrad)"/>
  14. <path d="M12 38 L20 16 L25 28 L30 16 L38 38 L31 38 L27 25 L23 25 L19 38 Z" fill="white"/>
  15. <path d="M23 22 L27 22 L25 12 Z" fill="url(#ayGrad)"/>
  16. </svg>
  17. </div>
  18. <span class="logo-text">安盈创卓</span>
  19. </a>
  20. <ul class="nav-links" id="navLinks">
  21. <li><a href="index.html" class="nav-item" data-page="index">首页</a></li>
  22. <li><a href="product_totem.html" class="nav-item" data-page="product">企业产品</a></li>
  23. <li><a href="serve.html" class="nav-item" data-page="serve">企业服务</a></li>
  24. <li><a href="news.html" class="nav-item" data-page="news">新闻中心</a></li>
  25. <li><a href="about.html" class="nav-item" data-page="about">关于我们</a></li>
  26. <li class="nav-dropdown">
  27. <a href="#" class="nav-item" data-page="contact">联系我们</a>
  28. <div class="nav-dropdown-menu">
  29. <a href="contact.html">线上咨询</a>
  30. <a href="jobs.html">企业招聘</a>
  31. </div>
  32. </li>
  33. </ul>
  34. <button class="mobile-menu-btn" id="mobileMenuBtn" onclick="toggleMobileMenu()">
  35. <span></span>
  36. <span></span>
  37. <span></span>
  38. </button>
  39. </div>
  40. </nav>
  41. <script>
  42. (function() {
  43. var path = window.location.pathname.split('/').pop() || 'index.html';
  44. var pageMap = {
  45. 'index.html': 'index', '': 'index',
  46. 'product_totem.html': 'product', 'product_portal.html': 'product', 'product_oa.html': 'product',
  47. 'product_super.html': 'product', 'product_info.html': 'product', 'product_leader.html': 'product',
  48. 'product_bigdata.html': 'product', 'product_4a.html': 'product',
  49. 'serve.html': 'serve',
  50. 'news.html': 'news', 'news_show.html': 'news',
  51. 'about.html': 'about', 'about_certificate.html': 'about', 'about_member.html': 'about',
  52. 'contact.html': 'contact', 'jobs.html': 'contact'
  53. };
  54. var currentPage = pageMap[path];
  55. if (currentPage) {
  56. document.querySelectorAll('.nav-item').forEach(function(link) {
  57. if (link.getAttribute('data-page') === currentPage) link.classList.add('active');
  58. });
  59. }
  60. })();
  61. </script>