{"id":13448650,"url":"https://github.com/vaneenige/uos","last_synced_at":"2025-04-05T07:02:48.943Z","repository":{"id":40558534,"uuid":"164810177","full_name":"vaneenige/uos","owner":"vaneenige","description":"🐭 A tiny 250b scroll listener with progress.","archived":false,"fork":false,"pushed_at":"2019-05-20T17:09:12.000Z","size":14,"stargazers_count":350,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T06:02:12.333Z","etag":null,"topics":["observer","progress","scroll"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/uos","language":"TypeScript","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/vaneenige.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":"2019-01-09T07:19:19.000Z","updated_at":"2025-03-03T15:43:41.000Z","dependencies_parsed_at":"2022-09-15T02:52:10.442Z","dependency_job_id":null,"html_url":"https://github.com/vaneenige/uos","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaneenige%2Fuos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaneenige%2Fuos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaneenige%2Fuos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaneenige%2Fuos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaneenige","download_url":"https://codeload.github.com/vaneenige/uos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299831,"owners_count":20916190,"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":["observer","progress","scroll"],"created_at":"2024-07-31T05:01:51.662Z","updated_at":"2025-04-05T07:02:48.926Z","avatar_url":"https://github.com/vaneenige.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","目录"],"sub_categories":[],"readme":"# Update On Scroll (uos)\n\n[![npm version](https://img.shields.io/npm/v/uos.svg)](https://www.npmjs.com/package/uos)\n[![gzip size](http://img.badgesize.io/https://unpkg.com/uos/dist/uos.mjs?compression=gzip)](https://unpkg.com/uos)\n[![license](https://img.shields.io/npm/l/uos.svg)](https://github.com/vaneenige/uos/blob/master/LICENSE)\n[![dependencies](https://img.shields.io/badge/dependencies-none-ff69b4.svg)](https://github.com/vaneenige/uos/blob/master/package.json)\n[![TypeScript](https://img.shields.io/static/v1.svg?label=\u0026message=TypeScript\u0026color=294E80)](https://www.typescriptlang.org/)\n\nUpdate On Scroll (uos) is a tiny library to provide the easiest way for updating values on scroll. Based on percentual or pixel based begin and end values, progress is returned trough a callback.\n\nThis utility can be useful for CSS animations, DOM changes, WebGL transitions or anything that can be updated based on a progress value.\n\n#### Features:\n\n- Small in size, no dependencies\n- Percentage or pixel based values\n- Optimized for multiple instances\n\n## Install\n\n```\n$ npm install --save uos\n```\n\n## Usage\n\nImport the library:\n```js\nimport updateOnScroll from 'uos';\n```\n\nUpdate an element based on pixels:\n```js\nupdateOnScroll(100, 500, progress =\u003e {\n  // Progress between 100px and 500px\n});\n```\n\nUpdate an element based on percentages:\n```js\nupdateOnScroll(0.2, 0.6, progress =\u003e {\n  // Progress between 20% and 60%\n});\n```\n\n\u003e Only a single scroll listener will be used regardless of how many instances are created. The callback of an instance will be called on every update.\n\n## License\n\nMIT © \u003ca href=\"https://use-the-platform.com\"\u003eColin van Eenige\u003c/a\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaneenige%2Fuos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaneenige%2Fuos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaneenige%2Fuos/lists"}