{"id":19206040,"url":"https://github.com/whiletruu/elm-smooth-scroll","last_synced_at":"2025-06-12T14:01:58.717Z","repository":{"id":57674732,"uuid":"188104522","full_name":"WhileTruu/elm-smooth-scroll","owner":"WhileTruu","description":"Scrolling to position that always takes the same amount of time.","archived":false,"fork":false,"pushed_at":"2019-09-13T15:22:17.000Z","size":27,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-12T17:22:28.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WhileTruu.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-05-22T19:54:31.000Z","updated_at":"2023-03-14T01:43:32.000Z","dependencies_parsed_at":"2022-09-02T15:01:27.775Z","dependency_job_id":null,"html_url":"https://github.com/WhileTruu/elm-smooth-scroll","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/WhileTruu%2Felm-smooth-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhileTruu%2Felm-smooth-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhileTruu%2Felm-smooth-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhileTruu%2Felm-smooth-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WhileTruu","download_url":"https://codeload.github.com/WhileTruu/elm-smooth-scroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253785041,"owners_count":21963908,"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":[],"created_at":"2024-11-09T13:14:32.927Z","updated_at":"2025-05-12T17:22:39.561Z","avatar_url":"https://github.com/WhileTruu.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SmoothScroll\n\nScrolling to position that always takes the same amount of time.\n\n### [Demo](https://whiletruu.github.io/elm-smooth-scroll/)\n\n## Usage\nThe full working example lives in the `example` directory, which results in the demo linked above when built.\n\nIn order to scroll to the `y` offset of the browser viewport with the `scrollTo` function you first need a `Config` describing how the scrolling feels and how long it takes. A `Config` can be created using an `easing` function and a `duration`.\n\n  - easing: [Easing functions](https://package.elm-lang.org/packages/elm-community/easing-functions/latest)\n    specify the rate of change of a parameter over time.\n\n  - duration: The total duration of the scroll in milliseconds.\n\n```elm\nconfig : Config\nconfig =\n    createConfig Ease.outCubic 100\n```\n\nProvided we know the `y` we want to scroll to (the top of the page or the `y` value of an element found using `Browser.Dom` package for example), scrolling is as easy as passing the position to the `scrollTo` function along with the config.\n\n```elm\nscrollTo config 500\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhiletruu%2Felm-smooth-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhiletruu%2Felm-smooth-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhiletruu%2Felm-smooth-scroll/lists"}