{"id":13548282,"url":"https://github.com/vgshenoy/vue-scrollama","last_synced_at":"2025-04-02T21:31:10.179Z","repository":{"id":33161129,"uuid":"153616332","full_name":"vgshenoy/vue-scrollama","owner":"vgshenoy","description":"Vue component to setup scroll-driven interactions (aka scrollytelling)","archived":false,"fork":false,"pushed_at":"2023-04-29T16:13:49.000Z","size":1134,"stargazers_count":426,"open_issues_count":10,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-18T16:08:13.517Z","etag":null,"topics":["scroll","scrollama","scrollytelling","vue"],"latest_commit_sha":null,"homepage":"https://vue-scrollama.vercel.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/vgshenoy.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}},"created_at":"2018-10-18T11:57:11.000Z","updated_at":"2025-03-05T05:32:57.000Z","dependencies_parsed_at":"2024-01-02T23:37:31.139Z","dependency_job_id":"8784bfc2-050e-4272-8334-ba055e5c6f8d","html_url":"https://github.com/vgshenoy/vue-scrollama","commit_stats":{"total_commits":108,"total_committers":2,"mean_commits":54.0,"dds":0.03703703703703709,"last_synced_commit":"a97610777fbc18d4a3821d307d80b0a315bc4d8d"},"previous_names":["shenoy/vue-scrollama"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vgshenoy%2Fvue-scrollama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vgshenoy%2Fvue-scrollama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vgshenoy%2Fvue-scrollama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vgshenoy%2Fvue-scrollama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vgshenoy","download_url":"https://codeload.github.com/vgshenoy/vue-scrollama/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246895697,"owners_count":20851317,"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":["scroll","scrollama","scrollytelling","vue"],"created_at":"2024-08-01T12:01:08.220Z","updated_at":"2025-04-02T21:31:09.872Z","avatar_url":"https://github.com/vgshenoy.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","UI Utilities [🔝](#readme)","Components \u0026 Libraries"],"sub_categories":["UI Utilities"],"readme":"# Vue Scrollama\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://vuejs.org\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n        \u003cimg height=\"100\" src=\"https://vuejs.org/images/logo.png\" alt=\"Vue logo\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/russellgoldenberg/scrollama\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n        \u003cimg height=\"100\" src=\"https://russellgoldenberg.github.io/scrollama/logo.png\" alt=\"scrollama.js\"/\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nA Vue component to easily setup scroll-driven interactions (aka scrollytelling). Uses [Scrollama](https://github.com/russellgoldenberg/scrollama) under the hood.\n\nThe best way to understand what it can do for you is to check out the examples [here](https://vue-scrollama.vercel.app) and [here](#examples).\n\nIf you're upgrading from v1 to v2 (which you should), do check out the [release notes](#release-notes).\n\n## Installation\n\n```sh\nnpm install vue-scrollama intersection-observer\n```\nScrollama makes use of [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) and you'll want to manually add its polyfill `intersection-observer` for cross-browser support.\n\n## Basic Usage\n\nAny elements placed directly inside a `Scrollama` component will be considered as steps. As the user scrolls, events will be triggered and emitted which you can handle as required:\n\n* `step-enter`: when the top or bottom edge of a step element enters the offset threshold\n* `step-exit`: when the top or bottom edge of a step element exits the offset threshold\n* `step-progress`: continually fires the progress (0-1) a step has made through the threshold\n\nHere's a simple example with three `\u003cdiv\u003e` elements as steps and a `step-enter` event\n\n```vue\n\u003ctemplate\u003e\n  \u003cScrollama @step-enter=\"stepEnterHandler\"\u003e\n    \u003cdiv class=\"step-1\" data-step=\"a\"\u003e...\u003c/div\u003e // classes like .step-1 may be used to adjust the style and dimensions of a step\n    \u003cdiv class=\"step-2\" data-step=\"b\"\u003e...\u003c/div\u003e // data-* attributes can be helpful to store instructions to be used in handlers\n    \u003cdiv class=\"step-3\" data-step=\"c\"\u003e...\u003c/div\u003e\n  \u003c/Scrollama\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport 'intersection-observer' // for cross-browser support\nimport Scrollama from 'vue-scrollama' // local registration in this example, can also be globally registered\n\nexport default {\n  components: {\n    Scrollama // local registration in this example, can also be globally registered \n  },\n  methods: {\n    stepEnterHandler ({element, index, direction}) {\n      // handle the step-event as required here\n      console.log({ element, index, direction });\n      // use the data attributes if needed\n      console.log(element.dataset.step) // a, b or c \n    }\n  }\n}\n\u003c/script\u003e\n```\n\n## API Reference\n\n### Props\nProps passed to the `Scrollama` component will simply be passed on to scrollama's [setup method](https://github.com/russellgoldenberg/scrollama#scrollamasetupoptions):\n\n```vue\n// example with offset prop set to 0.8\n\u003ctemplate\u003e\n  \u003cScrollama @step-enter=\"stepHandler\" :offset=\"0.8\"\u003e\n      ...\n  \u003c/Scrollama\u003e\n\u003c/template\u003e\n```\n\n### Events\n* `step-enter`\n* `step-exit`\n* `step-progress`\n\n\n## Examples\n\n### Codesandbox\n\nNote: The triggering might not work precisely in the split window browser in CodeSandbox. Open in a new window for more precise triggering.\n\n* [Basic](https://codesandbox.io/s/5kn98j4w74)\n* [Progress](https://codesandbox.io/s/ryx25zrj5q)\n* [Sticky Graphic 1](https://codesandbox.io/s/j3oy2k6lxv)\n* [Sticky Graphic 2](https://codesandbox.io/s/jznvyjpr9w)\n\nand [more](https://codesandbox.io/search?query=vue-scrollama%20vgshenoy\u0026page=1\u0026refinementList%5Bnpm_dependencies.dependency%5D%5B0%5D=vue-scrollama).\n\n### Nuxt\n\nExample repo [here](https://github.com/vgshenoy/vue-scrollama-demo-nuxt).\n\n## Release Notes\n\n### v2.0\n\n* Fixes buggy behaviour and improves performance on mobile devices\n* Updated in accordance with the latest `scrollama` API\n* *Breaking*: No more `graphic` slot, create your graphic outside the `Scrollama` component now and style it as per your needs (have a look at the examples above for guidance)\n* DOM scaffolding generated by `Scrollama` has been simplified\n* No need to import CSS any more, the DOM scaffolding is just one `div` and can be styled by adding classes or styles on the `Scrollama` component\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvgshenoy%2Fvue-scrollama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvgshenoy%2Fvue-scrollama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvgshenoy%2Fvue-scrollama/lists"}