Re:Show HN: AspectRat.io – Aspect ratio calculator and devic...
by qualitytime on Friday November 17, 2017 @02:35PM
(#15725275)
Hey, good job.
I tend to look up aspect ratios frequently.
You went full on with a nice web page and domain name hack.
Add more devices (e.g. ipads etc.), video res (vga,etc.) and more mathematical constants like golden ratio, silver ratio , etc. and add an easy landscape/portrait toggle switch.
Re:Show HN: AspectRat.io – Aspect ratio calculator and devic...
by 52-6F-62 on Friday November 17, 2017 @02:38PM
(#15725315)
> Add more devices (e.g. ipads etc.), video res (vga,etc.) and more mathematical constants like golden ratio, silver ratio , etc. and add an easy landscape/portrait toggle switch.
I'd like to add: a specs dialog, maybe? Add DPI/HDPI info, recommended DPI for images, etc. Would make this a for-sure go-to.
Re:Show HN: AspectRat.io – Aspect ratio calculator and devic...
by sd8dgf8ds8g8dsg on Friday November 17, 2017 @09:19AM
(#15722124)
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
}
Re:Show HN: AspectRat.io – Aspect ratio calculator and devic...
by 52-6F-62 on Friday November 17, 2017 @02:37PM
(#15725297)
This. I work in media. Just passed this along to a few designer friends, and even non-designers who work with magazine design teams and regularly have to translate images and resize/crop them for mobile and web.
edit: They're already happy to have it in their back pocket.
Re:Show HN: AspectRat.io – Aspect ratio calculator and devic...
by ryanhefner on Friday November 17, 2017 @11:12AM
(#15723192)
Yeah, this is really more of a reference and a tool when you’re comparing sizes and confirming they are the same aspect ratio without having to use code. There’s also an NPM module that will do the code part if you need to go that route.
Re:Show HN: AspectRat.io – Aspect ratio calculator and devic...
by schemathings on Friday November 17, 2017 @02:54PM
(#15725451)
I just looked at Responsive Design Mode in Firefox Developer Tools and they also have a list of 16 devices with resolutions (Chrome has 29). There is a lot of overlap in the two lists, but using those would tie into a common tool we use to view sites on different devices.
Re:Show HN: AspectRat.io – Aspect ratio calculator and devic...
by ryanhefner on Friday November 17, 2017 @11:50AM
(#15723600)
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 devic...
by SimeVidas on Friday November 17, 2017 @09:01AM
(#15721979)
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.
Re:Show HN: AspectRat.io – Aspect ratio calculator and devic...
by SimeVidas on Friday November 17, 2017 @05:53PM
(#15726664)
But why are the aspect ratios based on popular smartphone screens? Notice how on the website, you select a smartphone model, and then the button on the right shows CSS code for creating an aspect ratio that matches that smartphone’s screen. What’s the use case of having an element whose aspect ratio mimics that of popular smartphone screens?
Re:Show HN: AspectRat.io – Aspect ratio calculator and devic...
by ryanhefner on Sunday November 19, 2017 @08:24AM
(#15733792)
If you happen to have a product video in your site that has been formatted for a specific phone, you can make sure the container of the video is set as the same aspect ratio of the phone.
I also see the CSS as an add-on, the devices for me are more for reference, but I have used the CSS here and there for some of the Apple phones.
I tend to look up aspect ratios frequently.
You went full on with a nice web page and domain name hack.
Add more devices (e.g. ipads etc.), video res (vga,etc.) and more mathematical constants like golden ratio, silver ratio , etc. and add an easy landscape/portrait toggle switch.
I'd like to add: a specs dialog, maybe? Add DPI/HDPI info, recommended DPI for images, etc. Would make this a for-sure go-to.
Nice work!
You can fix the broken CSS for Firefox by adding -moz-appearance in addition to -webkit-appearance.
https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-appear...
edit: They're already happy to have it in their back pocket.
https://www.apple.com/macbook-pro/specs/
Select 15" and scroll to Display section.
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.
> 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.
I also see the CSS as an add-on, the devices for me are more for reference, but I have used the CSS here and there for some of the Apple phones.