Skip to content

Commit 255e6a3

Browse files
committed
Fix nav logo both yellow + always clickable, fix Rotate Push Pop with normalMaterial, fix Move Eye camera z, fix Perspective far range
1 parent ae3c346 commit 255e6a3

3 files changed

Lines changed: 14 additions & 31 deletions

File tree

assets/examples_js/Basics/transform/Rotate_Push_Pop/Rotate_Push_Pop.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ function setup() {
99

1010
function draw() {
1111
background(0, 0, 26);
12-
pointLight(255, 255, 255, 0, 0, 300);
13-
pointLight(180, 180, 180, 0, 0, -300);
14-
ambientLight(80);
1512
for (let i = 0; i < num; i++) {
16-
let gray = map(i, 0, num - 1, 0, 255);
1713
push();
18-
fill(gray);
14+
normalMaterial();
1915
rotateY(a + offset * i);
2016
rotateX(a / 2 + offset * i);
2117
box(90);

assets/nav.js

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,23 @@
1111
return `<a href="${prefix}${name}"${active}>${label}</a>`;
1212
}
1313

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-
2214
const nav = document.getElementById('site-nav');
2315
if (nav) {
24-
const logoWrap = isRoot
25-
? `<div class="nav-logo">${logoHTML}</div>`
26-
: `<a href="${prefix}" class="nav-logo">${logoHTML}</a>`;
2716
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>
2924
<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');
3227
">☰</button>
3328
`;
3429
}
3530

36-
// Inject sidebar links into both #site-sidebar and .sidebar (main page)
3731
const sidebar = document.getElementById('site-sidebar') || document.querySelector('.sidebar');
3832
if (sidebar) {
3933
sidebar.innerHTML = `
@@ -44,7 +38,6 @@
4438
`;
4539
}
4640

47-
// Inject shared nav styles
4841
if (!document.getElementById('nav-shared-style')) {
4942
const style = document.createElement('style');
5043
style.id = 'nav-shared-style';
@@ -65,19 +58,18 @@
6558
display: flex;
6659
align-items: center;
6760
gap: 10px;
68-
color: #111;
6961
text-decoration: none;
7062
}
7163
.nav-logo img { width: 28px; height: 28px; }
7264
.nav-title {
7365
display: flex;
7466
flex-direction: column;
75-
line-height: 1.1;
67+
line-height: 1.15;
7668
}
7769
.nav-title-top {
7870
font-size: 13px;
79-
font-weight: 600;
80-
color: #111;
71+
font-weight: 700;
72+
color: #e8b400;
8173
}
8274
.nav-title-bottom {
8375
font-size: 13px;
@@ -100,7 +92,6 @@
10092
document.head.appendChild(style);
10193
}
10294

103-
// Load search via absolute URL
10495
if (!document.getElementById('search-wrap')) {
10596
const s = document.createElement('script');
10697
s.src = SITE + '/assets/search.js';

examples/rotate-push-pop.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,9 @@ <h1>Rotate Push Pop</h1>
7979
8080
function draw() {
8181
background(0, 0, 26);
82-
pointLight(255, 255, 255, 0, 0, 300);
83-
pointLight(180, 180, 180, 0, 0, -300);
84-
ambientLight(80);
8582
for (let i = 0; i < num; i++) {
86-
let gray = map(i, 0, num - 1, 0, 255);
8783
push();
88-
fill(gray);
84+
normalMaterial();
8985
rotateY(a + offset * i);
9086
rotateX(a / 2 + offset * i);
9187
box(90);

0 commit comments

Comments
 (0)