Skip to content

Commit

Permalink
fix visualizers for static vsa
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Apr 29, 2024
1 parent bac843d commit 03d2653
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions editor/visualizers/effects/VSAEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export default class VSAEffect {
async setURL(url) {
try {
const u = new URL(url, window.location.href);
if (u.hostname !== window.location.hostname && u.hostname !== 'www.vertexshaderart.com') {
if (u.hostname !== window.location.hostname && u.hostname !== 'www.vertexshaderart.com' && u.hostname !== 'vertexshaderart.com') {
return;
}
if (url === this.currentUrl) {
Expand All @@ -305,7 +305,10 @@ export default class VSAEffect {
this.currentUrl = this.pendingUrl;
this.pendingUrl = undefined;
this.compiling = true;
const req = await fetch(`${url}?format=json`);
const mungedUrl = url.includes('vertexshaderart.com')
? `${url.replace('//www.', '//')}/art.json`
: url;
const req = await fetch(mungedUrl);
const vsa = await req.json();
const gl = this.gl;
const vs = applyTemplateToShader(vsa.settings.shader);
Expand Down

0 comments on commit 03d2653

Please sign in to comment.