{"id":18056011,"url":"https://github.com/argyleink/app-img","last_synced_at":"2025-04-05T09:44:04.798Z","repository":{"id":57182535,"uuid":"121477665","full_name":"argyleink/app-img","owner":"argyleink","description":"\u003capp-image\u003e a lazy image loading custom element for considerate user experiences","archived":false,"fork":false,"pushed_at":"2018-02-15T17:37:13.000Z","size":7,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T13:30:38.908Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/argyleink.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}},"created_at":"2018-02-14T06:15:08.000Z","updated_at":"2025-01-20T20:17:31.000Z","dependencies_parsed_at":"2022-09-14T06:00:36.970Z","dependency_job_id":null,"html_url":"https://github.com/argyleink/app-img","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argyleink%2Fapp-img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argyleink%2Fapp-img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argyleink%2Fapp-img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argyleink%2Fapp-img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/argyleink","download_url":"https://codeload.github.com/argyleink/app-img/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318721,"owners_count":20919483,"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":"2024-10-31T01:13:19.054Z","updated_at":"2025-04-05T09:44:04.778Z","avatar_url":"https://github.com/argyleink.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### Features\n\n- Waits to start loading until the image is in view\n- Neat custom properties api for modifying presentation layer \n- Fade in animation\n- No dependencies\n- Ready for avatars to galleries\n\n\n\n**note**: this custom element doesn't provide any polyfills\n\n\n\n\n\n#### Get Started\n\n- `npm i app-img`\n- load the web component in your HTML, perhaps via JS like this `import 'app-img.element'`\n\n\n\n\n\n\n## Intended Usage / API\n```html\n\u003capp-img src='...'\u003e\u003c/app-img\u003e\n\u003capp-img src='...' viewport='#scrollcontainer'\u003e\u003c/app-img\u003e\n\u003capp-img src='...' no-shadow\u003e\u003c/app-img\u003e\n\u003capp-img src='...' style='--fade-speed:0'\u003e\u003c/app-img\u003e\n\u003capp-img src='...' style='--fit:none'\u003e\u003c/app-img\u003e\n\u003capp-img src='...' style='--loading-bg:black;--loading-text_color:white;'\u003e\u003c/app-img\u003e\n```\n\n```js\n$('app-img').addEventListener('loaded', ({target}) =\u003e \n  console.log(target))\n```\n\n\n\n#### Changing Presentation\nChange the custom property values on the `\u003capp-img\u003e` node. \n\n```css\n--loading-bg: any|css|color|type; \n/* default: hsl(0,0%,85%) */\n\n--loading-text_color: hex|hsl|rgb|etc;\n/* default: hsl(0,0%,70%) */\n\n--fit: fill|contain|cover|none|scale-down;\n/* default: cover */\n\n--position: left|top|50%|20px|etc; \n/* default: initial */\n\n--fade-speed: s|ms; \n/* default: 0.5s */\n```\n\n\n#### Changing Behavior\n\n```html\n\u003c!-- opt out of shadowDOM --\u003e\n\u003capp-img no-shadow\u003e\u003c/app-img\u003e\n\n\u003c!-- opt out of animation --\u003e\n\u003capp-img style='--fade-speed:0;'\u003e\u003c/app-img\u003e\n\n\u003c!-- \n  when you need to specify the observed scroll container \n  pass a querySelector string into the attribute\n--\u003e\n\u003capp-img viewport='#scrollview'\u003e\u003c/app-img\u003e\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fargyleink%2Fapp-img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fargyleink%2Fapp-img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fargyleink%2Fapp-img/lists"}