customize editor

This commit is contained in:
Jade (Rose) Rowland
2025-09-30 00:38:35 -04:00
parent ec69f6fd77
commit d943dce11c
4 changed files with 13 additions and 48 deletions
Regular → Executable
View File
+4 -4
View File
@@ -4,13 +4,13 @@ export default function UdelsHeader(Props) {
const { numWindows, setNumWindows } = Props;
return (
<header id="header" className="flex text-white z-[100] text-lg select-none bg-neutral-800">
<header id="header" className="flex text-white z-[100] text-lg select-none bg-black">
<div className="px-4 items-center gap-2 flex space-x-2 md:pt-0 select-none">
<h1 onClick={() => {}} className={'text-l cursor-pointer flex gap-4'}>
<div className={'mt-[1px] cursor-pointer'}>🌀</div>
<div className={'mt-[1px] cursor-pointer'}>🦄</div>
<div className={'animate-pulse'}>
<span className="">strudel</span> <span className="text-sm">-UDELS</span>
<div>
<span className="font-mono text-">SWITCH ANGEL</span>
</div>
</h1>
<NumberInput value={numWindows} setValue={setNumWindows} />
+4 -44
View File
@@ -47,12 +47,12 @@ export function Header({ context, embedded = false }) {
}
}}
>
<span className="block text-foreground rotate-90"></span>
<span className="block text-foreground ">*</span>
</div>
{!isZen && (
<div className="space-x-2">
<span className="">strudel</span>
<span className="text-sm font-medium">REPL</span>
<span className="">Switch Angel</span>
<span className="text-sm font-medium"></span>
{!isEmbedded && isButtonRowHidden && (
<a href={`${baseNoTrailing}/learn`} className="text-sm opacity-25 font-medium">
DOCS
@@ -82,47 +82,7 @@ export function Header({ context, embedded = false }) {
<>loading...</>
)}
</button>
<button
onClick={handleEvaluate}
title="update"
className={cx(
'flex items-center space-x-1',
!isEmbedded ? 'p-2' : 'px-2',
!isDirty || !activeCode ? 'opacity-50' : 'hover:opacity-50',
)}
>
{!isEmbedded && <span>update</span>}
</button>
{/* !isEmbedded && (
<button
title="shuffle"
className="hover:opacity-50 p-2 flex items-center space-x-1"
onClick={handleShuffle}
>
<span> shuffle</span>
</button>
) */}
{!isEmbedded && (
<button
title="share"
className={cx(
'cursor-pointer hover:opacity-50 flex items-center space-x-1',
!isEmbedded ? 'p-2' : 'px-2',
)}
onClick={handleShare}
>
<span>share</span>
</button>
)}
{!isEmbedded && (
<a
title="learn"
href={`${baseNoTrailing}/workshop/getting-started/`}
className={cx('hover:opacity-50 flex items-center space-x-1', !isEmbedded ? 'p-2' : 'px-2')}
>
<span>learn</span>
</a>
)}
{/* {isEmbedded && (
<button className={cx('hover:opacity-50 px-2')}>
<a href={window.location.href} target="_blank" rel="noopener noreferrer" title="Open in REPL">
+5
View File
@@ -36,6 +36,7 @@ import { getRandomTune, initCode, loadModules, shareCode } from './util.mjs';
import './Repl.css';
import { setInterval, clearInterval } from 'worker-timers';
import { getMetadata } from '../metadata_parser';
import jadeScriptsRaw from '../../../../../../switchangel/strudel-scripts/allscripts.js?raw'
const { latestCode, maxPolyphony, audioDeviceName, multiChannelOrbits } = settingsMap.get();
let modulesLoading, presets, drawContext, clearCanvas, audioReady;
@@ -142,6 +143,10 @@ export function useReplContext() {
msg = `Default code has been loaded`;
}
editor.setCode(code);
// console.info(jadeScriptsRaw)
editor.repl.evaluate(jadeScriptsRaw)
setDocumentTitle(code);
logger(`Welcome to Strudel! ${msg} Press play or hit ctrl+enter to run it!`, 'highlight');
});