mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-24 05:57:17 -04:00
move draw logic to separate package
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
"@nanostores/react": "^0.7.1",
|
||||
"@strudel/codemirror": "workspace:*",
|
||||
"@strudel/core": "workspace:*",
|
||||
"@strudel/canvas": "workspace:*",
|
||||
"@strudel/csound": "workspace:*",
|
||||
"@strudel/desktopbridge": "workspace:*",
|
||||
"@strudel/hydra": "workspace:*",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { colorMap } from '@strudel/core/color.mjs';
|
||||
import React from 'react';
|
||||
import { colorMap } from '@strudel/canvas';
|
||||
|
||||
const Colors = () => {
|
||||
return (
|
||||
|
||||
@@ -4,7 +4,8 @@ Copyright (C) 2022 Strudel contributors - see <https://github.com/tidalcycles/st
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { code2hash, getDrawContext, logger, silence } from '@strudel/core';
|
||||
import { code2hash, logger, silence } from '@strudel/core';
|
||||
import { getDrawContext } from '@strudel/canvas';
|
||||
import cx from '@src/cx.mjs';
|
||||
import { transpiler } from '@strudel/transpiler';
|
||||
import {
|
||||
|
||||
@@ -24,7 +24,9 @@ angle(saw)
|
||||
`;
|
||||
|
||||
// https://strudel.cc/?C31_NrcMfZEO
|
||||
export const spiralflower = `const {innerWidth:ww,innerHeight:wh} = window;
|
||||
export const spiralflower = `let {innerWidth:ww,innerHeight:wh} = window;
|
||||
ww*=window.devicePixelRatio;
|
||||
wh*=window.devicePixelRatio;
|
||||
const ctx = getDrawContext()
|
||||
const piDiv180 = Math.PI / 180;
|
||||
function fromPolar(angle, radius, cx, cy) {
|
||||
|
||||
@@ -72,6 +72,7 @@ export async function getRandomTune() {
|
||||
export function loadModules() {
|
||||
let modules = [
|
||||
import('@strudel/core'),
|
||||
import('@strudel/canvas'),
|
||||
import('@strudel/tonal'),
|
||||
import('@strudel/mini'),
|
||||
import('@strudel/xen'),
|
||||
|
||||
Reference in New Issue
Block a user