Toga-Hacks-I / Toga-Hacks-Website

The landing site for the TogaHacks I Hackathon, coming April 2020
https://togahacks.com
MIT License
2 stars 0 forks source link

Enable automatic image resizing on background images #19

Open SwiftWinds opened 4 years ago

SwiftWinds commented 4 years ago

the venue, intro, and about section each have background images (you can search "background: " in style.css to see all of them)

on load, give the image resolution rounded up by 100s for example, if the container div (basically the width allowed to the image) around an image was 640px wide for a specific screen, I would deliver a 700px image with https://res.cloudinary.com/damnzwekj/image/upload/c_fill,dpr_auto,f_auto,q_auto,w_auto:100:700/v1/TogaHacks/backgrounds/venue-info-bg_jii9qp.jpg

and then on width change, if increase from, say, 640px to 730px, then replace background image with https://res.cloudinary.com/damnzwekj/image/upload/c_fill,dpr_auto,f_auto,q_auto,w_auto:100:800/v1/TogaHacks/backgrounds/venue-info-bg_jii9qp.jpg

if change from, say, 640px to 690px then no deliver new image

also if change from 640px to, say, 200px, no change also, because why deliver a lower res image if u already have a hi-res one?

we can have the class "bg-responsive" on all the elements with the background image, so you can do $(."bg-responsve") to target all of them

SwiftWinds commented 4 years ago

TLDR: window on ready or width increase, deliver background img with resolution width of element's width rounded up to nearest 100px

SwiftWinds commented 4 years ago

Next steps: