{"id":20485431,"url":"https://github.com/modularorg/modularscroll","last_synced_at":"2025-04-13T14:53:40.189Z","repository":{"id":52788734,"uuid":"164990775","full_name":"modularorg/modularscroll","owner":"modularorg","description":"♢ Dead simple elements in viewport detection.","archived":false,"fork":false,"pushed_at":"2019-06-20T18:39:46.000Z","size":18,"stargazers_count":72,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T05:51:12.451Z","etag":null,"topics":["in-view","javascript","scroll","viewport"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/modularorg.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-10T04:38:43.000Z","updated_at":"2025-01-18T11:35:42.000Z","dependencies_parsed_at":"2022-08-23T03:01:09.807Z","dependency_job_id":null,"html_url":"https://github.com/modularorg/modularscroll","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modularorg%2Fmodularscroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modularorg%2Fmodularscroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modularorg%2Fmodularscroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modularorg%2Fmodularscroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modularorg","download_url":"https://codeload.github.com/modularorg/modularscroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732512,"owners_count":21152851,"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":["in-view","javascript","scroll","viewport"],"created_at":"2024-11-15T16:30:22.471Z","updated_at":"2025-04-13T14:53:40.165Z","avatar_url":"https://github.com/modularorg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/modularbp/modular-boilerplate\"\u003e\n        \u003cimg src=\"https://user-images.githubusercontent.com/4596862/37635200-aa3271b2-2bd0-11e8-8a65-9cafa0addd67.png\" height=\"140\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003emodularScroll\u003c/h1\u003e\n\u003cp align=\"center\"\u003eDead simple elements in viewport detection.\u003c/p\u003e\n\n## Installation\n```sh\nnpm install modularscroll\n```\n\n## Why\n- Simple\n- Lightweight\n- High performance\n- No dependencies\n\n## Usage\n```js\nimport modularScroll from 'modularscroll';\n\nthis.scroll = new modularScroll();\n```\n```html\n\u003ch1 data-scroll\u003eHello\u003c/h1\u003e\n\u003cp data-scroll\u003eText\u003c/p\u003e\n```\n\n#### With options\n```js\nimport modularScroll from 'modularscroll';\n\nthis.scroll = new modularScroll({\n    el: document,\n    name: 'scroll',\n    class: 'is-inview',\n    offset: 0,\n    repeat: false\n});\n```\n```html\n\u003ch1 data-scroll data-scroll-repeat\u003eHello\u003c/h1\u003e\n\u003cp data-scroll data-scroll-offset=\"60\"\u003eText\u003c/p\u003e\n```\n\n#### With methods\n```js\nimport modularScroll from 'modularscroll';\n\nthis.scroll = new modularScroll();\n\nthis.scroll.update();\n```\n\n#### With events\n```js\nimport modularScroll from 'modularscroll';\n\nthis.scroll = new modularScroll();\n\nthis.scroll.on('call', (func) =\u003e {\n    this.call(...func); // Using modularJS\n});\n```\n```html\n\u003cdiv data-scroll data-scroll-call=\"function, module\"\u003eTrigger\u003c/div\u003e\n```\n\n## Options\n| Option | Type | Default | Description |\n| ------ | ---- | ------- | ----------- |\n| `el` | `object` | `document` | Scroll container element. |\n| `name` | `string` | `'scroll'` | Data attributes name. |\n| `class` | `string` | `'is-inview'` | Elements in-view class. |\n| `offset` | `number` | `0` | In-view trigger offset. |\n| `repeat` | `boolean` | `false` | Repeat in-view detection. |\n\n## Attributes\n| Attribute | Values | Description |\n| --------- | ------ | ----------- |\n| `data-scroll` |  | Detect if in-view. |\n| `data-scroll-class` | `string` | Element in-view class.  |\n| `data-scroll-offset` | `number` | Element in-view trigger offset. |\n| `data-scroll-repeat` | `true`, `false` | Element in-view detection repeat. |\n| `data-scroll-call` | `string` | Element in-view trigger call event. |\n\n## Methods\n| Method | Description |\n| --------- | ----------- |\n| `init()` | Reinit the scroll. |\n| `update()` | Update elements position.  |\n| `destroy()` | Destroy the scroll events. |\n\n## Events\n| Event | Arguments | Description |\n| ----- | --------- | ----------- |\n| `call` | `func` | Trigger if in-view. Returns your `string` or `array` if contains `,`. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodularorg%2Fmodularscroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodularorg%2Fmodularscroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodularorg%2Fmodularscroll/lists"}