mitodl / mit-open

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Square aspect ratio for media resource images #1183

Closed jonkafton closed 1 week ago

jonkafton commented 1 week ago

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/4523

Description (What does it do?)

Displays media resource (podcast episodes, videos) images tn the homepage Media section carousel with square aspect ratios.

Screenshots (if appropriate):

image

How can this be tested?

Navigate to homepage. Check resource cards in the Media section have images with aspect ratio 1 and that their loading state reflects loaded proportions. Check that other resource cards are not affected.

Additional Context

Opted to do this by configuration because although we can detect that a resource is media by its resource type (podcast, podcast_episode, video), if we do that at the card level we end up with these:

Screenshot 2024-06-27 at 17 45 41
ChristopherChudzicki commented 1 week ago

@steven-hatch fyi ☝️

What was your expectation for media cards and course/program cards being mixed on the same carousel?

Jon's solution—make the square aspect ratio opt in, and only use it where we know all cards are media—seems reasonable.