{"id":23651522,"url":"https://github.com/athanclark/elm-duration","last_synced_at":"2025-11-16T02:30:15.022Z","repository":{"id":57674821,"uuid":"59056883","full_name":"athanclark/elm-duration","owner":"athanclark","description":"Issue actions every browser refresh frame, in accordance to some easing function, over a specified time duration.","archived":false,"fork":false,"pushed_at":"2016-12-25T06:28:16.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-28T16:37:59.290Z","etag":null,"topics":["browser-frame","duration","easing-functions","elm"],"latest_commit_sha":null,"homepage":null,"language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/athanclark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-17T20:35:57.000Z","updated_at":"2018-11-27T20:45:13.000Z","dependencies_parsed_at":"2022-09-02T15:01:33.809Z","dependency_job_id":null,"html_url":"https://github.com/athanclark/elm-duration","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Felm-duration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Felm-duration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Felm-duration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Felm-duration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/athanclark","download_url":"https://codeload.github.com/athanclark/elm-duration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239611975,"owners_count":19668272,"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":["browser-frame","duration","easing-functions","elm"],"created_at":"2024-12-28T16:38:09.101Z","updated_at":"2025-11-16T02:30:14.965Z","avatar_url":"https://github.com/athanclark.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Elm-Duration\n\nA helper component for issuing actions every browser frame with some easing functions,\nover some time duration.\n\n```elm\ntype alias MyModel =\n  { someComponent : MyComponent.Model\n  , duration : Duration.Model\n  }\n\ninitMyModel : MyModel\ninitMyModel =\n  { someComponent = MyComponent.init\n  , duration = Duration.init\n  }\n\ntype MyMsg\n  = ComponentMsg MyComponent.Msg\n  | DurationMsg Duration.Msg\n\nupdateMyModel : MyMsg -\u003e MyModel -\u003e (MyModel, Cmd MyMsg)\nupdateMyModel action model =\n  case action of\n    ComponentMsg a -\u003e\n      let (newComponent, eff) = Component.update a model.someComponent\n      in  ( { model | someComponent = newComponent }\n          , Cmd.map ComponentMsg eff\n          )\n    DurationMsg a -\u003e\n      let (newDuration, eff) = Duration.update\n                                 (\\t -\u003e Task.perform Debug.log ComponentMsg \u003c|\n                                          Task.succeed \u003c| MyComponentVisibility \u003c|\n                                            outQuad \u003c| t / (2*second)\n                                 )\n                                 (2 * second)\n                                 a\n                                 model.duration\n      in  ( { model | duration = newDuration }\n          , eff\n          )\n\nsubscriptions : MyModel -\u003e Sub MyMsg\nsubscriptions = Sub.map DurationMsg \u003c| Duration.subscriptions model.duration\n\nview : MyModel -\u003e Html MyMsg\nview model =\n  div []\n    [ viewMyComponent model.someComponent\n    , button [ onClick \u003c| DurationMsg \u003c| Duration.Forward \u003c|\n                            \\_ -\u003e Task.perform Debug.log ComponentMsg \u003c|\n                                    Task.succeed TransitionComplete\n             ] [text \"Start animation\"]\n    ]\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathanclark%2Felm-duration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathanclark%2Felm-duration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathanclark%2Felm-duration/lists"}