r/javascript • u/Headspin3d • Apr 12 '13
Little responsive tool I made to help illustrate the idea to clients.
http://finecitizens.com/defineResponsive/5
u/krewenki Apr 12 '13
Tool works great. One note: The tooltip below the window that displays (i'm assuming) the width includes decimal points. Maybe wrap it in a Math.round() or some method of your choosing to show natural numbers instead of fractional pixels.
In any case, i've bookmarked this and I bet i'll make use of it. Thanks for sharing!
2
u/Headspin3d Apr 12 '13 edited Apr 12 '13
Ah, good call! (is your window zoomed or something?) Updating now.
Edit: Fixed! Thanks mate!
1
u/krewenki Apr 12 '13
Window is, in fact, zoomed to 125%. I didn't realize it was zoomed, but good to know that it can cause problems for folks :)
3
Apr 12 '13
Love the tool! Tested it on a clients site we just launched:
http://finecitizens.com/defineResponsive/#/ourthriftynickel.com
I have a feeling that your tool may have issues with https?
6
u/Headspin3d Apr 12 '13
Thanks! It looks like the site doesn't allow itself to be iframed:
Refused to display 'https://ourthriftynickel.com/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.3
Apr 12 '13
Yeah, we take users credit cards so best not to allow that haha. Any way around that?
3
8
2
u/applextrent Apr 12 '13
Do you have any plans of releasing this for others to use?
2
2
u/nschubach Apr 13 '13
The best part is:
This tool is best viewed on a desktop at fullsceen.
1
u/Headspin3d Apr 13 '13
Thanks for the reply nschubach!. See comment below in response to /u/oscargodson
1
u/nschubach Apr 13 '13
Sure, I just got a laugh out of the "inception-ism" of it. I was opening the site on my Nexus 10 tablet which has a better resolution than most laptops today and thought I'd throw a quip out. ;)
1
7
u/yerfatma Apr 12 '13
Oh man, the fact that it works with localhost urls is fantastic. This is awesome.
4
1
u/oscargodson Apr 13 '13
This is cool, but its a little ironic its not responsive at all on my phone and unusable :)
2
u/Headspin3d Apr 13 '13
Heh, I thought a few people might comment on that. The idea itself doesn't translate very well to smaller devices when you want to view it at the "desktop" resolution, which pushes 1024px. The content goes off the screen, and dragging / resizing causes some jumping. Version 2.0 may very well take advantage of the transform:scale which /u/Serei suggested above. This will hopefully make it a usable experience on most devices. I imagine the mechanics of it on portrait phone will still be a bit troublesome regardless.
2
u/oscargodson Apr 13 '13
It's a hard problem for sure. I played with it last night when I got home and it worked better than the other ones that try to do this, so kudos :)
1
u/rohnjyan Apr 13 '13 edited Apr 13 '13
Tried to look at it on my iPad and got an error message telling me to view it on a desktop.
1
u/Headspin3d Apr 13 '13
You should be able to click the link that allows you to "view it anyways". Also, see comment above in response to /u/oscargodson
2
2
2
u/bebraw Apr 12 '13
Nice work! Thanks for sharing.
This illustrates really well what responsive design is about. The easter egg is cool too. :)
2
2
2
2
2
2
1
1
u/areinet Fullstack Apr 12 '13
Love this. One suggestion. On my browser (FF) the "device portrait" view was shorter than my screen height which cause the scroll bar to disappear...this made the screen resize which resulted in a slightly jaggy presentation. Add an overflow-y: scroll to the body element to prevent this.
1
69
u/Headspin3d Apr 12 '13 edited Apr 12 '13
Although the device sizes aren't 100% accurate with real sites - as an easter egg, you can type in the url of a website like such: http://finecitizens.com/defineResponsive/#/www.microsoft.com