Merge remote-tracking branch 'upstream/main' into zzfx
This commit is contained in:
commit
d6c4bb0e4e
35 changed files with 1010 additions and 36 deletions
|
|
@ -46,12 +46,14 @@ const base = BASE_URL;
|
|||
{pwaInfo && <Fragment set:html={pwaInfo.webManifest.linkTag} />}
|
||||
|
||||
<script>
|
||||
import { settings } from '../repl/themes.mjs';
|
||||
import { settings, injectStyle } from '../repl/themes.mjs';
|
||||
import { settingsMap } from '../settings.mjs';
|
||||
import { listenKeys } from 'nanostores';
|
||||
const themeStyle = document.createElement('style');
|
||||
themeStyle.id = 'strudel-theme';
|
||||
document.head.append(themeStyle);
|
||||
|
||||
let resetThemeStyle;
|
||||
function activateTheme(name) {
|
||||
if (!settings[name]) {
|
||||
console.warn('theme', name, 'has no settings.. defaulting to strudelTheme settings');
|
||||
|
|
@ -70,6 +72,11 @@ const base = BASE_URL;
|
|||
} else {
|
||||
document.documentElement.classList.add('dark');
|
||||
}
|
||||
resetThemeStyle?.();
|
||||
resetThemeStyle = undefined;
|
||||
if (themeSettings.customStyle) {
|
||||
resetThemeStyle = injectStyle(themeSettings.customStyle);
|
||||
}
|
||||
}
|
||||
|
||||
activateTheme(settingsMap.get().theme);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,22 @@ Now we not only pattern the notes, but the sound as well!
|
|||
|
||||
<JsDoc client:idle name="fmh" h={0} />
|
||||
|
||||
### fmattack
|
||||
|
||||
<JsDoc client:idle name="fmattack" h={0} />
|
||||
|
||||
### fmdecay
|
||||
|
||||
<JsDoc client:idle name="fmdecay" h={0} />
|
||||
|
||||
### fmsustain
|
||||
|
||||
<JsDoc client:idle name="fmsustain" h={0} />
|
||||
|
||||
### fmenv
|
||||
|
||||
<JsDoc client:idle name="fmenv" h={0} />
|
||||
|
||||
## ZZFX
|
||||
|
||||
The "Zuper Zmall Zound Zynth" [ZZFX](https://github.com/KilledByAPixel/ZzFX) is also integrated in strudel.
|
||||
|
|
|
|||
|
|
@ -375,6 +375,8 @@ const fontFamilyOptions = {
|
|||
'we-come-in-peace': 'we-come-in-peace',
|
||||
FiraCode: 'FiraCode',
|
||||
'FiraCode-SemiBold': 'FiraCode SemiBold',
|
||||
teletext: 'teletext',
|
||||
mode7: 'mode7',
|
||||
};
|
||||
|
||||
function SettingsTab({ scheduler }) {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import { settingsMap, useSettings, setLatestCode } from '../settings.mjs';
|
|||
import Loader from './Loader';
|
||||
import { settingPatterns } from '../settings.mjs';
|
||||
import { code2hash, hash2code } from './helpers.mjs';
|
||||
import { isTauri } from '../tauri.mjs';
|
||||
|
||||
const { latestCode } = settingsMap.get();
|
||||
|
||||
|
|
@ -36,7 +37,7 @@ const modules = [
|
|||
import('@strudel.cycles/core'),
|
||||
import('@strudel.cycles/tonal'),
|
||||
import('@strudel.cycles/mini'),
|
||||
import('@strudel.cycles/midi'),
|
||||
isTauri() ? import('@strudel/desktopbridge') : import('@strudel.cycles/midi'),
|
||||
import('@strudel.cycles/xen'),
|
||||
import('@strudel.cycles/webaudio'),
|
||||
import('@strudel.cycles/osc'),
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import strudelTheme from '@strudel.cycles/react/src/themes/strudel-theme';
|
|||
import bluescreen, { settings as bluescreenSettings } from '@strudel.cycles/react/src/themes/bluescreen';
|
||||
import blackscreen, { settings as blackscreenSettings } from '@strudel.cycles/react/src/themes/blackscreen';
|
||||
import whitescreen, { settings as whitescreenSettings } from '@strudel.cycles/react/src/themes/whitescreen';
|
||||
import teletext, { settings as teletextSettings } from '@strudel.cycles/react/src/themes/teletext';
|
||||
import algoboy, { settings as algoboySettings } from '@strudel.cycles/react/src/themes/algoboy';
|
||||
import terminal, { settings as terminalSettings } from '@strudel.cycles/react/src/themes/terminal';
|
||||
|
||||
|
|
@ -42,6 +43,7 @@ export const themes = {
|
|||
bluescreen,
|
||||
blackscreen,
|
||||
whitescreen,
|
||||
teletext,
|
||||
algoboy,
|
||||
terminal,
|
||||
abcdef,
|
||||
|
|
@ -95,6 +97,7 @@ export const settings = {
|
|||
bluescreen: bluescreenSettings,
|
||||
blackscreen: blackscreenSettings,
|
||||
whitescreen: whitescreenSettings,
|
||||
teletext: teletextSettings,
|
||||
algoboy: algoboySettings,
|
||||
terminal: terminalSettings,
|
||||
abcdef: {
|
||||
|
|
@ -469,3 +472,11 @@ function getCircularReplacer() {
|
|||
function stringifySafe(json) {
|
||||
return JSON.stringify(json, getCircularReplacer());
|
||||
}
|
||||
|
||||
export function injectStyle(rule) {
|
||||
const newStyle = document.createElement('style');
|
||||
document.head.appendChild(newStyle);
|
||||
const styleSheet = newStyle.sheet;
|
||||
const ruleIndex = styleSheet.insertRule(rule, 0);
|
||||
return () => styleSheet.deleteRule(ruleIndex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,14 @@
|
|||
font-family: 'FiraCode-SemiBold';
|
||||
src: url('/fonts/FiraCode/FiraCode-SemiBold.ttf');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'teletext';
|
||||
src: url('/fonts/teletext/EuropeanTeletext.ttf');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'mode7';
|
||||
src: url('/fonts/mode7/MODE7GX3.TTF');
|
||||
}
|
||||
|
||||
.prose > h1:not(:first-child) {
|
||||
margin-top: 30px;
|
||||
|
|
|
|||
4
website/src/tauri.mjs
Normal file
4
website/src/tauri.mjs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import { invoke } from '@tauri-apps/api/tauri';
|
||||
|
||||
export const Invoke = invoke;
|
||||
export const isTauri = () => window.__TAURI_IPC__ != null;
|
||||
Loading…
Add table
Add a link
Reference in a new issue