|
11 | 11 | return `<a href="${prefix}${name}"${active}>${label}</a>`; |
12 | 12 | } |
13 | 13 |
|
14 | | - const logoHTML = ` |
15 | | - <img src="${prefix}assets/cpp-logo.png" alt="C++ Mode"> |
16 | | - <div class="nav-title"> |
17 | | - <span class="nav-title-top">Processing</span> |
18 | | - <span class="nav-title-bottom">C++</span> |
19 | | - </div> |
20 | | - `; |
21 | | - |
22 | 14 | const nav = document.getElementById('site-nav'); |
23 | 15 | if (nav) { |
24 | | - const logoWrap = isRoot |
25 | | - ? `<div class="nav-logo">${logoHTML}</div>` |
26 | | - : `<a href="${prefix}" class="nav-logo">${logoHTML}</a>`; |
27 | 16 | nav.innerHTML = ` |
28 | | - ${logoWrap} |
| 17 | + <a href="${SITE}" class="nav-logo"> |
| 18 | + <img src="${prefix}assets/cpp-logo.png" alt="Processing for C++"> |
| 19 | + <div class="nav-title"> |
| 20 | + <span class="nav-title-top">Processing</span> |
| 21 | + <span class="nav-title-bottom">C++</span> |
| 22 | + </div> |
| 23 | + </a> |
29 | 24 | <button class="hamburger" onclick=" |
30 | | - document.querySelector('.sidebar-outer, .sidebar') && |
31 | | - document.querySelector('.sidebar-outer, .sidebar').classList.toggle('open') |
| 25 | + var s = document.querySelector('.sidebar-outer, .sidebar'); |
| 26 | + if(s) s.classList.toggle('open'); |
32 | 27 | ">☰</button> |
33 | 28 | `; |
34 | 29 | } |
35 | 30 |
|
36 | | - // Inject sidebar links into both #site-sidebar and .sidebar (main page) |
37 | 31 | const sidebar = document.getElementById('site-sidebar') || document.querySelector('.sidebar'); |
38 | 32 | if (sidebar) { |
39 | 33 | sidebar.innerHTML = ` |
|
44 | 38 | `; |
45 | 39 | } |
46 | 40 |
|
47 | | - // Inject shared nav styles |
48 | 41 | if (!document.getElementById('nav-shared-style')) { |
49 | 42 | const style = document.createElement('style'); |
50 | 43 | style.id = 'nav-shared-style'; |
|
65 | 58 | display: flex; |
66 | 59 | align-items: center; |
67 | 60 | gap: 10px; |
68 | | - color: #111; |
69 | 61 | text-decoration: none; |
70 | 62 | } |
71 | 63 | .nav-logo img { width: 28px; height: 28px; } |
72 | 64 | .nav-title { |
73 | 65 | display: flex; |
74 | 66 | flex-direction: column; |
75 | | - line-height: 1.1; |
| 67 | + line-height: 1.15; |
76 | 68 | } |
77 | 69 | .nav-title-top { |
78 | 70 | font-size: 13px; |
79 | | - font-weight: 600; |
80 | | - color: #111; |
| 71 | + font-weight: 700; |
| 72 | + color: #e8b400; |
81 | 73 | } |
82 | 74 | .nav-title-bottom { |
83 | 75 | font-size: 13px; |
|
100 | 92 | document.head.appendChild(style); |
101 | 93 | } |
102 | 94 |
|
103 | | - // Load search via absolute URL |
104 | 95 | if (!document.getElementById('search-wrap')) { |
105 | 96 | const s = document.createElement('script'); |
106 | 97 | s.src = SITE + '/assets/search.js'; |
|
0 commit comments