66 < title > Processing for C++</ title >
77 < script src ="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.min.js "> </ script >
88 < style >
9- @import url ('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;700&display=swap' );
9+ @font-face {
10+ font-family : "ProcessingSans" ;
11+ src : url ("/assets/ProcessingSansPro-Regular.ttf" ) format ("truetype" );
12+ }
1013 * { margin : 0 ; padding : 0 ; box-sizing : border-box; }
1114 body { font-family : -apple-system, BlinkMacSystemFont, 'Segoe UI' , sans-serif; color : # 111 ; background : # fff ; }
1215 a { color : # 111 ; text-decoration : none; }
1316
14- nav {
17+ /* Nav — matches all other pages via nav.js injection */
18+ # site-nav {
1519 border-bottom : 1px solid # e0e0e0 ;
1620 padding : 0 2rem ;
1721 display : flex; align-items : center; justify-content : space-between;
1822 height : 60px ; position : sticky; top : 0 ; background : # fff ; z-index : 100 ;
1923 }
20- .nav-logo { display : flex; align-items : center; gap : 10px ; color : # 111 ; }
21- .nav-logo img { width : 28px ; height : 28px ; }
22- .nav-logo span { font-size : 15px ; font-weight : 500 ; }
23- .hamburger { display : none; background : none; border : none; cursor : pointer; font-size : 22px ; padding : 4px 8px ; }
24-
25- .search-wrap { position : relative; }
26- .search-wrap input {
27- border : 1px solid # ddd ; border-radius : 6px ;
28- padding : 6px 12px 6px 32px ;
29- font-size : 13px ; outline : none; width : 180px ;
30- background : # f8f8f8 ; color : # 111 ;
31- transition : border-color 0.2s , width 0.2s ;
32- }
33- .search-wrap input : focus { border-color : # aaa ; width : 220px ; background : # fff ; }
34- .search-wrap svg { position : absolute; left : 9px ; top : 50% ; transform : translateY (-50% ); width : 14px ; height : 14px ; stroke : # aaa ; fill : none; pointer-events : none; }
35- .search-results {
36- position : absolute; top : calc (100% + 8px ); right : 0 ;
37- background : # fff ; border : 1px solid # e0e0e0 ;
38- border-radius : 8px ; width : 280px ;
39- box-shadow : 0 4px 16px rgba (0 , 0 , 0 , 0.08 );
40- display : none; z-index : 200 ; overflow : hidden;
41- }
42- .search-results .show { display : block; }
43- .search-result-item { padding : 10px 14px ; font-size : 13px ; cursor : pointer; border-bottom : 1px solid # f0f0f0 ; }
44- .search-result-item : last-child { border-bottom : none; }
45- .search-result-item : hover { background : # f8f8f8 ; }
46- .search-result-item .tag { font-size : 11px ; color : # aaa ; margin-left : 6px ; }
47- .search-empty { padding : 12px 14px ; font-size : 13px ; color : # aaa ; }
4824
4925 .layout { display : flex; min-height : calc (100vh - 60px ); }
5026
27+ /* Sidebar — matches other pages exactly */
5128 .sidebar {
52- width : 220px ; min-width : 220px ;
29+ width : 220px ;
30+ min-width : 220px ;
5331 border-right : 1px solid # e0e0e0 ;
54- padding : 2rem 1.5rem ;
55- display : flex; flex-direction : column; gap : 0.25rem ;
56- position : sticky; top : 60px ;
32+ padding : 1.5rem 1.5rem 1rem ;
33+ display : flex;
34+ flex-direction : column;
35+ position : sticky;
36+ top : 60px ;
5737 height : calc (100vh - 60px );
5838 background : # fff ;
5939 }
60- .sidebar a { font-size : 14px ; color : # 555 ; padding : 0.4rem 0 ; display : block; }
40+ .sidebar a {
41+ font-size : 14px ;
42+ color : # 555 ;
43+ padding : 0.4rem 0 ;
44+ display : block;
45+ }
6146 .sidebar a : hover { color : # 111 ; }
47+ .sidebar a .active { color : # 111 ; font-weight : 500 ; }
6248
63- .page-body { flex : 1 ; }
49+ .page-body { flex : 1 ; overflow-x : hidden; }
6450
51+ /* Hero */
6552 .main {
6653 height : calc (100vh - 60px );
67- display : flex; align-items : center;
68- padding : 0 5rem ; gap : 4rem ;
54+ display : flex;
55+ align-items : center;
56+ padding : 0 5rem ;
57+ gap : 4rem ;
58+ position : relative;
6959 }
7060 .left { flex : 1 ; }
71- .left h1 { font-size : 2.6rem ; font-weight : 600 ; letter-spacing : -0.02em ; line-height : 1.2 ; margin-bottom : 1.5rem ; }
72- .left h1 .proc { font-family : "IBM Plex Sans" , sans-serif; color : # 0064ff ; font-weight : 700 ; }
73- .left p { font-size : 1rem ; color : # 555 ; margin-bottom : 0 ; }
61+ .left h1 {
62+ font-size : 2.6rem ;
63+ font-weight : 600 ;
64+ letter-spacing : -0.02em ;
65+ line-height : 1.2 ;
66+ margin-bottom : 1.5rem ;
67+ }
68+ .left h1 .proc {
69+ font-family : "ProcessingSans" , sans-serif;
70+ color : # 003f6b ;
71+ font-weight : 400 ;
72+ }
73+ .left p { font-size : 1rem ; color : # 555 ; }
7474 .left p a { color : # 111 ; border-bottom : 1px solid # 111 ; font-weight : 500 ; }
7575 .right { flex : 1 ; display : flex; justify-content : flex-end; align-items : center; }
7676 .right img { width : 340px ; height : 340px ; object-fit : contain; }
7777
78- .scroll-hint { text-align : center; padding : 1rem 0 ; color : # ccc ; font-size : 22px ; }
78+ /* Arrow — positioned inside .main so it's always visible above the fold */
79+ .scroll-hint {
80+ position : absolute;
81+ bottom : 1.5rem ;
82+ left : 50% ;
83+ transform : translateX (-50% );
84+ color : # bbb ;
85+ font-size : 22px ;
86+ animation : bounce 1.8s infinite;
87+ }
88+ @keyframes bounce {
89+ 0% , 100% { transform : translateX (-50% ) translateY (0 ); }
90+ 50% { transform : translateX (-50% ) translateY (6px ); }
91+ }
7992
80- .examples-section { max-width : 960px ; margin : 0 auto; padding : 5rem 3rem ; border-top : 1px solid # e0e0e0 ; }
93+ /* Examples section */
94+ .examples-section {
95+ max-width : 960px ;
96+ margin : 0 auto;
97+ padding : 5rem 3rem ;
98+ border-top : 1px solid # e0e0e0 ;
99+ }
81100 .examples-section h2 { font-size : 1.5rem ; font-weight : 600 ; margin-bottom : 2.5rem ; }
82- .examples-grid { display : grid; grid-template-columns : repeat (auto-fit, minmax (280px , 1fr )); gap : 1px ; border : 1px solid # e0e0e0 ; border-radius : 8px ; overflow : hidden; }
101+ .examples-grid {
102+ display : grid;
103+ grid-template-columns : repeat (auto-fit, minmax (280px , 1fr ));
104+ gap : 1px ;
105+ border : 1px solid # e0e0e0 ;
106+ border-radius : 8px ;
107+ overflow : hidden;
108+ }
83109 .example-card { background : # fff ; overflow : hidden; }
84110 .example-canvas { width : 100% ; aspect-ratio : 1 ; background : # 000 ; display : block; }
85111 .example-info { padding : 1rem 1.25rem ; border-top : 1px solid # e0e0e0 ; }
92118 footer { border-top : 1px solid # e0e0e0 ; padding : 2rem ; text-align : center; font-size : 13px ; color : # 888 ; }
93119
94120 @media (max-width : 768px ) {
95- .hamburger { display : block; }
96121 .sidebar {
97122 position : fixed; top : 60px ; left : -240px ;
98123 width : 240px ; height : calc (100vh - 60px );
99124 z-index : 200 ; transition : left 0.25s ease;
100125 box-shadow : 2px 0 12px rgba (0 , 0 , 0 , 0.08 );
101126 }
102127 .sidebar .open { left : 0 ; }
103- .main { flex-direction : column; padding : 3rem 2rem ; height : auto; }
104- .right img { width : 200 px ; height : 200 px ; }
105- .search-wrap { display : none; }
128+ .main { flex-direction : column; padding : 3rem 2rem ; height : auto; gap : 2 rem ; }
129+ .right img { width : 180 px ; height : 180 px ; }
130+ .scroll-hint { position : static; transform : none; display : block; text-align : center; padding : 1 rem 0 ; animation : none; }
106131 }
107132 </ style >
108133</ head >
111136< nav id ="site-nav "> </ nav >
112137
113138< div class ="layout ">
114- < div class ="sidebar " id ="sidebar ">
115- < a href ="/libraries "> Libraries</ a >
116- < a href ="/reference "> Reference</ a >
117- < a href ="/examples "> Examples</ a >
118- < a href ="/about "> About</ a >
119- </ div >
139+ < div class ="sidebar " id ="sidebar "> </ div >
120140
121141 < div class ="page-body ">
122142 < div class ="main ">
123143 < div class ="left ">
124144 < h1 > C++ Mode for< br > < span class ="proc "> Processing</ span > </ h1 >
125- < p > Explore the < a href ="/reference "> C++ Mode reference</ a > for the full API.</ p >
145+ < p > Explore the < a href ="/reference "> reference</ a > for the full API.</ p >
126146 </ div >
127147 < div class ="right ">
128- < img src ="assets/cpp-logo.png " alt ="C++ Mode ">
148+ < img src ="assets/cpp-logo.png " alt ="Processing for C++ ">
129149 </ div >
150+ < div class ="scroll-hint "> ↓</ div >
130151 </ div >
131152
132- < div class ="scroll-hint "> ↓</ div >
133-
134153 < div class ="examples-section ">
135- < p style ="font-size:0.95rem;color:#888;margin-bottom:0.5rem; "> Explore the < a href ="/reference " style ="color:#111;border-bottom:1px solid #ddd; "> C++ Mode reference</ a > for the full API.</ p >
136154 < h2 > Examples</ h2 >
137155 < div class ="examples-grid ">
138156 < div class ="example-card ">
@@ -149,64 +167,15 @@ <h2>Examples</h2>
149167 </ div >
150168 </ div >
151169 < div class ="examples-footer ">
152- < a href ="/examples "> View all examples</ a >
170+ < a href ="/examples "> View all examples → </ a >
153171 </ div >
154172 </ div >
155173 </ div >
156174</ div >
157175
158- < footer > < p > C++ Mode for Processing </ p > </ footer >
176+ < footer > < p > Processing for C++ </ p > </ footer >
159177
160178< script >
161- const data = [
162- { title : "Libraries" , url : "/libraries" , tag : "page" } ,
163- { title : "Reference" , url : "/reference" , tag : "page" } ,
164- { title : "Examples" , url : "/examples" , tag : "page" } ,
165- { title : "About" , url : "/about" , tag : "page" } ,
166- { title : "setup()" , url : "/reference" , tag : "reference" } ,
167- { title : "draw()" , url : "/reference" , tag : "reference" } ,
168- { title : "size()" , url : "/reference" , tag : "reference" } ,
169- { title : "background()" , url : "/reference" , tag : "reference" } ,
170- { title : "ellipse()" , url : "/reference" , tag : "reference" } ,
171- { title : "rect()" , url : "/reference" , tag : "reference" } ,
172- { title : "fill()" , url : "/reference" , tag : "reference" } ,
173- { title : "stroke()" , url : "/reference" , tag : "reference" } ,
174- { title : "mouseX" , url : "/reference" , tag : "reference" } ,
175- { title : "mouseY" , url : "/reference" , tag : "reference" } ,
176- { title : "std::vector" , url : "/libraries" , tag : "library" } ,
177- { title : "std::map" , url : "/libraries" , tag : "library" } ,
178- { title : "std::string" , url : "/libraries" , tag : "library" } ,
179- { title : "std::thread" , url : "/libraries" , tag : "library" } ,
180- ] ;
181-
182- const input = document . getElementById ( "search-input" ) ;
183- const results = document . getElementById ( "search-results" ) ;
184-
185- input . addEventListener ( "input" , function ( ) {
186- const q = this . value . trim ( ) . toLowerCase ( ) ;
187- results . innerHTML = "" ;
188- if ( ! q ) { results . classList . remove ( "show" ) ; return ; }
189- const matches = data . filter ( d =>
190- d . title . toLowerCase ( ) . includes ( q )
191- ) . slice ( 0 , 8 ) ;
192- if ( matches . length === 0 ) {
193- results . innerHTML = '<div class="search-empty">No results</div>' ;
194- } else {
195- matches . forEach ( m => {
196- const div = document . createElement ( "div" ) ;
197- div . className = "search-result-item" ;
198- div . innerHTML = m . title + '<span class="tag">' + m . tag + '</span>' ;
199- div . onclick = ( ) => { window . location = m . url ; } ;
200- results . appendChild ( div ) ;
201- } ) ;
202- }
203- results . classList . add ( "show" ) ;
204- } ) ;
205-
206- document . addEventListener ( "click" , function ( e ) {
207- if ( ! e . target . closest ( ".search-wrap" ) ) results . classList . remove ( "show" ) ;
208- } ) ;
209-
210179new p5 ( function ( p ) {
211180 let x , y , vx , vy ;
212181 p . setup = function ( ) { p . createCanvas ( 300 , 300 , p . document . getElementById ( 'c1' ) ) ; x = 150 ; y = 150 ; vx = 2.5 ; vy = 1.8 ; p . noStroke ( ) ; } ;
0 commit comments