{"id":18614929,"url":"https://github.com/andrewjbateman/javascript-link-following","last_synced_at":"2025-11-03T03:30:31.259Z","repository":{"id":96860597,"uuid":"161022684","full_name":"AndrewJBateman/javascript-link-following","owner":"AndrewJBateman","description":":clipboard: Code to highlight anchor tags as they are scrolled over. Tutorial 22 of Web Bos Javascript30 series. ","archived":false,"fork":false,"pushed_at":"2020-08-10T15:57:57.000Z","size":1052,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T02:44:58.038Z","etag":null,"topics":["css3","html5","javascript30"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/AndrewJBateman.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-09T09:10:55.000Z","updated_at":"2022-01-11T22:14:53.000Z","dependencies_parsed_at":"2023-03-30T11:37:11.930Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/javascript-link-following","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-link-following","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-link-following/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-link-following/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-link-following/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/javascript-link-following/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239406449,"owners_count":19633024,"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":["css3","html5","javascript30"],"created_at":"2024-11-07T03:27:26.609Z","updated_at":"2025-11-03T03:30:30.988Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap: Javascript Link Following\n\n* Wes Bos Youtube Tutorial: [JavaScript Exercise: Follow Along Links - #JavaScript30 22/30](https://www.youtube.com/watch?v=POP_qri7RA8\u0026list=PLu8EoSxDXHP6CGK4YVJhL_VWetA865GOH\u0026index=22).\n\n*** Note: to open web links in a new window use: _ctrl+click on link_**\n\n## :page_facing_up: Table of contents\n\n* [General info](#general-info)\n* [Screenshots](#screenshots)\n* [Technologies](#technologies)\n* [Setup](#setup)\n* [Features](#features)\n* [Status](#status)\n* [Inspiration](#inspiration)\n* [Contact](#contact)\n\n## :books: General info\n\n* Tutorial Code to highlight anchor tags as they are scrolled over.\n\n## :camera: Screenshots\n\n![Example screenshot](./img/scroll.png).\n\n## :signal_strength: Technologies\n\n* [Javascript v1.9 ECMA-262 ECMAScript 2018](http://www.ecma-international.org/publications/standards/Ecma-262.htm)\n\n## :floppy_disk: Setup\n\n* Open index.html in browser. If any code is changed the browser needs to be refreshed.\n\n## :computer: Code Examples\n\n*  determine position and dimensions of highlighting box. \n\n```javascript\nhighlightLink = () =\u003e {\n  const linkCoords = this.getBoundingClientRect();\n  console.log(linkCoords);\n  const coords = {\n    width: linkCoords.width,\n    height: linkCoords.height,\n    top: linkCoords.top + window.scrollY,\n    left: linkCoords.left + window.scrollX\n  };\n  \n  highlight.style.width = `${coords.width}px`;\n  highlight.style.height = `${coords.height}px`;\n  highlight.style.transform = `translate(${coords.left}px, ${coords.top}px)`;\n};\n```\n\n## :cool: Features\n\n*  Includes scroll position in the equation so hightlighting is in the correct position even after scrolling.\n\n## :clipboard: Status \u0026 To-Do List\n\n* Status: Working.\n* To-Do: Could add additional highlighting of 'p's for example in a different colour.\n\n## :clap: Inspiration\n\n* Wes Bos Youtube Tutorial: [JavaScript Exercise: Follow Along Links - #JavaScript30 22/30](https://www.youtube.com/watch?v=POP_qri7RA8\u0026list=PLu8EoSxDXHP6CGK4YVJhL_VWetA865GOH\u0026index=22)\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://www.andrewbateman.org) * you are welcome to [send me a message](https://andrewbateman.org/contact)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fjavascript-link-following","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fjavascript-link-following","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fjavascript-link-following/lists"}