some minor fixes

This commit is contained in:
2023-09-03 13:08:18 +02:00
parent fe71920e2b
commit baeebfdcf1
14 changed files with 72 additions and 13 deletions

View File

@ -108,8 +108,8 @@ export class AppSettings {
public vimMode: boolean = false;
public theme: string = "materialDark";
public font: string = "SpaceMono";
public font_size: number = 22;
public font: string = "Victor Mono";
public font_size: number = 24;
public universes: Universes;
public selected_universe: string = "Default";
public line_numbers: boolean = true;

View File

@ -1,5 +1,25 @@
export const examples = [
`
// Super gentle computing - Bubobubobubo
let melody = [30,30,34,35,37].palindrome()
.beat() + [0, -12].repeatAll(2).div(2)
if (div(8, 75)) {
log('first section')
rhythm(.5, 4, 8) :: sound('ST12').n([0,1,2].div(0.5)).speed(0.5).out()
rhythm(.5, 6, 8) :: sound('ST20').n([0,1,2].div(0.5) + 20)
.speed(0.25).end(0.1).orbit(2).room(0.5).size(0.5).out()
mod(.5) :: sound('ST01').note(melody)
.n($(1)).speed(0.5).room(0.5).size(0.5).out()
} else {
log('second section')
rhythm(.5, 2, 8) :: sound('ST20')
.n([0,1,2].div(0.5)).speed(0.5)
.end(0.1).out()
mod(.5) :: sound('ST01').note(melody).n($(1)).speed(0.5).end(0.1).out()
mod(1) :: sound('ST02').note(melody).n($(1)).speed(0.5).end(0.1).out()
}
`,
`
// Race day - Bubobubobubo
bpm(125);
mod(.5) :: sound('STB6')

View File

@ -236,10 +236,13 @@ export class Editor {
this.fontSize = new Compartment();
const vimPlugin = this.settings.vimMode ? vim() : [];
const lines = this.settings.line_numbers ? lineNumbers() : [];
const fontSizeModif = EditorView.theme({
const fontModif = EditorView.theme({
"&": {
fontSize: `${this.settings.font_size}px`,
},
$content: {
fontFamily: `${this.settings.font}, Menlo, Monaco, Lucida Console, monospace`,
},
".cm-gutters": {
fontSize: `${this.settings.font_size}px`,
},
@ -247,7 +250,7 @@ export class Editor {
this.editorExtensions = [
this.withLineNumbers.of(lines),
this.fontSize.of(fontSizeModif),
this.fontSize.of(fontModif),
this.vimModeCompartment.of(vimPlugin),
editorSetup,
oneDark,
@ -529,7 +532,8 @@ export class Editor {
this.font_size_witness.innerHTML = `Font Size: ${new_value}px`;
let new_font_size = EditorView.theme({
"&": { fontSize: new_value + "px" },
"&": { fontSize: new_value + "px", fontFamily: this.settings.font },
"&content": { fontFamily: this.settings.font },
".cm-gutters": { fontSize: new_value + "px" },
});
this.view.dispatch({

View File

@ -2,6 +2,7 @@ import { EditorView } from "@codemirror/view";
import { Extension } from "@codemirror/state";
import { HighlightStyle, syntaxHighlighting } from "@codemirror/language";
import { tags as t } from "@lezer/highlight";
import { }
const base00 = "#171717",
base01 = "#505d64",
@ -37,21 +38,19 @@ export const materialDarkTheme = EditorView.theme(
"&": {
color: base05,
backgroundColor: background,
fontSize: "24px",
fontSize: "48px",
font: "'Victor Mono', monospace",
},
".cm-content": {
caretColor: cursor,
fontFamily: "'Victor Mono', monospace",
},
".cm-cursor, .cm-dropCursor": { borderLeftColor: cursor },
"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":
{ backgroundColor: selection, border: `0.5px solid ${base_teal}` },
".cm-panels": { backgroundColor: darkBackground, color: base03 },
".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
".cm-searchMatch": {
outline: `1px solid ${base_yellow}`,
backgroundColor: "transparent",