Skip to content

Commit 03d2653

Browse files
committed
fix visualizers for static vsa
1 parent bac843d commit 03d2653

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: editor/visualizers/effects/VSAEffect.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export default class VSAEffect {
286286
async setURL(url) {
287287
try {
288288
const u = new URL(url, window.location.href);
289-
if (u.hostname !== window.location.hostname && u.hostname !== 'www.vertexshaderart.com') {
289+
if (u.hostname !== window.location.hostname && u.hostname !== 'www.vertexshaderart.com' && u.hostname !== 'vertexshaderart.com') {
290290
return;
291291
}
292292
if (url === this.currentUrl) {
@@ -305,7 +305,10 @@ export default class VSAEffect {
305305
this.currentUrl = this.pendingUrl;
306306
this.pendingUrl = undefined;
307307
this.compiling = true;
308-
const req = await fetch(`${url}?format=json`);
308+
const mungedUrl = url.includes('vertexshaderart.com')
309+
? `${url.replace('//www.', '//')}/art.json`
310+
: url;
311+
const req = await fetch(mungedUrl);
309312
const vsa = await req.json();
310313
const gl = this.gl;
311314
const vs = applyTemplateToShader(vsa.settings.shader);

0 commit comments

Comments
 (0)