Review my weekend HTML5 project: DropMocks (dropmocks.com)

241 points by gmurphy ↗ HN
I had an itch to scratch around making it easy to share sets of images with other designers and thought that I could use the new drag and drop file support to solve it. DropMocks was the result after a quick weekend of hacking.

It's built on an App Engine backend, and the uploader relies on the PushState and the File API from HTML5, so it only currently works in Chrome 6 and Firefox 4*; supporting other browsers would be the first post-hack step if I were to take it further.

An example gallery can be found here: http://www.dropmocks.com/mSER

114 comments

[ 803 ms ] story [ 3728 ms ] thread
I would love to see this integrated via an API into other sites, as it is definitely the fastest/cleanest image uploading & gallery I've seen to date. Some probably obvious suggestions: different views, display filesize/type info when mousing over an image, zoom in/zoom out, paid-users could have subdomains and gallery names instead of dropmocks.com/XXXX, etc. I envy your sweet design skills and attention to detail in the implementation (left/right/up/down keys work to go through the gallery, nice!). I would imagine you're aware, but be warned that trying to profitably monetize an image hosting site will be hard. Take a look into the guy who started imgur (mrgrim -- http://www.reddit.com/user/MrGrim) for useful insights on image hosting (assuming that's the route you're looking to take, and not a "YouTube Instant job offer").
Looks great
Wow, I have to say, that's pretty nice. It doesn't like me trying to drag images around that are already there. I expected it to let me re-order them.

But for a 'weekend' project, that's pretty impressive.

I was able to re-order mine. The UX isn't obvious that you can, but it works just the way I thought it would by drag-and-drop.
When I try to drag existing images, I get an error that (long string of characters) is not a valid image.
I like this a lot. Works perfect in FF 3.6.3 (as it should) I too expected to be able to drag them around, It would be nice if I could just arrange them on the page like some of the css3 polaroid galleries you see. I will defiantly be using this.
Please add Safari 5 to the browser sniffer. (It works fine if I change the User-Agent to "Chrome 6", so presumably it should be included in the list of browsers that you support.)
Ditto for Chromium
(comment deleted)
Safari 5, at least on Windows, doesn't support the File and FileReader APIs which are necessary for the drag and drop uploader. If you've seen otherwise, please let me know (I love the Safari team, and don't want to be unfair to them).

Nightly WebKit builds may work.

On the Mac, it works fine.
I love this, the drag especially, i've never seen the "just drag" file upload thing before without flash/java. It'd be really nice to see a drag file upload replace the typical file form input.

Excellent job.

Gmail had it for almost a year.
Gmail uses Flash (Adblock shows block Flash thingie).

----

Edit: upon further inspection, it seems Gmail indeed does use Flash [1], just for a different part of the upload process (progress bar?).

Drag and drop is only supported in Chrome and Firefox [2], so I suppose this is HTML5.

[1] https://mail.google.com/mail/uploader/uploaderapi2.swf

[2] http://gmailblog.blogspot.com/2010/04/drag-and-drop-attachme...

I don't think so. Maybe it falls back to flash on some browsers, but it works just fine on Chrome with flashblock enabled.
(comment deleted)
Fucking brilliant! I'd love to hack on this... are you using app engine? Is it open source?

In particular, you know what would make this rock*10^6? facebook/dropbox integration.

I would very much like to have this auto-pull from Dropbox folders; it is something for another weekend.

I just posted the source: http://github.com/glenmurphy/dropmocks

Auto-pull, auto-push, etc.

Also, to my phone. When I take a picture on my phone, I want it to sync to a dropbox folder.

Also, with facebook. I want each of my picture galleries to sync with a mock (and, optionally, to a dropbox).

Let's say a mock is synced with both dropbox and facebook. Then adding a file to the folder locally on a machine, it should push to mock, then from mock to facebook.

Bah, instead of running my own app instance, do you mind if I make a Chrome extension on top of it, and you can push the code you like back into the running version?

Meta-question: if a Chrome extension uses significant server-side resources, should one ask the site host first? (legally, I think the answer is "no")

I haven't said wow since Etherpad , I believe. Wow.
Love it! Nice work.

What did you write it in?

(comment deleted)
What happens if this becomes wildly popular among casual computer users who want to share pics with their friends? Any plans on how to monetize it?
I didn't realize submission text would be eaten for external links, so here it is:

I had an itch to scratch around making it easy to share sets of images with other designers and thought that I could use the new drag and drop file support to solve it. DropMocks was the result after a quick weekend of hacking.

It's built on a simple Python App Engine backend, and the uploader relies on the PushState, File, and FileReader APIs (I realize that some of these aren't strictly HTML5), so uploads currently only work in Chrome 6+ and Firefox 3.6+; supporting other browsers would be the first post-hack step if I were to take it further.

An example gallery can be found here, it should be viewable in all modern browsers: http://www.dropmocks.com/mSER

This is awesome. I've been looking for something similar. Quickly add a bit more functionality (photo resize, link it to twitter, add comments, etc...) before other sites copy your idea.
didnt pass my browser sniffer, firefox 3.6 on ubuntu, but I know that supports drag and drop uploads, I wrote an image uploader the other week http://dropup.net/
That's strange - my Firefox 3.6.6 on Ubuntu works with it OK. I wonder if the browser detect script I'm using is having issues, as another poster said that Chromium was failing, where it doesn't on my machines :\

Cool domain name; wish I'd thought of something that short.

FYI, WebKit-based browsers aren't passing your browser sniffer (drag-drop works in them, too).
this is pretty cool too, i'm gonna try it.
Love the concept.

Your shadows look very odd with the very horizontal screenshots I dragged in to test it.

The images left and right of the current one distract from what should be the focus. Doesn't work well for sharing small image files.
Amazing idea and execution. Great work.
I'd pay you $24 a year (what i currently give to flikr) if you can compress my large jpg images into something smaller (currently it seems to be maxed at 900k) another one of my favorite features of Flikr is the ability to view exif data.

Love the project!

I'd also pay, with one pony request: the ability to brand the experience so that I had my company's logo in the bottom right (for example) and URL mapping (perhaps just to a subdomain).
A jpeg image is already compressed. Unfortunately, you won't be able to go much smaller without choosing to lose data.
Would you be OK with resizing? App Engine has a 1MB limit, and I could get around that by splitting the file on the client, but I could also just do a resize in JS with canvas/ImageData.
You should probably be using the Blobstore API if you are not already.

http://code.google.com/appengine/docs/python/blobstore/overv...

It takes a bit more work but you could store the original file since it has a 2GB limit. You can only fetch 1MB at a time but it should still be doable.

Another option is to use boto to pass the upload along to S3 and just store the link path in app engine.
Very great! Love the easy way to use it without having to log in to try. Simple approach. Keep working on the idea.
How are you determining which browsers are compatible with it? It seems like the best way might be to use modernizr: http://www.modernizr.com/. Or are you using more than just the html5 drag and drop API?
Looking at the code you just posted it looks like this is what you did:

// HAMLET HAMLET HAMLET

function isValidBrowser() {

  var browser = BrowserDetect.browser;
  var version = BrowserDetect.version;

  return (
    (browser == 'Chrome' && version >= 6) ||
    (browser == 'Firefox' && version >= 3.6)
  );
}
Yep; I realize this is usually taken to be poor form, though I'm no idealist - I did it while the APIs I was using were in flux (I flipped through a few upload techniques), and focused on getting it working right in a few before expanding to the many.
Makes total sense. It looks great by the way.
My pictures were too big. > 900k.
I loved it. My only suggestion is making the non-focused images slightly opaque. I was left wondering if the severely blurred images were loading.
Amazing, great user experience. One detail though, wouldn't it be nice to have less blur on the thumbnails?
Never have I been so forehead-smacking jealous that I didn't think of something first. kudos.
Very nice visually, and incredibly slick workflow, though it renders pretty slowly at full size. Poking in the code... are you blurring the images in JS at every level? Since you're using webkit + mozilla + IE specific CSS, why not use CSS transforms to do the same thing, but with hardware acceleration? I haven't done it myself, but I'd assume blur is one of the filters possible, and I know you can do those transitions.

edit: oh, and you might want to make sure the images in the "back" are (proportionally?) smaller than the ones in front - if you shrink your window a lot they're actually bigger.

edit 2:

Gets stuck occasionally, though so far only while loading, and doesn't seem to respond to any interaction. The drop-down still works though, so it appears it's not just spinning.

Anyone else, and/or any info I can provide to get you info on why?

Blur is only possible in IE with filter:blur (and I use it if available) - I've been bugging people to add CSS blur to WebKit :)
Yeah, if it's not in there, it seems like a rather large oversight. Blur is ridiculously frequently used, and it's so simple to implement.

In any case, gorgeous work :)

I'm on mac chrome... uploading a hundred or so random pics i saved from reddit/digg... you are going to end up with the most bizarre collection of pics from everyone uploading their own strange test pictures. http://www.dropmocks.com/m1e4 :)
Simple, works with all the pics even if the upload takes a while. How long until you run out of s3 storage or have to increase the size of your rackspace cloud server?
pretty slick :)

I created a client-side image shrinker - demo at http://kimsal.com/shrinker - github at http://github.com/mgkimsal/jsclientshrinker Perhaps integrating this functionality for images that are 'too big' (whatever file size you decide) would be a nice enhancement? :)

definitely i'm gonna try your lib.
Cool. Fork on github and send any pull requests. The issues right now are that it only works with ff3 and chrome. I'd have thought safari would work, but it doesn't (didn't for me). Some integrated browser detection to offer transparent reduction for images on compatible browsers would great.

Let me know how it works out for you :)

I like how it changes the dimension. But converting to PNG is massively increasing the file size?

"Original file was: 137724 bytes Transmitted size was: 844176 bytes (due to base64) New file is: 633131 bytes"

It might be - not sure it's just a PNG issue, or if it's a canvas flaw, or what. The system could ideally check the before/after sizes, and only send the smaller one. Good catch (I think I'd seen that once in testing too).