4 ms·
RulersGuides.js - Photoshop-like rulers and guides
- pfortuny 13y agoIf you add some kind of "snap to DOM" ability or whatever, so that the rulers align with "places" already "defined" by the DOM+CSS, it might even be better. But it may not, obviosly.
- leeoniya 13y agoi actually have something like this already made (with guides and all) that i've been dragging my feet (no pun intended) to open source since it's a bit rough around the edges. i'll put it up in the next week or so. feel free to watch the repo in the likely case it'll not make it to the front page. https://github.com/leeoniya/snapDOM.js https://github.com/leeoniya/snapDOM.js
- markrolich 13y agoI've added that as an experimental feature
- cheeaun 13y agoI think the rulers also need to be position:fixed
- mrbeardy 13y agoThat wouldn't help when dealing with content that goes beyond the fold though.
- diggan 13y agoSo the solution would be an option to have it fixed or not.
- brandonbloom 13y agoMost of the time, adding an option (particularly toggled modes) is a design failure. A much better solution would be to have the ruler be fixed to the border, but scroll along its axis.
- diggan 13y agoYou're telling me it's a design failure to give a choice when you're not giving explanations about why fixed would be better. The word "better" isn't a reason.
- Kiro 13y agoAm I the only one who thinks the vertical lines should be triggered when you click the top ruler and vice versa? Now it's the other way around and it feels counterintuitive.
- lewispollard 13y agoThought the same, you're likely to click the point on the ruler that you want the guide to appear at.
- addandsubtract 13y agoPhotoshop has been using the drag&drop method for the last 15 years, so I've gotten used to it. I can see your reason behind wanting to click a point on the scale, but adjusting the guide would require you to drag it orthogonal again anyway.
- lewispollard 13y agoYeah, after working it out it did feel quite natural - just my first instinct was to click a point
- akx 13y agoIt's the way Photoshop (and the rest of Adobe's suite) has done it for ages and it's intuitive in the sense that you're creating something of a copy of that ruler and its alignment.
- awjr 13y agoThis brings back that sinking feeling when a client gets out the ruler and holds it up to their screen and then down to the printout the designer gave to them. shudder
- JoelAnair 13y agoneat.
- gurujust1n 13y agoI have been looking for something like this for a while.
- HeyItsJames 13y agoMy coworker was looking for something like this a few days ago, and we gave up on our search. This is awesome. He's a front-end developer and nearly cried tears of joy when I showed this to him. Thank you from one small dev shop!
- RokStdy 13y agoThis is really superb! I really like the functionality, this is very impressive.