{"id":15669856,"url":"https://github.com/benmarch/hone","last_synced_at":"2025-05-06T20:21:34.004Z","repository":{"id":57266430,"uuid":"86410223","full_name":"benmarch/hone","owner":"benmarch","description":"The best backdrop and element highlighting utility available for modern browsers.","archived":false,"fork":false,"pushed_at":"2018-10-30T19:19:34.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T14:49:44.736Z","etag":null,"topics":["backdrop","highlight","overlay"],"latest_commit_sha":null,"homepage":null,"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/benmarch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-03-28T03:21:59.000Z","updated_at":"2018-10-30T19:19:32.000Z","dependencies_parsed_at":"2022-08-25T03:40:59.338Z","dependency_job_id":null,"html_url":"https://github.com/benmarch/hone","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benmarch%2Fhone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benmarch%2Fhone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benmarch%2Fhone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benmarch%2Fhone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benmarch","download_url":"https://codeload.github.com/benmarch/hone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252761761,"owners_count":21800205,"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":["backdrop","highlight","overlay"],"created_at":"2024-10-03T14:41:29.474Z","updated_at":"2025-05-06T20:21:33.979Z","avatar_url":"https://github.com/benmarch.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hone\n\nHone is the best backdrop and element highlighting utility available for modern browsers.\n\n## Installation\n\nInstall with NPM, Bower, or manually:\n\n```sh\n$ npm install hone -S\n$ bower install hone -S\n```\n\nadd the script tag or import/require:\n\n```html\n\u003cscript src=\"node_modules/hone/dist/hone.js\"\u003e\u003c/script\u003e\n\n\u003cscript src=\"bower_components/hone/dist/hone.js\"\u003e\u003c/script\u003e\n\n\u003cscript src=\"resources/vender/hone.js\"\u003e\u003c/script\u003e\n```\n\n```js\nimport Hone from 'hone';\n\nvar Hone = require('hone');\n```\n\n**There are no dependencies!**\n\n## API\n\n### Instantiate\n\nStart by creating a new `Hone` instance:\n\n```js\nimport Hone from 'hone';\n\nconst lookAtMe = document.getElementById('showOff'),\n    hone = new Hone(lookAtMe);\n```\n\nBy default, when you pass an element to the constructor, the `Hone` instance will become visible immediately.\n\n### Options\n\nThe constructor takes some options as well. Here are the defaults:\n\n```js\nconst defaultOptions = {\n    classPrefix: 'hone',    //all components are given style classes like \"\u003cprefix\u003e-component\"\n    fixed: false,           //set to true if the element is position: fixed\n    borderRadius: 0,        //creates rounded corners (all four or nothing)\n    enabled: true,          //controls the visibility and event listeners\n    padding: '0',           //adds padding around the target, same format as CSS padding rule\n    fullScreen: false       //should the backdrop be full screen (for a modal window)\n};\n```\n\n### Instance Methods\n\nThe `Hone` instance has a minimal public API:\n\n| Method                     | Description                                                            |\n| -------------------------- | ---------------------------------------------------------------------- |\n| `Hone#hide()`              | hides the backdrop                                                     |\n| `Hone#show()`              | shows the backdrop                                                     |\n| `Hone#position(target?)`   | repositions the backdrop, and can position to a new target if provided |\n| `Hone#setOptions(options)` | change instance options                                                |\n| `Hone#destroy()`           | removes all event listeners and DOM elements                           |\n\n## Tips\n\n- If you are going to be repositioning the `Hone` instance frequently, even with new targets, create a single `Hone` instance\nand use the `Hone#position(target)` method to reposition instead of creating new instances for each target. (See example)\n- Both constructor parameters are optional. Not providing a target just disables the `Hone` instance by default.\n- Pass the `enabled` option into the constructor as false to initially hide the `Hone` instance\n\n## Examples\n\nFor an element in a fixed header:\n\n```js\nimport Hone from 'hone';\n\nconst menuItem = document.getElementById('menuItemAbout'),\n    hone = new Hone(menuItem, {\n        fixed: true\n    });\n```\n\nCreating a backdrop behind a modal window:\n\n```js\nimport Hone from 'hone';\n\n//no target required for a full screen Hone instance\nconst hone = new Hone({\n    fullScreen: true\n});\n```\n\nPositioning against a new target:\n\n```js\nimport Hone from 'hone';\n\nconst menuItemAbout = document.getElementById('menuItemAbout'),\n    menuItemContact = document.getElementById('menuItemContact'),\n    hone = new Hone(); //if no target is provided, it instantiates but does not enable\n\n//position against first menu item\nhone.position(menuItemAbout);\n\n//wait for user input maybe? Then position against next menu item\nhone.position(menuItemContact);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenmarch%2Fhone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenmarch%2Fhone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenmarch%2Fhone/lists"}