176 points · by gotchange · 11y ago · 40 comments
However, let's not lose focus of the fact that while it's fun to watch them, you really cannot spend these internet points we earn here.
And the whole github profile is pretty nice, I gotta say. Nothing special, but inspiring somehow.
https://github.com/lalwanivikas/image-editor
It's not exactly an editor as the original image is not 'edited'. I don't know why I decided to call it that :) Filter is the right term.
http://www.sitepoint.com/build-simple-image-editor-with-css-...
Thanks for checking it out :)
Too bad there's no IE support, but defaulting to a regular image isn't a big deal.
Instead of polluting the CSS namespace, it's much more apt to use a data-instafilter="[val]" property.
Personally, I hate moving/changing/adding classes with Javascript. classList is hacky. Stuff like this is exactly what data-attributes are for. [0]
img.dataset.filter // "instagram filter type"
The CSS would need slight changes, accordingly: img[data-filter="filter_type"] { /* styles */ }
[0] https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Usin...Surely the common setting for this to be applied is in a web page where the author/photographer/designer has already selected a fixed filter and the visitor is just looking at it applied. A UI allowing someone to toggle or select filters on an image is the exceptional case here.
The data attributes almost seem to be a way to invoke CSS styles as functions themselves.
I am still unclear, though, how you draw the line, in general, between things that belong in dataset and things that belong in standard classes?
How so? I don't think that it's in anyway hackier than its sister dataset.
...in what way?