florian-rieder / gutenbergp5 Goto Github PK
View Code? Open in Web Editor NEWA simple p5.js block for Wordpress
A simple p5.js block for Wordpress
Hello! I am trying to use this plugin (v1.1.1) in WordPress 6.5.2. I didn't notice any complaints when I installed it. Most of my site is built using Divi, but I started a new page that uses the default block editor (Gutenburg I assume). I am able to add a p5.js block. Even with the simplest sketch, I get a spinning wheel on the page. Any suggestions on how to resolve?
See my demo page here: https://planyukon.ca/easy-p5-demo/.
Hi! Thanks for making this elegant plugin.
I just tried it out and noticed my post got tagged with a bunch of random color hexcodes? I didn't add them myself, so I can only assume they were added by the plugin.
It's a nifty feature, but is there a way to disable it?
Hi Florian,
Thanks for sharing your webpages and for your help with the p5 plugin for Wordpress the other week.
I've put my p5 code into a module, then saved to Divi, saved it in my divi module library. It works in a demo, but I'm hoping to drop the module into many pages, and have the code get the URL, parse it, then use that information for a page-specific graphic. I've been able to write javescript that can get the URL and parse it in a Divi code module, but this code doesn't seem to work within your Easy p5 plugin.
Do you know of a way to have this functionality within your plugin?
The code is this:
let currentUrl = window.location.href;
//print ("URL: "+ currentUrl);
if (currentUrl.includes("north")) {
region = "North Yukon";
let urlArray = currentUrl.split("-");
let urlEnd = urlArray[2];
// document.writeln(urlEnd);
// document.write("
");
lmu = urlEnd.slice(0,-1);
} else if (currentUrl.includes("peel")) {
region = "Peel Watershed";
let urlArray = currentUrl.split("-");
let urlEnd = urlArray[2];
// document.writeln(urlEnd);
// document.write("
");
lmu = urlEnd.slice(0,-1);
} else if (currentUrl.includes("dawson")) {
region = "Dawson";
let urlArray = currentUrl.split("/");
let urlEnd = urlArray[3];
// document.writeln(urlEnd);
// document.write("
");
lmu = urlEnd.slice(3);
} else {
region = "No data";
lmu = -1;
}
Thanks again!
Sam
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.