{"id":15161397,"url":"https://github.com/echobind/ember-links-with-follower","last_synced_at":"2025-10-04T22:06:08.607Z","repository":{"id":57159348,"uuid":"59850111","full_name":"echobind/ember-links-with-follower","owner":"echobind","description":"Render a set of links with a \"follower\" line underneath. The follower moves to the active link, matching size and position on the page.","archived":false,"fork":false,"pushed_at":"2018-10-04T06:07:14.000Z","size":3223,"stargazers_count":45,"open_issues_count":24,"forks_count":2,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-09-29T06:21:49.961Z","etag":null,"topics":["addon","animation","ember"],"latest_commit_sha":null,"homepage":"https://echobind.github.io/ember-links-with-follower","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/echobind.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-27T16:57:27.000Z","updated_at":"2024-05-30T02:28:13.000Z","dependencies_parsed_at":"2022-09-08T10:40:20.108Z","dependency_job_id":null,"html_url":"https://github.com/echobind/ember-links-with-follower","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echobind%2Fember-links-with-follower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echobind%2Fember-links-with-follower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echobind%2Fember-links-with-follower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echobind%2Fember-links-with-follower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/echobind","download_url":"https://codeload.github.com/echobind/ember-links-with-follower/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219867829,"owners_count":16555886,"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":["addon","animation","ember"],"created_at":"2024-09-27T00:05:44.847Z","updated_at":"2025-10-04T22:06:08.526Z","avatar_url":"https://github.com/echobind.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ember-links-with-follower\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/echobind/ember-links-with-follower.svg)](https://greenkeeper.io/)\n\n[![CircleCI](https://circleci.com/gh/echobind/ember-links-with-follower.svg?style=svg)](https://circleci.com/gh/echobind/ember-links-with-follower)\n[![npm version](https://badge.fury.io/js/ember-links-with-follower.svg)](http://badge.fury.io/js/ember-links-with-follower)\n[![Code Climate](https://codeclimate.com/github/echobind/ember-links-with-follower/badges/gpa.svg)](https://codeclimate.com/github/echobind/ember-links-with-follower)\n[![Dependency Status](https://david-dm.org/echobind/ember-links-with-follower.svg)](https://david-dm.org/echobind/ember-links-with-follower)\n[![Ember Observer Score](http://emberobserver.com/badges/ember-links-with-follower.svg)](http://emberobserver.com/addons/ember-links-with-follower)\n\n## Features\nProvides a component that renders a set of links with a follower line underneath. The follower will animate to the position of the active link, and grow or shrink in size if needed. If no active links are found, the follower will hide.\n\nThis pattern is commonly used for navigation:\n\n![twitter](https://raw.githubusercontent.com/echobind/ember-links-with-follower/master/public/assets/images/twitter.png)\n\n(from Twitter app)\n\n![linkedin](https://raw.githubusercontent.com/echobind/ember-links-with-follower/master/public/assets/images/linkedin.png)\n\n(from LinkedIn app)\n\nAnimation of the follower is done through CSS [transition](https://developer.mozilla.org/en-US/docs/Web/CSS/transition) and [transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform) using [translate3d](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function#translate3d()). The transitions duration will be set to 0 on window resize to avoid issues with animating while resizing.\n\nSince Links with Follower hooks in to the Router's `willTransition` event, you can use `link-to` or `transitionTo` and the follower will still update properly.\n\n## Installation\n\n```\nember install ember-links-with-follower\n```\n\n## Usage\nRender links with default behavior (links passed in the block are expected to be li's):\n\n```hbs\n{{#links-with-follower class=\"my-nav\"}}\n  {{#link-to 'Home' tagName='li'}}Home{{/link-to}}\n  {{#link-to 'Stuff' tagName='li'}}Stuff{{/link-to}}\n{{/links-with-follower}}\n```\n\nRender custom tags, change the active selector, and animate slowly:\n\n```hbs\n{{#links-with-follower\n  containerTagName=\"section\"\n  linkTagName=\"div\"\n  activeSelector=\"selected\"\n  followerAnimationDuration=1000}}\n\n  {{#link-to \"Home\" tagName=\"div\"}}Home{{/link-to}}\n  {{#link-to \"Stuff\" tagName=\"div\"}}Stuff{{/link-to}}\n\n{{/links-with-follower}}\n```\n\nCustomize the follower with css:\n\n```css\n.my-nav .link-follower {\n  border-color: tomato;\n  border-size: 3px;\n}\n```\n\n## How does this work?\nA listener is added to the `router`'s `willTransition` event. On `willTransition`, we look for an active link in the links provided to the component via block format.\n\nAn active link is defined by the `activeSelector` property, which defaults to `'li.active:not(li.ember-transitioning-out), li.ember-transitioning-in'`. This allows us to eagerly transition the follower before the route has fully transitioned.\n\n\n## Helpful Links\n\n- ### [Demo](https://echobind.github.io/ember-links-with-follower)\n\n- ### [Changelog](CHANGELOG.md)\n\n- ### [Docs](https://echobind.github.io/ember-links-with-follower/docs/classes/LinksWithFollower.html)\n\n## Legal\n[Echobind](https://echobind.com) LLC (c) 2016\n[@echobind](https://twitter.com/echobind)\n[Licensed under the MIT license](http://www.opensource.org/licenses/mit-license.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechobind%2Fember-links-with-follower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fechobind%2Fember-links-with-follower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechobind%2Fember-links-with-follower/lists"}