{"id":25345432,"url":"https://github.com/tarun-dugar/easy-scroll","last_synced_at":"2025-07-06T18:37:16.236Z","repository":{"id":25139877,"uuid":"103279504","full_name":"tarun-dugar/easy-scroll","owner":"tarun-dugar","description":"A lightweight native javascript library to perform smooth scrolling with animation","archived":false,"fork":false,"pushed_at":"2022-12-06T02:54:34.000Z","size":6285,"stargazers_count":120,"open_issues_count":17,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-10T21:00:30.971Z","etag":null,"topics":["animation-library","bezier-curves","easing-functions","html","javascript","javascript-library","scrolling","smooth-scrolling"],"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/tarun-dugar.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":"2017-09-12T14:14:21.000Z","updated_at":"2023-06-29T07:37:24.000Z","dependencies_parsed_at":"2022-07-27T05:02:20.811Z","dependency_job_id":null,"html_url":"https://github.com/tarun-dugar/easy-scroll","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarun-dugar%2Feasy-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarun-dugar%2Feasy-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarun-dugar%2Feasy-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarun-dugar%2Feasy-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarun-dugar","download_url":"https://codeload.github.com/tarun-dugar/easy-scroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675597,"owners_count":20977376,"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":["animation-library","bezier-curves","easing-functions","html","javascript","javascript-library","scrolling","smooth-scrolling"],"created_at":"2025-02-14T12:35:15.343Z","updated_at":"2025-04-07T15:08:38.006Z","avatar_url":"https://github.com/tarun-dugar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"A lightweight native javascript library to perform smooth scrolling.\n\n## Features\n- ~3 KB before gzip\n- no dependencies\n- scrolling in any direction - left, right, bottom, top\n- specify the amount in pixels that needs to be scrolled\n- ability to scroll any kind of scrollable element - window, div etc.\n- controlling the pace of the scrolling by specifying predefined easing presets or bezier curve points\n- ability to cancel the scrolling at any time via callback\n\n## Installation\n```\nnpm install easy-scroll --save\n```\nOr you can load it via a script tag as follows:\n```\n\u003cscript src=\"https://unpkg.com/easy-scroll\" /\u003e\n```\n\n## Importing\n### ES6\n```\nimport easyScroll from 'easy-scroll';\n```\n### CommonJS\n```\nvar easyScroll = require('easy-scroll');\n```\n### Global variable\nthe variable `easyScroll` attached to `window` or `this` depending on what environment you are using\n\n## API\nA function is exported by default which accepts an object with the following configuration as an argument:\n\n|         Property       |                             Value                             |\n| ---------------------- | ------------------------------------------------------------- |\n| **scrollableDomEle** (required)     |           `window` or any other scrollable DOM element      |\n| **direction** (required)           |  the direction in which you want the element to scroll - top, left, bottom, right \n| **duration** (required) | the duration in milliseconds over which you want the scrolling to happen |\n| **easingPreset** | linear(default), easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint |\n| **cubicBezierPoints** | object containing the 4 points to define a bezier curve \u003cbr/\u003e{\u003cbr/\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;'x1': Number(\u003e= 0 and \u003c= 1),\u003cbr/\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;'y1': Number,\u003cbr/\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;'x2': Number(\u003e= 0 and \u003c= 1),\u003cbr/\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;'y2': Number\u003cbr/\u003e }|\n| **onRefUpdateCallback**| callback function which is called on each tick of the scroll. The current instance of the scrolling animation is passed as an argument by default. You can use `cancelAnimationFrame` on this instance to cancel the scrolling.|\n| **onAnimationCompleteCallback** | callback function which is called after the scrolling is done |\n| **scrollAmount** | the amount that needs to be scrolled in pixels. If this is not specified, the element will be scrolled to the end. |\n\n## Example Usage\n```\nimport easyScroll from 'easy-scroll';\n\neasyScroll({\n    'scrollableDomEle': window,\n    'direction': 'bottom',\n    'duration': 2000,\n    'easingPreset': 'easeInQuad',\n    'scrollAmount': 1000\n});\n```\n\n## Browser Support\nSupported on all modern browsers. For older browsers, you would need the polyfills for `requestAnimationFrame` and `cancelAnimationFrame`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarun-dugar%2Feasy-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarun-dugar%2Feasy-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarun-dugar%2Feasy-scroll/lists"}