{"id":15150483,"url":"https://github.com/prateekbh/liquid-route","last_synced_at":"2025-12-24T16:40:46.518Z","repository":{"id":21044233,"uuid":"91682156","full_name":"prateekbh/liquid-route","owner":"prateekbh","description":"Animated routing FTW","archived":false,"fork":false,"pushed_at":"2022-12-04T03:35:57.000Z","size":9642,"stargazers_count":71,"open_issues_count":12,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-28T09:33:55.304Z","etag":null,"topics":["preact","preact-router"],"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/prateekbh.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-05-18T10:47:14.000Z","updated_at":"2024-01-13T04:38:41.000Z","dependencies_parsed_at":"2023-01-12T03:31:08.927Z","dependency_job_id":null,"html_url":"https://github.com/prateekbh/liquid-route","commit_stats":null,"previous_names":["prateekbh/liquid"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prateekbh%2Fliquid-route","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prateekbh%2Fliquid-route/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prateekbh%2Fliquid-route/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prateekbh%2Fliquid-route/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prateekbh","download_url":"https://codeload.github.com/prateekbh/liquid-route/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237763855,"owners_count":19362310,"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":["preact","preact-router"],"created_at":"2024-09-26T14:04:45.287Z","updated_at":"2025-10-24T06:31:20.627Z","avatar_url":"https://github.com/prateekbh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Liquid-route\n```\n  npm i -D liquid-route\n```\nThis is a collection of route element and animation objects based on [`element.animate`](https://developer.mozilla.org/en-US/docs/Web/API/Element/animate). Which will make it super easy for you to do animated routing.\n\nThis mainly consist of the following animation objects\n\n1. FadeAnimation: Next route will fade in and current will fade out.\n2. PopAnimation: Next route will pop from center and current route will implode.\n3. SlideLeftAnimation: Next route will slide from right while current one slides to left.\n4. PushNSlideAnimation: Routes will scale down and slide.\n5. AppearFromBottomAnimation: Next route will fade and appear from bottom and sit on top of current route.\n6. AppearFromRightAnimation: Next route will fade and appear from right and sit on top of current route.\n\n## Sample\n![sample usage of liquid-route](/sample/liquid-ruoter.gif)\n\n## Route element\n`liquid-route` is the route component which you would need to use in order animate between routes. It takes a prop named animator which is a animation object\n\n```jsx\n  import Router from 'preact-router';\n  import LiquidRoute, {FadeAnimation, PopAnimation} from 'liquid-route';\n  import 'liquid-route/style.css';\n  import Home from './Components/Home/Home.jsx';\n  .\n  .\n  .\n  return (\n    \u003cRouter\u003e\n      \u003cLiquidRoute animator={FadeAnimation} path=\"/\" component={Home}/\u003e\n      \u003cLiquidRoute animator={PopAnimation} path=\"/profile\" getComponent={()=\u003e{\n        return System.import('./Components/Profile/Profile.jsx').then(module =\u003e module.default);\n      }}/\u003e\n      \u003cLiquidRoute animator={PopAnimation} path=\"/profile/:pid\" getComponent={()=\u003e{\n        return System.import('./Components/Profile/Profile.jsx').then(module =\u003e module.default);\n      }}/\u003e\n    \u003c/Router\u003e\n  );\n```\n\n## Animator object\n`Animator` object is a javascript object which exposes two methods\n1. `getEntryAnimation` - returns animation object used to play entry animation of a route\n2. `getExitAnimation` - returns animation object used to playexitentry animation of a route\n\nBoth of the above ☝ methods return an object having the following properties\na. animation: array of animation object used to play the entry/exit effect\nb. options: an object of options taken by [`element.animate`](https://developer.mozilla.org/en-US/docs/Web/API/Element/animate) api.\n\n## Browser Compatability\nAccording to [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/animate#Browser_compatibility) Web Animation is still in working draft status and only a few browsers support it, however there's a [polyfill](https://github.com/web-animations/web-animations-js) might come in handy.\n\n## Inspiration\nWhile some basic animator objects come with the bundle, [here](https://tympanus.net/Development/PageTransitions/) is where the most of the transition inspiriation is drawn from.\n\n## You creative?\nSend PR if you wanna add new animators in the repo, happy to include 😊.\n\n### Note\nIn order for the transitions to work, please declare all routes as `liquid-route`.\n\n\n**P.S.** Tried and tested most of the animations are easily doable with this route element.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprateekbh%2Fliquid-route","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprateekbh%2Fliquid-route","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprateekbh%2Fliquid-route/lists"}