{"id":29150547,"url":"https://github.com/roborourke/rsp-img","last_synced_at":"2025-06-30T23:10:52.906Z","repository":{"id":252579473,"uuid":"840842032","full_name":"roborourke/rsp-img","owner":"roborourke","description":"A light JS library makes image's `sizes` attributes match their current display width","archived":false,"fork":false,"pushed_at":"2024-08-12T18:34:23.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-28T16:12:04.495Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gigantic-three-sparrow.glitch.me/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roborourke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-10T21:17:10.000Z","updated_at":"2024-08-14T10:16:07.000Z","dependencies_parsed_at":"2024-08-10T22:52:35.730Z","dependency_job_id":null,"html_url":"https://github.com/roborourke/rsp-img","commit_stats":null,"previous_names":["roborourke/rsp-img"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/roborourke/rsp-img","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roborourke%2Frsp-img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roborourke%2Frsp-img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roborourke%2Frsp-img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roborourke%2Frsp-img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roborourke","download_url":"https://codeload.github.com/roborourke/rsp-img/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roborourke%2Frsp-img/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262545028,"owners_count":23326657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-30T23:10:51.724Z","updated_at":"2025-06-30T23:10:52.855Z","avatar_url":"https://github.com/roborourke.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `rsp-img`\n\nJS that updates image's `sizes` attribute according to its currently displayed size.\n\n## Demo\n\nhttps://gigantic-three-sparrow.glitch.me/\n\n## What is this?\n\nResponsive images on the web are difficult to get right. What I think most of us would like is an image tag that uses the `srcset` attribute to determine the most appropriate available src based on the size the image is currently being displayed at, rather than in relation to the viewport.\n\nThis library makes the `sizes` attribute dynamic and tied to an image's current display size, so the browser can make a more informed decision about which image to download from the `srcset`.\n\n## Features\n\n- Less than 500B\n- Progressive enhancement for standard `img` tags\n- Accounts for device pixel ratio\n- Uses `ResizeObserver` and `requestAnimationFrame` for optimal performance\n\n## Usage\n\nInclude the `rsp-img.js` file in your bundle or directly in your web page e.g.\n\n```html\n\u003cscript src=\"rsp-img.min.js\" async\u003e\u003c/script\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froborourke%2Frsp-img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froborourke%2Frsp-img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froborourke%2Frsp-img/lists"}