From 57e179acfd5b9dbe8f6778a99d840adaa87c4830 Mon Sep 17 00:00:00 2001 From: Alex Szabo Date: Sun, 5 May 2024 12:33:56 +0200 Subject: [PATCH] chore: add some docs, fix focus and search box --- bundle.min.js | 53 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/bundle.min.js b/bundle.min.js index b5550b8..811dee4 100644 --- a/bundle.min.js +++ b/bundle.min.js @@ -47199,6 +47199,7 @@ } } + window.focusEditor = () => document.querySelector('.CodeMirror textarea').focus(); window.xemitter = emitter; emitter.on('DOMContentLoaded', function () { @@ -47417,6 +47418,7 @@ repl.eval(code, (string, err) => { editor.flashCode() + editor.setValue(code); if (!err) sketches.saveLocally(code) }) }); @@ -47616,8 +47618,20 @@ // TODO: copy + let searchIsVisible = false; emitter.on('gallery:search', () => { + if (searchIsVisible) { + document.body.removeChild(document.getElementById('autocompleteList')); + document.body.removeChild(document.getElementById('autocompleteInput')); + searchIsVisible = false; + window.focusEditor(); + return; + } else { + searchIsVisible = true; + } + const autocompleteInput = document.createElement("input"); + autocompleteInput.id = 'autocompleteInput'; autocompleteInput.setAttribute("list", "autocompleteList"); autocompleteInput.type = "text"; autocompleteInput.style = "z-index:100; position: absolute; top: 20%; margin: auto; left: 0; right: 0; width: 50%;" @@ -47655,6 +47669,16 @@ document.body.removeChild(autocompleteInput); document.body.removeChild(autocompleteList); + searchIsVisible = false; + window.focusEditor(); + }); + autocompleteInput.addEventListener('keyup', (evt) => { + if (evt.key === 'Escape') { + document.body.removeChild(autocompleteInput); + document.body.removeChild(autocompleteList); + searchIsVisible = false; + window.focusEditor(); + } }); }) @@ -47705,26 +47729,27 @@ "hide-info": "hide info window" }, info: { - title: 'hydra', - subtitle: 'live coding video synth', - description: 'Hydra is live code-able video synth and coding environment that runs directly in the browser. It is free and open-source and made for beginners and experts alike.', + title: 'hydra(lisk)', + subtitle: 'live coding video synth - v2', + description: 'Hydra is live code-able video synth and coding environment that runs directly in the browser. It is free and open-source and made for beginners and experts alike.\nHydralisk is a proprietary fork, with added features.', 'get-started-title': 'To get started:', 'get-started-list': [ 'Close this window', - 'Change some numbers', - 'Type Ctrl + Shift + Enter' + 'Go to https://hydra.ojack.xyz - and learn the basics.', + 'Come back, and play with the advanced features!' ], - 'description-detailed': 'Hydra is written in JavaScript and compiles to WebGL under the hood. The syntax is inspired by analog modular synthesis, in which chaining or patching a set of transformations together generates a visual result.', - 'uses': 'Hydra can be used:', + 'description-detailed': 'The core usecase for hydralisk is to extend functionality towards more stage-playability, with a few performance features and helpers.', + 'uses': 'Here are the extra added hotkeys as of now:', 'uses-list': [ - 'to mix and add effects to camera feeds, screenshares, live streams, and videos', - 'to create generative and audio-reactive visuals, and share them online with others', - 'in combination with other javascript libraries such as P5.js, Tone.js, THREE.js, or gibber', - 'to add interactive video effects to a website', - 'to experiment with and learn about video feedback, fractals, and pixel operations', - 'to stream video between browsers and live-jam with others online' + 'CTRL+Shift+(0/1/2/3/4/5) => (disable/1x/2x/4x/8x/16x) automutate mode. 1x corresoponds to 1x per beat. 16x corresponds to 1x per 16 beat (4 bars)', + 'CTRL+Shift+X => toggle manual automutate mode', + 'CMD+[ => Jump back 1 (jumps back 1 in the autosave history, which is 10 automutates)', + 'CMD+Shift+[ => Jump back 5 (jumps back 5 in the autosave history, which is 50 automutates)', + 'CMD+S => Execute and quick save', + 'CMD+L => Quickload (jump back to the quicksaved version)', + 'CTRL+Shift+C => Toggle search by name' ], - 'author': 'Created by olivia.', + 'author': 'Created by olivia., tuned by Alex', 'more-info': 'For more information and instructions, see: the interactive documentation, a list of hydra functions, the community database of projects and tutorials, a gallery of user-generated sketches, and the source code on github,', 'more-info-forums': 'There is also an active Discord server and facebook group for hydra users+contributors.',