Skip to content

Commit 7d38f3d

Browse files
committed
Homepage: fullscreen editor overlay, Space Grotesk, welcome title
1 parent 4579b43 commit 7d38f3d

1 file changed

Lines changed: 22 additions & 10 deletions

File tree

index.html

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5+
<link rel="preconnect" href="https://fonts.googleapis.com">
6+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap">
57
<meta name="viewport" content="width=device-width, initial-scale=1.0">
68
<title>Processing for C++</title>
79
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.min.js"></script>
@@ -178,8 +180,9 @@
178180
<div class="page-body">
179181
<div class="main">
180182
<div class="left" style="display:flex;flex-direction:column;gap:1rem;min-width:0;flex:1;">
181-
<p style="font-size:1rem;color:#444;line-height:1.7;max-width:480px;font-family:'SpaceGrotesk',sans-serif;">
182-
C++ Mode is a plugin for <a href="https://processing.org" style="color:#111;border-bottom:1px solid #ccc;">Processing</a> that lets you write native C++ sketches using the Processing API. Get the performance of compiled C++ with the simplicity of Processing's creative coding environment.
183+
<h1 style="font-family:'Space Grotesk',sans-serif;font-size:2rem;font-weight:600;color:#111;line-height:1.2;margin-bottom:0.75rem;">Welcome to<br>Processing for C++</h1>
184+
<p style="font-size:0.95rem;color:#555;line-height:1.8;max-width:440px;font-family:'Space Grotesk',sans-serif;">
185+
If you love Processing but wish you could squeeze more performance out of your sketches — this is for you. C++ Mode is a plugin that lets you write Processing sketches in native C++, keeping the API you know while getting the speed of compiled code. Great for simulations, generative art, and anything that needs to run fast.
183186
</p>
184187
<div class="hero-actions">
185188
<a class="hero-link" href="/reference">Reference</a>
@@ -593,31 +596,40 @@ <h3>New to C++ Mode?</h3>
593596
heroEditor.setSize('100%', '300px');
594597

595598
let heroEditorOpen = false;
599+
let heroEditorMoved = false;
600+
596601
function toggleHeroEditor() {
597602
heroEditorOpen = !heroEditorOpen;
598-
const panel = document.getElementById('hero-editor-panel');
603+
const overlay = document.getElementById('hero-editor-overlay');
599604
const arrow = document.getElementById('hero-arrow-svg');
600605
const runBtn = document.getElementById('hero-sketch-run-btn');
606+
601607
if (heroEditorOpen) {
602-
panel.style.maxHeight = '400px';
603-
panel.style.opacity = '1';
608+
overlay.style.display = 'flex';
604609
arrow.style.transform = 'rotate(180deg)';
605610
runBtn.style.display = 'block';
606-
setTimeout(() => heroEditor.refresh(), 420);
611+
// Move CodeMirror into the overlay on first open
612+
if (!heroEditorMoved) {
613+
document.getElementById('hero-cm-wrap').appendChild(heroEditor.getWrapperElement());
614+
heroEditorMoved = true;
615+
}
616+
heroEditor.setSize('100%', '100%');
617+
setTimeout(() => heroEditor.refresh(), 50);
618+
document.body.style.overflow = 'hidden';
607619
} else {
608-
panel.style.maxHeight = '0';
609-
panel.style.opacity = '0';
620+
overlay.style.display = 'none';
610621
arrow.style.transform = '';
611622
runBtn.style.display = 'none';
623+
document.body.style.overflow = '';
612624
}
613625
}
614626

615627
function heroLaunch(html) {
616-
const area = document.getElementById('hero-preview');
628+
const area = document.getElementById('hero-preview-overlay');
617629
const old = area.querySelector('iframe');
618630
const iframe = document.createElement('iframe');
619631
iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin');
620-
iframe.style.cssText = 'position:absolute;top:0;left:0;width:600px;height:700px;border:none;transform-origin:top left;transform:scale(0.533);';
632+
iframe.style.cssText = 'position:absolute;top:0;left:0;width:100%;height:100%;border:none;';
621633
iframe.src = URL.createObjectURL(new Blob([html], {type:'text/html'}));
622634
if (old) { area.replaceChild(iframe, old); try{URL.revokeObjectURL(old.src);}catch(e){} }
623635
else area.appendChild(iframe);

0 commit comments

Comments
 (0)