feat: add clear/limpiar button to sandbox toolbar
Stops audio and removes all modules and connections from the canvas. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -243,6 +243,12 @@ export default function App({ onSwitchToGame }) {
|
|||||||
emit();
|
emit();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleClearCanvas = () => {
|
||||||
|
if (state.isRunning) stopAudio();
|
||||||
|
deserialize({ modules: [], connections: [] });
|
||||||
|
emit();
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="app">
|
<div className="app">
|
||||||
{/* Toolbar */}
|
{/* Toolbar */}
|
||||||
@@ -269,6 +275,9 @@ export default function App({ onSwitchToGame }) {
|
|||||||
<button className="toolbar-btn" onClick={handleLoadDemo} style={{ color: 'var(--yellow)' }}>
|
<button className="toolbar-btn" onClick={handleLoadDemo} style={{ color: 'var(--yellow)' }}>
|
||||||
🎮 Chiptune Demo
|
🎮 Chiptune Demo
|
||||||
</button>
|
</button>
|
||||||
|
<button className="toolbar-btn" onClick={handleClearCanvas}>
|
||||||
|
🗑 Limpiar
|
||||||
|
</button>
|
||||||
<div className="toolbar-sep" />
|
<div className="toolbar-sep" />
|
||||||
<span className="toolbar-label" style={{ color: state.isRunning ? 'var(--green)' : 'var(--text2)' }}>
|
<span className="toolbar-label" style={{ color: state.isRunning ? 'var(--green)' : 'var(--text2)' }}>
|
||||||
{state.isRunning ? '● LIVE' : '○ OFF'}
|
{state.isRunning ? '● LIVE' : '○ OFF'}
|
||||||
|
|||||||
Reference in New Issue
Block a user