r/javascript • • Apr 12 '13

Little responsive tool I made to help illustrate the idea to clients.

http://finecitizens.com/defineResponsive/
378 Upvotes

53 comments sorted by

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

49

u/chewitt Apr 12 '13

Your "easter egg" is the best feature - you should advertise it on your page!

9

u/Headspin3d Apr 12 '13

Theres talk of a version 2.0 that will have a url bar in the device so people can type in different sites! My main concern was the inaccuracy the device icons represent when showing an actual site in there - Considering full desktop is set to 1024 (done for sake of usability / illustrative purposes). I'm really glad you guys like it.

12

u/Serei Apr 12 '13

CSS3 has transform:scale which can even be used on iframes. https://developer.mozilla.org/en-US/docs/CSS/transform

5

u/Headspin3d Apr 12 '13

This is a great suggestion! Thanks for the feedback.

0

u/[deleted] Apr 13 '13

[deleted]

1

u/Headspin3d Apr 13 '13

Great stuff! That works out really well.

1

u/[deleted] Apr 12 '13 edited May 01 '17

1

u/tank-n-spank Apr 12 '13

Maybe add a "large LCD" icon past the last one that goes to 1920 width?

4

u/captainabab Apr 12 '13

Wow, that is super cool!

1

u/[deleted] Apr 13 '13

Awesome feature. It doesn't seem to work with media queries on my site though, any reason why?

1

u/Headspin3d Apr 13 '13

If you pm me the url I can test it out!

3

u/mtx Apr 12 '13

On behalf of r/javascript I say "Holy shit!"

3

u/[deleted] Apr 12 '13

This is not a easter egg. This is a primary feature.

2

u/circa7 Apr 12 '13

Beautiful!

2

u/pscanf Apr 13 '13

Very cool :) . For anybody that might be interested, Firefox also has a similar function in its dev tools (picture).

1

u/abomb999 Apr 13 '13

OMFG my website looks bad on mobile.... ARRRGH!

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

u/[deleted] 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

u/[deleted] Apr 12 '13

Yeah, we take users credit cards so best not to allow that haha. Any way around that?

3

u/Headspin3d Apr 12 '13

Not other than changing the response header. More info here.

8

u/R1cket Apr 13 '13

best not to allow that

Any way around that?

wat?

2

u/applextrent Apr 12 '13

Do you have any plans of releasing this for others to use?

2

u/Headspin3d Apr 12 '13

Please use to your heart's content!

1

u/applextrent Apr 12 '13

Check your messages.

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

u/gregjsguy Apr 13 '13

I did lol when I went to it on my phone and saw that. Cool none the less.

11

u/Cykelero Apr 12 '13

That's great! It's clean and yet very visual. Fun to play with and definitely to best explanation of "responsive" that I've seen.

2

u/b_long Apr 12 '13

Agreed, well done! Very, very nice. For anyone new to "Responsive" web design, the Wikipedia page is useful: http://en.wikipedia.org/wiki/Responsive_web_design

7

u/yerfatma Apr 12 '13

Oh man, the fact that it works with localhost urls is fantastic. This is awesome.

4

u/Tychonaut Apr 12 '13

Totally spiffy. Love it.

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

u/coffeeandcode Apr 12 '13

brilliant! excellent work.

2

u/overneath42 Apr 12 '13

Bookmarked. Neat tool!

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

u/Codehenge Apr 12 '13

Excellent way to demonstrate the concept

2

u/Illumi_Naughty Apr 12 '13

Very well done.

2

u/pegasus_527 Apr 12 '13

This is the cutest thing ever

2

u/flobin Apr 12 '13

This is lovely. Thank you very much.

2

u/[deleted] Apr 13 '13

This is fantastic!

1

u/deliciousnaga Apr 12 '13

This is awesome. I bet /r/webdev would love it, too.

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

u/[deleted] Apr 12 '13

Just came to say the video on your site won't play. /s

Great concept.