diff --git a/packages/codemirror/codemirror.mjs b/packages/codemirror/codemirror.mjs index 5886c476..e96b533e 100644 --- a/packages/codemirror/codemirror.mjs +++ b/packages/codemirror/codemirror.mjs @@ -67,6 +67,7 @@ export function initEditor({ initialCode = '', onChange, onEvaluate, onStop, roo const initialSettings = Object.keys(compartments).map((key) => compartments[key].of(extensions[key](parseBooleans(settings[key]))), ); + initTheme(settings.theme); let state = EditorState.create({ doc: initialCode, diff --git a/packages/codemirror/themes.mjs b/packages/codemirror/themes.mjs index 47d6c3c1..c2f49065 100644 --- a/packages/codemirror/themes.mjs +++ b/packages/codemirror/themes.mjs @@ -4,6 +4,7 @@ import blackscreen, { settings as blackscreenSettings } from './themes/blackscre import whitescreen, { settings as whitescreenSettings } from './themes/whitescreen.mjs'; import teletext, { settings as teletextSettings } from './themes/teletext.mjs'; import algoboy, { settings as algoboySettings } from './themes/algoboy.mjs'; +import CutiePi, { settings as CutiePiSettings } from './themes/CutiePi.mjs'; import terminal, { settings as terminalSettings } from './themes/terminal.mjs'; import abcdef, { settings as abcdefSettings } from './themes/abcdef.mjs'; import androidstudio, { settings as androidstudioSettings } from './themes/androidstudio.mjs'; @@ -55,6 +56,7 @@ export const themes = { androidstudio, duotoneDark, githubDark, + CutiePi, gruvboxDark, materialDark, nord, @@ -98,6 +100,7 @@ export const settings = { duotoneLight: duotoneLightSettings, duotoneDark: duotoneDarkSettings, eclipse: eclipseSettings, + CutiePi: CutiePiSettings, githubLight: githubLightSettings, githubDark: githubDarkSettings, gruvboxDark: gruvboxDarkSettings, diff --git a/packages/codemirror/themes/CutiePi.mjs b/packages/codemirror/themes/CutiePi.mjs new file mode 100644 index 00000000..f649a117 --- /dev/null +++ b/packages/codemirror/themes/CutiePi.mjs @@ -0,0 +1,45 @@ +/** + * @name Cutie Pi + * by Switch Angel + */ +import { tags as t } from '@lezer/highlight'; +import { createTheme } from './theme-helper.mjs'; +const deepPurple = '#5c019a'; +const yellowPink = '#fbeffc'; +const grey = '#272C35'; +const pinkAccent = '#fee1ff'; +const lightGrey = '#465063'; +const bratGreen = '#9acd3f'; +const lighterGrey = '#97a1b7'; +const pink = '#f6a6fd'; + +export const settings = { + background: 'white', + lineBackground: 'transparent', + foreground: deepPurple, + caret: '#797977', + selection: yellowPink, + selectionMatch: '#2B323D', + gutterBackground: grey, + gutterForeground: lightGrey, + gutterBorder: 'transparent', + lineHighlight: pinkAccent, +}; + +export default createTheme({ + theme: 'light', + settings, + styles: [ + { + tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction], + color: deepPurple, + }, + { tag: [t.tagName, t.heading], color: settings.foreground }, + { tag: t.comment, color: lighterGrey }, + { tag: [t.variableName, t.propertyName, t.labelName], color: pink }, + { tag: [t.attributeName, t.number], color: '#d19a66' }, + { tag: t.className, color: grey }, + { tag: t.keyword, color: deepPurple }, + { tag: [t.string, t.regexp, t.special(t.propertyName)], color: bratGreen }, + ], +}); diff --git a/packages/tidal/package.json b/packages/tidal/package.json index 94507aa9..1758732d 100644 --- a/packages/tidal/package.json +++ b/packages/tidal/package.json @@ -5,7 +5,7 @@ "module": "tidal.mjs", "repository": { "type": "git", - "url": "git+https://github.com/felixroos/hs2js.git" + "url": "git+https://github.com/tidalcycles/strudel/tree/main/packages/tidal" }, "keywords": [ "haskell", diff --git a/website/public/fonts/CutiePi/Cute_Aurora_demo.ttf b/website/public/fonts/CutiePi/Cute_Aurora_demo.ttf new file mode 100644 index 00000000..2ff9d6cf Binary files /dev/null and b/website/public/fonts/CutiePi/Cute_Aurora_demo.ttf differ diff --git a/website/public/fonts/CutiePi/LICENSE.txt b/website/public/fonts/CutiePi/LICENSE.txt new file mode 100644 index 00000000..dbc024ae --- /dev/null +++ b/website/public/fonts/CutiePi/LICENSE.txt @@ -0,0 +1,7 @@ + +100% free for personal and commercial use. +However it's limited on basic latin only, +contact riedjal@gmail.com for full glyph (based on ANSI encoding) +and OTF features (alternates). + +src: https://www.dafont.com/cute-aurora.font?text=%24%3A+s%28%22bd%285%2C8%29%22%29.superimpose%28x+%3D%3E+x.note%28%22c2%22%29.midi%28device%29%29 \ No newline at end of file diff --git a/website/src/components/Udels/UdelsEditor.jsx b/website/src/components/Udels/UdelsEditor.jsx index fe7a1ae4..f58ac5fc 100644 --- a/website/src/components/Udels/UdelsEditor.jsx +++ b/website/src/components/Udels/UdelsEditor.jsx @@ -9,11 +9,11 @@ import UserFacingErrorMessage from '@src/repl/components/UserFacingErrorMessage' // } export default function UdelsEditor(Props) { - const { context } = Props; + const { context, ...editorProps } = Props; const { containerRef, editorRef, error, init, pending, started, handleTogglePlay } = context; return ( -