gespo89 / PAXSignatureGenerator

PAX Forum Signature Generator
2 stars 5 forks source link

Add web-only instant version #10

Closed broadstone closed 8 years ago

broadstone commented 8 years ago

This is far from ideal, but I wanted to upload a version that closely tracks what your current head looks like.

The basic notion is that this makes badges as you are editing the thing. Per how @mddburgess did it, I put it in index2.html

The logic was shameless stolen from this project and converted as literally as I could from java to javascript. It is missing the sort feature and the imgur upload feature. However, both could be implemented I think. I just haven't had time.

The implementation is based on a library called JIMP from https://github.com/oliver-moran/jimp to generate PNG images on the fly. I'm not sure how new of a browser is required, but they all implemented being able to put a base64-encoded data blob in the img tag's src attribute. It probably doesn't work in IE8, however, as it has a 32KB image limit.

Also, I don't really know javascript, but it looks a lot like C/C++, so I went with it. I had a good many language surprises. There are definitely some style mistakes.

Demonstration at https://broadstone.github.io/PAXSignatureGenerator/src/main/webapp/index2.html though it will reflect my master branch, not this PR.

gespo89 commented 8 years ago

I like the live preview. Couple things: -Hard coded years are back, we probably want to ditch them. -I feel like imgur isn't really going to be workable in a secure manner with a JS implementation. Once you move everything client side you make it literally impossible to secure, as the only to really do it would be to have the API key out in the open, giving public access to the private imgur account.

broadstone commented 8 years ago

There's open demonstrations, from imgur, of a web-only interface to upload your image. I'm figuring imgur requires a confirmation of some sort to complete upload as an anonymous image. I'll know more when I try to convert their samples into this.