mirror of
https://github.com/hydra-synth/hydra.git
synced 2025-12-05 14:30:03 +01:00
updated dev
This commit is contained in:
@@ -3,6 +3,13 @@
|
|||||||
- updated code editor to cm6
|
- updated code editor to cm6
|
||||||
- still not working: dice button
|
- still not working: dice button
|
||||||
|
|
||||||
|
# [1.5.3] - 2023 - 02 - 19
|
||||||
|
- fixed error reporting
|
||||||
|
- removed devtools
|
||||||
|
|
||||||
|
# [1.5.2] - 2023 - 02 - 10
|
||||||
|
- updated upload text, removed default
|
||||||
|
|
||||||
# [1.5.1] - 2023 - 07 - 19
|
# [1.5.1] - 2023 - 07 - 19
|
||||||
## Added
|
## Added
|
||||||
- extension loader
|
- extension loader
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
BIN
dist/images/hydra-landing.png
vendored
Normal file
BIN
dist/images/hydra-landing.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
8
dist/index.html
vendored
8
dist/index.html
vendored
@@ -7,13 +7,13 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta property="og:title" content="HYDRA">
|
<meta property="og:title" content="HYDRA">
|
||||||
<meta property="og:description" content="live coding networked visuals in the browser">
|
<meta property="og:description" content="live coding networked visuals in the browser">
|
||||||
<meta property="og:image" content="https://cdn.glitch.com/9c3a06ab-0731-42ca-a1a3-3a249825d08f%2FScreen%20Shot%202018-06-24%20at%204.47.49%20PM.png?1531889983803">
|
<meta property="og:image" content="/images/hydra-landing.png">
|
||||||
<meta property="og:url" content="https://hydra.ojack.xyz">
|
<meta property="og:url" content="https://hydra.ojack.xyz">
|
||||||
<meta name="twitter:title" content="HYDRA">
|
<meta name="twitter:title" content="HYDRA">
|
||||||
<meta name="twitter:description" content="live coding networked visuals in the browser">
|
<meta name="twitter:description" content="live coding networked visuals in the browser">
|
||||||
<meta name="twitter:image" content="https://cdn.glitch.com/9c3a06ab-0731-42ca-a1a3-3a249825d08f%2FScreen%20Shot%202018-06-24%20at%204.47.49%20PM.png?1531889983803">
|
<meta name="twitter:image" content="/images/hydra-landing.png">
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<script src="https://unpkg.com/hydra-synth"></script>
|
<script src="https://cdn.jsdelivr.net/npm/hydra-synth/dist/hydra-synth.js"></script>
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.min.js" defer></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.min.js" defer></script>
|
||||||
<!-- <script src="./bundle.js?1.2wsdajk" defer></script> -->
|
<!-- <script src="./bundle.js?1.2wsdajk" defer></script> -->
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<link rel="stylesheet" href="./css/modal.css">
|
<link rel="stylesheet" href="./css/modal.css">
|
||||||
<link rel="shortcut icon" type="image/png" href="https://cdn.glitch.com/597fe374-3d18-46a5-b99c-ceff1f8ffd79%2Ffavicon.png?1530891352785" />
|
<link rel="shortcut icon" type="image/png" href="https://cdn.glitch.com/597fe374-3d18-46a5-b99c-ceff1f8ffd79%2Ffavicon.png?1530891352785" />
|
||||||
|
|
||||||
<script type="module" crossorigin src="./assets/index-3e7f6eb3.js"></script>
|
<script type="module" crossorigin src="./assets/index-e814b025.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta property="og:title" content="HYDRA">
|
<meta property="og:title" content="HYDRA">
|
||||||
<meta property="og:description" content="live coding networked visuals in the browser">
|
<meta property="og:description" content="live coding networked visuals in the browser">
|
||||||
<meta property="og:image" content="https://cdn.glitch.com/9c3a06ab-0731-42ca-a1a3-3a249825d08f%2FScreen%20Shot%202018-06-24%20at%204.47.49%20PM.png?1531889983803">
|
<meta property="og:image" content="/images/hydra-landing.png">
|
||||||
<meta property="og:url" content="https://hydra.ojack.xyz">
|
<meta property="og:url" content="https://hydra.ojack.xyz">
|
||||||
<meta name="twitter:title" content="HYDRA">
|
<meta name="twitter:title" content="HYDRA">
|
||||||
<meta name="twitter:description" content="live coding networked visuals in the browser">
|
<meta name="twitter:description" content="live coding networked visuals in the browser">
|
||||||
<meta name="twitter:image" content="https://cdn.glitch.com/9c3a06ab-0731-42ca-a1a3-3a249825d08f%2FScreen%20Shot%202018-06-24%20at%204.47.49%20PM.png?1531889983803">
|
<meta name="twitter:image" content="/images/hydra-landing.png">
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<script src="https://unpkg.com/hydra-synth"></script>
|
<script src="https://cdn.jsdelivr.net/npm/hydra-synth/dist/hydra-synth.js"></script>
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.min.js" defer></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.min.js" defer></script>
|
||||||
<!-- <script src="./bundle.js?1.2wsdajk" defer></script> -->
|
<!-- <script src="./bundle.js?1.2wsdajk" defer></script> -->
|
||||||
|
|||||||
2
index.js
2
index.js
@@ -9,7 +9,7 @@ import galleryStore from './src/stores/gallery-store.js'
|
|||||||
import mainView from './src/views/main.js'
|
import mainView from './src/views/main.js'
|
||||||
|
|
||||||
const app = choo()
|
const app = choo()
|
||||||
app.use(devtools())
|
// app.use(devtools())
|
||||||
app.use(store)
|
app.use(store)
|
||||||
app.use(editorStore)
|
app.use(editorStore)
|
||||||
app.use(galleryStore)
|
app.use(galleryStore)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydra-web-editor",
|
"name": "hydra-web-editor",
|
||||||
"version": "1.5.1",
|
"version": "1.5.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
BIN
public/images/hydra-landing.png
Normal file
BIN
public/images/hydra-landing.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
@@ -71,13 +71,15 @@ function showConfirmation(successCallback, terminateCallback) {
|
|||||||
HYDRA SKETCH GALLERY
|
HYDRA SKETCH GALLERY
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
|
||||||
🎨 Click 'OK' to add your sketch and screenshot to the gallery of hydra sketches at https://botsin.space/@hydra.
|
🎨 Add your sketch to the gallery of hydra sketches at https://botsin.space/@hydra.
|
||||||
|
|
||||||
|
✍️ Type your name, mastodon handle, or a short description below, and then press 'OK' to share.
|
||||||
|
|
||||||
‼️ Make sure you are ready to share - there is no undo button!
|
‼️ Make sure you are ready to share - there is no undo button!
|
||||||
|
|
||||||
💖 Thank you for sharing! You are also warmly invited to join the the live coding server on the fediverse at https://social.toplap.org/.
|
💖 Thank you for sharing! You are also warmly invited to join the the live coding server on the fediverse at https://social.toplap.org/.
|
||||||
`
|
`
|
||||||
, 'your name, mastodon handle, and/or a short description')
|
, '')
|
||||||
|
|
||||||
// console.log('confirm value', c)
|
// console.log('confirm value', c)
|
||||||
if (c !== null) {
|
if (c !== null) {
|
||||||
|
|||||||
22
src/stores/repl-v2.js
Normal file
22
src/stores/repl-v2.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
export default {
|
||||||
|
eval: (arg, callback = () => {}) => {
|
||||||
|
const info = {
|
||||||
|
isError: false,
|
||||||
|
codeString: '',
|
||||||
|
errorMessage: ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// wrap everything in an async function
|
||||||
|
var jsString = `(async() => {
|
||||||
|
${arg}
|
||||||
|
})().catch(${(err) => { window._reportError(err) }})`
|
||||||
|
try {
|
||||||
|
window.eval(jsString)
|
||||||
|
} catch (err) {
|
||||||
|
info.errorMessage = err.message
|
||||||
|
}
|
||||||
|
info.codeString = jsString
|
||||||
|
if (info.errorMessage.length > 0) info.isError = true
|
||||||
|
callback(info)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,22 @@
|
|||||||
import repl from '../views/editor/repl.js'
|
import repl from './repl-v2.js'
|
||||||
// console.log('ENVIRONMENT IS', process.env.NODE_ENV)
|
// console.log('ENVIRONMENT IS', process.env.NODE_ENV)
|
||||||
|
|
||||||
export default function store(state, emitter) {
|
export default function store(state, emitter) {
|
||||||
state.showInfo = false
|
state.showInfo = false
|
||||||
state.showUI = true
|
state.showUI = true
|
||||||
state.showExtensions = false
|
state.showExtensions = false
|
||||||
|
state.errorMessage = ''
|
||||||
|
state.isError = false
|
||||||
|
|
||||||
// if backend gallery endpoint supplied, then enable gallery functionality
|
// if backend gallery endpoint supplied, then enable gallery functionality
|
||||||
const SERVER_URL = import.meta.env.VITE_SERVER_URL
|
const SERVER_URL = import.meta.env.VITE_SERVER_URL
|
||||||
state.serverURL = SERVER_URL !== undefined ? SERVER_URL : null
|
state.serverURL = SERVER_URL !== undefined ? SERVER_URL : null
|
||||||
|
|
||||||
|
window._reportError = (err) => {
|
||||||
|
state.errorMessage = err.message
|
||||||
|
state.isError = true
|
||||||
|
emitter.emit('render')
|
||||||
|
}
|
||||||
|
|
||||||
emitter.on('load and eval code', (code, shouldUpdateURL = true) => {
|
emitter.on('load and eval code', (code, shouldUpdateURL = true) => {
|
||||||
emitter.emit('editor: load code', code)
|
emitter.emit('editor: load code', code)
|
||||||
@@ -18,7 +25,13 @@ export default function store(state, emitter) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
emitter.on('repl: eval', (code = '', callback) => {
|
emitter.on('repl: eval', (code = '', callback) => {
|
||||||
repl.eval(code, callback)
|
repl.eval(code, (info) => {
|
||||||
|
state.errorMessage = info.errorMessage
|
||||||
|
state.isError = info.isError
|
||||||
|
if(callback) callback(info.codeString, info.isError)
|
||||||
|
emitter.emit('render')
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
emitter.on('screencap', () => {
|
emitter.on('screencap', () => {
|
||||||
|
|||||||
@@ -27,11 +27,13 @@ export default class Editor extends Component {
|
|||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this.textEl.style.opacity = 0
|
this.textEl.style.opacity = 0
|
||||||
|
this.logElement.style.display = 'none'
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this.textEl.style.opacity = 1
|
this.textEl.style.opacity = 1
|
||||||
this.textEl.style.pointerEvents = 'all'
|
this.textEl.style.pointerEvents = 'all'
|
||||||
|
this.logElement.style.display = 'block'
|
||||||
}
|
}
|
||||||
|
|
||||||
update (state) {
|
update (state) {
|
||||||
@@ -40,6 +42,10 @@ export default class Editor extends Component {
|
|||||||
} else {
|
} else {
|
||||||
this.show()
|
this.show()
|
||||||
}
|
}
|
||||||
|
const msg = state.errorMessage
|
||||||
|
const className = state.isError ? 'log-error' : ''
|
||||||
|
console.log('UPDATING LOG updating state', state)
|
||||||
|
this.logElement.innerHTML = ` >> <span class=${className}> ${msg} </span> `
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,11 +27,13 @@ export default class Editor extends Component {
|
|||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this.innerText.style.opacity = 0
|
this.innerText.style.opacity = 0
|
||||||
|
this.logElement.style.opacity = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this.innerText.style.opacity = 1
|
this.innerText.style.opacity = 1
|
||||||
this.innerText.style.pointerEvents = 'all'
|
this.innerText.style.pointerEvents = 'all'
|
||||||
|
this.logElement.style.opacity = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
update (state) {
|
update (state) {
|
||||||
@@ -40,6 +42,9 @@ export default class Editor extends Component {
|
|||||||
} else {
|
} else {
|
||||||
this.show()
|
this.show()
|
||||||
}
|
}
|
||||||
|
const msg = state.errorMessage
|
||||||
|
const className = state.isError ? 'log-error' : ''
|
||||||
|
this.logElement.innerHTML = ` >> <span class=${className}> ${msg} </span> `
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user