adobe-webplatform / css-shapes-editor Goto Github PK
View Code? Open in Web Editor NEWStandalone in-browser editor for CSS Shapes.
License: Other
Standalone in-browser editor for CSS Shapes.
License: Other
Right now, ref box computation assumes box-sizing is the browser default, content-box;
This fails: polygon(0 0, 800px 400px, 0 400px)
This works: polygon(nonzero, 0 0, 800px 400px, 0 400px)
Replaces old rectangle() shape fn
all shapes
circle
ellipse
// TBD
'closest-side', 'farthest-side' for shape-radius
CSSUtils.getContentBoxOf(): there’s a TODO here about not handling cases other than content-box. Will that affect anything?
Editor.setupEditorHolder(): the way it calls itself back is a bit confusing - it seems like it would be clearer to just reverse the condition (i.e. if (!this.holder), create the element, and then do the other stuff after the if).
Editor.setupShapeDecoration(): the check for whether the path isn't already an array could just be !Array.isArray(path)
, I think.
Editor.turnOnFreeTransform()/turnOffFreeTransform(): could just reverse the conditions
PolygonEditor/CircleEditor/EllipseEditor.setup(): it looks like the event listeners added at the end of these functions are never removed.
PolygonEditor.inferShapeFromElement(): there’s a TODO here about not dealing with non-px units - is that a potential problem (e.g. might people want to use shapes for boxes that are sized in ems/rems)?
PolygonEditor.onMouseDown(): when checking the vertex index, don’t need to parseInt() since you’ve already determined that the type is “number” (similar code you have later doesn’t do the parseInt())
EllipseEditor.parseShape(): there’s a TODO here for handling centers other than the default 50% 50% - is that something we’ll be likely to encounter?
Right now, the editor will spawn its own holder container which is 100% and maximum z-index.
Because of this we can't have 2 shapes editors active and interactive at the same time on the same page (one overlaps the other).
Currently naively assuming center in 50% 50%
Consolidate compute method into CSSUtils for use by circle()
Acceptance tests:
Right now, border radius has no effect when computing the ref box.
Code assumes box-sizing: content-box
. Should check for and support box-sizing: border-box
.
call .draw() on turn off.
The shape editor should remain property-agnostic. A default reference box should be provided considering the property it will be will be used with.
Default reference box is margin-box
, to suit match default for shape-outside
For clip-path
it should be border-box
For shape-inside
it is yet to be defined, currently content-box
Ever since upgrading to Brackets 1.1, I had been having issues with the Brackets Live Preview where Chrome would launch but then lose the connection. I kept getting the message “Live Preview cancelled for unknown reason {(0)}”.
After a bit of trial and error—removing all extensions and adding them back in on-by-one—it turned out to be Adobe’s CSS Shapes Editor for Brackets extension that was causing the issues. I removed that and everything works fine again.
this.holder.style['background-image'] = "-webkit-linear-gradient(45deg, rgba(0,0,0,0.1) 25%, transparent 25%,transparent 75%, rgba(0,0,0,0.1) 75%, rgba(0,0,0,0.1) 100%), -webkit-linear-gradient(45deg, rgba(0,0,0,0.1) 25%, transparent 25%,transparent 75%, rgba(0,0,0,0.1) 75%, rgba(0,0,0,0.1) 100%)";
this.holder.style['background-size'] = "10px 10px";
this.holder.style['background-position'] = "0 0, 5px 5px";
TODO: sync with a snap-to-grid behavior
What would be involved with creating an editor for the d
attribute of the path
tag?
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.