I updated the Mercury engine to v1.7.0, and also updated some of the texts/urls in the README.
Co-authored-by: tmhglnd <timohoogland@gmail.com>
Reviewed-on: https://codeberg.org/munshkr/flok/pulls/376
Reviewed-by: Damián Silvani <munshkr@noreply.codeberg.org>
Co-authored-by: tmhglnd <tmhglnd@noreply.codeberg.org>
Co-committed-by: tmhglnd <tmhglnd@noreply.codeberg.org>
Updates `textmode.js` from `v0.6.1` to `v0.7.1`, introducing new features like multi-layering, which enable an infinite amount of new creative possibilities. 🌟
Additionally, the `textmode` frame now also contains a programmable `hydra` canvas, which gets fed into the `textmode.js` instance for conversion, which can then be displayed by the user on any layer(s).
It only works from `hydra` -> `textmode.js` right now, and not the other way around yet.
Information coming from strudel and mercury is now also available within the `textmode` frame, meaning you can now create textmode visuals that react to strudel audio. I have tested strudel successfully, but I have not tested `mercury`, as I am not familiar with that.
I've also added a `textmode.js` add-on library `textmode.filters.js`, which adds more filter shaders to use, since the core library only has a few ones. This add-on library allows you to apply effects like glitches or chromatic aberration to a layer, or the final composited result.
Lastly, I've updated the `textmode-wrapper.ts` to be more robust, since each layer introduced by the user is its own draw-loop basically.
With those changes made, I have no longer been able to break the sketch/page/visuals by purposefully introducing syntax errors into the code.
If there is an error anywhere when (re-)evaluating, it correctly maintains the last working code and keeps it running.
Co-authored-by: chr1sdoofer <59119064+chr1sdoofer@users.noreply.github.com>
Reviewed-on: https://codeberg.org/munshkr/flok/pulls/373
Co-authored-by: textmodejs <textmodejs@noreply.codeberg.org>
Co-committed-by: textmodejs <textmodejs@noreply.codeberg.org>
`textmode-wrapper.ts` provides a wrapper class around the `textmode.js` library, and access to a global [Textmodifier](https://code.textmode.art/api/classes/Textmodifier.html) instance `t`, which is used by the user to draw on the canvas, load assets, update the font, font size, and more.
- Includes more advanced error handling, so errors in the draw callback are properly caught. The canvas always renders the last valid sketch that was evaluated. Errors are shown (like in the toast), but it'll keep showing the last working animation/sketch on the canvas.
- Also uses a newly integrated `isWebgl2Supported()` function, since the library is dependent on `WebGL2`.
- Does currently only support the `showCanvas` display setting.
- On `tryEval()`, the internal frame count is currently **not** reset. I'm not sure what's preferred to live coders, but I've added commented-out code which would reset the frame count on `tryEval()`. Happy about your thoughts here.
`textmode.tsx` is the corresponding React component that serves as the frame for `textmode.js`.
- In `utils.ts`, the `isWebgl2Supported()` function has been added, as mentioned.
- In `session.tsx` and `settings.json`, the relevant declarations/definitions have been made.
- In `command.tsx`, I fixed an error unrelated to textmode.js/this PR, where an error/warning was thrown every time the `CommandDialog` was opened via the button on the top-right.
- Added `textmode.js` v0.6.1 (latest) to `package.json`
- Included textmode.js in `example-vanilla-js`
- Update `README.md` to include `textmode.js`, including a small section with a short description, a code example, and links to the documentation.
---
Co-authored-by: humanbydefinition <christopherdietrich@outlook.com>
Co-authored-by: chr1sdoofer <59119064+chr1sdoofer@users.noreply.github.com>
Reviewed-on: https://codeberg.org/munshkr/flok/pulls/371
Co-authored-by: textmodejs <textmodejs@noreply.codeberg.org>
Co-committed-by: textmodejs <textmodejs@noreply.codeberg.org>
Use javascript type so that `Ctrl+/` uses `//` for line comments.
Co-authored-by: gilfuser <gilfuser@noreply.codeberg.org>
Co-committed-by: gilfuser <gilfuser@noreply.codeberg.org>
* [x] Show "Evaluate Button" if using devices with touch screen (not by breakpoint)
* [x] Use CSS grids for pane layout instead of manually defining layout with containers
* [x] Add "Next" and "Prev" buttons on small devices to move around panes
* [x] Fix styles of status bar and other UI on single-pane layout for mobile devices
* [x] Refactor
Co-authored-by: Damián Silvani <munshkr@gmail.com>
Reviewed-on: https://codeberg.org/munshkr/flok/pulls/349
* Load current font only, and the rest of the fonts only when trying to change font from settings
* Lazy load Mercury and Hydra (only when initializing)
Co-authored-by: Damián Silvani <munshkr@gmail.com>
Reviewed-on: https://codeberg.org/munshkr/flok/pulls/350
Changes:
- change defaults of fft function:
- `index` is now 0
- `buckets` is now 1
- the third parameters can now also just be a string, setting the
analyzer id directly.
- this is the most used other option, and it was noisy to set it with
the object each time