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?
Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource
11–20 of 34 posts
Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource
#12What’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.
Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource
#13Not 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.
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
#14Not 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.
Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource
#15Earlier 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.
> 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
#16Earlier 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?
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
#17Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource
#18Re: Show HN: AspectRat.io – Aspect ratio calculator and device resolutions resource
#19Earlier quoted context omitted.
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
#20Earlier 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?
https://www.apple.com/macbook-pro/specs/
Select 15" and scroll to Display section.