feat: Minimal working p5/CoffeeScript setup
This commit is contained in:
parent
d94c749830
commit
63dfa62ffd
6 changed files with 109248 additions and 1 deletions
17
lib/loadp5.js
Normal file
17
lib/loadp5.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
export var p5;
|
||||
export var p5loaded = new Promise(async function(resolve, reject) {
|
||||
var success = false;
|
||||
try {
|
||||
p5 = await import('https://cdn.jsdelivr.net/npm/p5/lib/p5.js');
|
||||
console.log('CDN import of p5 OK');
|
||||
success = true; }
|
||||
catch(err) {
|
||||
console.log('CDN import of p5 failed: ' + JSON.stringify(err));
|
||||
try {
|
||||
p5 = await import('./p5.js');
|
||||
success = true; }
|
||||
catch {}
|
||||
console.log('Used local fallback for p5'); }
|
||||
p5 = window.p5;
|
||||
delete window.p5;
|
||||
if (success) { resolve(); } else { reject(); }});
|
109185
lib/p5.js
Normal file
109185
lib/p5.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue