{"id":17036078,"url":"https://github.com/vuquangpham/scroll-trigger","last_synced_at":"2026-01-31T03:02:34.661Z","repository":{"id":193574918,"uuid":"666254044","full_name":"vuquangpham/scroll-trigger","owner":"vuquangpham","description":"A mimic version of GSAP ScrollTrigger 🎯🎯","archived":false,"fork":false,"pushed_at":"2024-05-02T10:32:44.000Z","size":4419,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T10:10:26.925Z","etag":null,"topics":["fe-lib","intersection-observer","javascript","scroll","scroll-trigger"],"latest_commit_sha":null,"homepage":"https://scroll-trigger-demo.netlify.app/","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/vuquangpham.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":"2023-07-14T04:30:28.000Z","updated_at":"2024-05-02T10:32:48.000Z","dependencies_parsed_at":"2024-11-29T22:18:38.202Z","dependency_job_id":null,"html_url":"https://github.com/vuquangpham/scroll-trigger","commit_stats":null,"previous_names":["vupham29/scroll-trigger","vuquangpham/scroll-trigger"],"tags_count":1,"template":false,"template_full_name":"vuquangpham/boilw","purl":"pkg:github/vuquangpham/scroll-trigger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuquangpham%2Fscroll-trigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuquangpham%2Fscroll-trigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuquangpham%2Fscroll-trigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuquangpham%2Fscroll-trigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vuquangpham","download_url":"https://codeload.github.com/vuquangpham/scroll-trigger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vuquangpham%2Fscroll-trigger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28927772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T02:59:34.861Z","status":"ssl_error","status_checked_at":"2026-01-31T02:59:05.369Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["fe-lib","intersection-observer","javascript","scroll","scroll-trigger"],"created_at":"2024-10-14T08:49:12.617Z","updated_at":"2026-01-31T03:02:34.644Z","avatar_url":"https://github.com/vuquangpham.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scroll Trigger\n\n\u003e A mimic version of GSAP ScrollTrigger with 5.86kB 👀\n\n## Getting started\n\n### Notice\n\n\u003e 🆘 Please don't use ScrollTrigger with the trigger element that has `sticky` position because of the wrong\n\u003e calculation (because the top position of the trigger element is always `0` when sticking)\n\n### Download\n\nSelf hosted 👉 https://github.com/vuquangpham/scroll-trigger/\n\n### Initialize\n\n#### Options\n\n| Name                    | Default         | Description                                                                       |\n|-------------------------|-----------------|-----------------------------------------------------------------------------------|\n| `id`                    | `unique`        | id for clarifying each instance                                                   |\n| `start`                 | `top top`       | trigger start position (trigger when top of the element hits top of the viewport) |\n| `end`                   | `bottom bottom` | end position (when bottom of the element hits bottom of the viewport)             |\n| `responsive`            | `[]`            | change the observed breakpoint (`start` and `end`) on different breakpoint        |\n| `onEnter:(self) =\u003e {}`  | `function`      |                                                                                   |\n| `onLeave:(self) =\u003e {}`  | `function`      |                                                                                   |\n| `onUpdate:(self) =\u003e {}` | `function`      |                                                                                   |\n\n### Methods\n\n| Name      | Parameter  | Description                        |\n|-----------|------------|------------------------------------|\n| `create`  | `object`   | create the instance                |\n| `get`     | `id`       | get the ScrollTrigger instance     |\n| `destroy` | `instance` | destroy the ScrollTrigger instance |\n\n```js\nconst instance = ScrollTrigger.create({\n    start: 'top center', // trigger when top of the element hits the center of the viewport\n    end: () =\u003e '+=' + 300, // end when scroll 300px after trigger\n    onEnter: (self) =\u003e {\n        // get the trigger element\n        console.log('The trigger element has entered the viewport', self.trigger);\n\n        // check which of direction that the trigger enter the viewport\n        console.log('Enter back:', self.isEnterBack);\n    },\n    onUpdate: (self) =\u003e {\n        console.log('Progress:', self.progress);\n    },\n    onLeave: (self) =\u003e {\n        // check which of direction that the trigger leave the viewport\n        console.log('Leave back:', self.isLeaveBack);\n\n        // destroy the instance when out of viewport\n        self.destroy();\n    },\n    responsive: [\n        {\n            breakpoint: 1024,\n            start: 'top 60%', // top of the element hits the 60% of the viewport\n            end: 'bottom 60%+=200px' // end when the bottom of the element hit the (60% + 200px) of the viewport\n        }\n    ]\n});\n```\n\n#### Events\n\n| Name                    | Description                                                             |\n|-------------------------|-------------------------------------------------------------------------|\n| `onEnter:(self) =\u003e {}`  | trigger at the first time that the element hits the viewport breakpoint |\n| `onUpdate:(self) =\u003e {}` | trigger on each scroll event when the element in viewport               |\n| `onLeave:(self) =\u003e {}`  | trigger when the element goes out of viewport                           |\n\n## Deployment\n\nRun `./public` and `./dev` in live server\n\n```shell\nnpm run dev\n```\n\nBuild files from `./src` and `./dev` to `./dist` for production\n\n```shell\nnpm run build\n```\n\nBuild files from `./src` for production\n\n```shell\nnpm run prod\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvuquangpham%2Fscroll-trigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvuquangpham%2Fscroll-trigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvuquangpham%2Fscroll-trigger/lists"}