Skip to content

p5.dom CSS transforms #389

Closed
Closed
@shiffman

Description

@shiffman

I'm working on a set of examples for the "a to z" class at ITP and am doing a lot of CSS transformations on divs. This results in writing lots of awkward code like.

var div = createDiv('text');
div.style('transform','translate(' + x + 'px) rotate('+angle+'deg)');

I think it might be nice to have:

div.translate(x,y);
div.rotate(angle);

This would also help deal with the fact that for cross-browser compatibility I should really be doing multiple calls to:

-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg); 
transform: rotate(45deg);

Not to mention all my values are in radians so there's another set of conversion happening in my code.

I'd be happy to work on wrapping all this up nicely. Thoughts on usefulness? (Also I have to admit that I'm on about day 2 of working with CSS transforms so I don't really know what I'm talking about.)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions