Live data from Hacker News

Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource

aspectrat.io

11–20 of 34 posts

Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource

#11
post #6

Not sure why make a whole website of this w := 1900 h := 1200 divisor := gcd(w, h) aspect := fmt.Sprintf("%d:%d", w/divisor, h/divisor) func gcd(x, y int64) int64 { for y != 0 { x, y = y, x%y } return x }

He/she/it hasn't heard of 1920x1200 :) All those devices are 16:9 i think?

Yeah, I need to beef up the devices/resolutions listing. What device(s) have 1920x1200?

Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource

#12
post #5

What’s the use case for the CSS code? The `padding-top` value doesn’t account for the OS and browser’s chrome (status bar, URL bar, etc.), so the `.inner` element doesn’t fit into the viewport.

For responsive embeds I assume. Where the embedded ".inner" component scales it's height according to it's width.

Yeah, that was the intention. Good to use for placeholder styling until the image/video has loaded. And for things like responsive embeds/iframes.

Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource

#13
post #4

Not sure why make a whole website of this w := 1900 h := 1200 divisor := gcd(w, h) aspect := fmt.Sprintf("%d:%d", w/divisor, h/divisor) func gcd(x, y int64) int64 { for y != 0 { x, y = y, x%y } return x }

Have an upvote. The limit on ridiculous things people will somehow make into a "web service" knows no bounds.

Thanks. Yeah, not really a "web service", just a reference tool, along with an NPM module you can use.

Also, I’ll be extending the device/resolutions listing, so hopefully it can be a handy reference for designers/developers.

Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource

#14
post #7

Not sure why make a whole website of this w := 1900 h := 1200 divisor := gcd(w, h) aspect := fmt.Sprintf("%d:%d", w/divisor, h/divisor) func gcd(x, y int64) int64 { for y != 0 { x, y = y, x%y } return x }

Because my non-programmer friend can use a website, but not write a program.

Exactly.

Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource

#15
post #4

Earlier quoted context omitted.

Have an upvote. The limit on ridiculous things people will somehow make into a "web service" knows no bounds.

Thanks. Yeah, not really a "web service", just a reference tool, along with an NPM module you can use. Also, I’ll be extending the device/resolutions listing, so hopefully it can be a handy reference for designers/developers.

The upvote was for `sd8dgf8ds8g8dsg`

> just a reference tool, along with an NPM module you can use.

Why does ~6 lines of basic logic need an NPM module?

Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource

#16

Earlier quoted context omitted.

Thanks. Yeah, not really a "web service", just a reference tool, along with an NPM module you can use. Also, I’ll be extending the device/resolutions listing, so hopefully it can be a handy reference for designers/developers.

The upvote was for `sd8dgf8ds8g8dsg` > just a reference tool, along with an NPM module you can use. Why does ~6 lines of basic logic need an NPM module?

Yeah, probably doesn't. I just found myself using it across a couple different projects and seemed like it would be easier than having to copy and paste it everywhere.

Also, it has a command line tool that you can use to get the aspect ratio from width/height. So, not just the code.

Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource

#17
post #6

Earlier quoted context omitted.

He/she/it hasn't heard of 1920x1200 :) All those devices are 16:9 i think?

Yeah, I need to beef up the devices/resolutions listing. What device(s) have 1920x1200?

My 2008 Dell Studio 15 laptop :)

Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource

#18
post #17

Earlier quoted context omitted.

Yeah, I need to beef up the devices/resolutions listing. What device(s) have 1920x1200?

My 2008 Dell Studio 15 laptop :)

I'll be sure to add that as I expand the listing of devices/resolutions.

Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource

#19
post #17

Earlier quoted context omitted.

Yeah, I need to beef up the devices/resolutions listing. What device(s) have 1920x1200?

My 2008 Dell Studio 15 laptop :)

Also, I thinking that it could be handy to maybe default to the resolution/aspect ratio of the device visiting the page. Would that be handy?

Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource

#20
post #6

Earlier quoted context omitted.

He/she/it hasn't heard of 1920x1200 :) All those devices are 16:9 i think?

Yeah, I need to beef up the devices/resolutions listing. What device(s) have 1920x1200?

The maximum scaling option in macOS for 15" retina MacBook Pro's (all 15" retina models since 2012) is 1920x1200. So it's probably used quite a lot.

https://www.apple.com/macbook-pro/specs/

Select 15" and scroll to Display section.

Post reply on HN