Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

q5-dom.js implementation #35

Open
quinton-ashley opened this issue May 31, 2024 · 0 comments
Open

q5-dom.js implementation #35

quinton-ashley opened this issue May 31, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@quinton-ashley
Copy link
Collaborator

quinton-ashley commented May 31, 2024

My main gripe with the p5.dom API is that the function based, chainable style is so Java coded. I can see how it was useful to help Java developers do web development back in 2014. But now vanilla JavaScript APIs and features like CSS3 flex make editing the dom just as easy.

For example, is using the p5.Element.style function actually better than setting the style props in JS? or just abstraction for the sake of Java-style abstraction that doesn't give beginners the tools to do stuff outside of the p5 ecosystem?

Why insist users do this:

p = createP();
p.style('color', 'deeppink');

instead of this:

p = createElement('p');
p.style.color = 'deeppink';

I'm going to implement a stripped down version of p5-dom in q5. Q5.Element will extend HTMLElement with some helpful getters and setters for x,y positioning, the draggable function, and hide/show functions.

Could be nice to offer a createFlexBox function too.

@quinton-ashley quinton-ashley added enhancement New feature or request help wanted Extra attention is needed labels Jun 2, 2024
@quinton-ashley quinton-ashley moved this to Todo in q5 Dec 9, 2024
@quinton-ashley quinton-ashley added this to q5 Dec 9, 2024
@quinton-ashley quinton-ashley removed the help wanted Extra attention is needed label Dec 11, 2024
@quinton-ashley quinton-ashley moved this from Todo to In Progress in q5 Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

1 participant