{"id":21076120,"url":"https://github.com/shaack/touch-and-hold-button","last_synced_at":"2026-02-09T01:03:46.897Z","repository":{"id":199052194,"uuid":"701998681","full_name":"shaack/touch-and-hold-button","owner":"shaack","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-11T16:15:52.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-01T10:08:29.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/shaack.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,"zenodo":null}},"created_at":"2023-10-08T07:40:27.000Z","updated_at":"2025-01-11T16:15:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"1679bc66-dc2d-42fa-806d-484d024f5032","html_url":"https://github.com/shaack/touch-and-hold-button","commit_stats":null,"previous_names":["shaack/touch-and-hold-button"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shaack/touch-and-hold-button","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Ftouch-and-hold-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Ftouch-and-hold-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Ftouch-and-hold-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Ftouch-and-hold-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaack","download_url":"https://codeload.github.com/shaack/touch-and-hold-button/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Ftouch-and-hold-button/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29252659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T22:49:53.206Z","status":"ssl_error","status_checked_at":"2026-02-08T22:49:51.384Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-19T19:26:49.757Z","updated_at":"2026-02-09T01:03:46.725Z","avatar_url":"https://github.com/shaack.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# touch-and-hold-button\n\nTransform a HTML button to a touch-and-hold (long press) button.\n\n- Prevent accidental button press with hold confirmation\n- Works with or without Bootstrap\n\n## References\n\n- [Demo page](https://shaack.com/projekte/touch-and-hold-button/)\n- [GitHub repository](https://github.com/shaack/touch-and-hold-button)\n- [npm package](https://www.npmjs.com/package/touch-and-hold-button)\n\n## Usage\n\n```html\n\u003cbutton type=\"submit\" id=\"holdButton\"\u003eHold Me\u003c/button\u003e\n\u003cscript type=\"module\"\u003e\n    import {TouchAndHoldButton} from './src/TouchAndHoldButton.js'\n\n    const buttonElement = document.getElementById('holdButton')\n    const touchAndHoldButton = new TouchAndHoldButton(buttonElement)\n\n    buttonElement.addEventListener('hold', () =\u003e {\n        console.log('`hold` event fired.')\n    })\n    buttonElement.addEventListener('confirm', () =\u003e {\n        console.log('`confirm` event fired.')\n    })\n    buttonElement.addEventListener('cancel', () =\u003e {\n        console.log('`cancel` event fired.')\n    })\n    buttonElement.addEventListener('action', () =\u003e {\n        console.log('`action` event fired.')\n        alert('Button confirmed action')\n    })\n\u003c/script\u003e\n```\n\n### Default props\n\n```javascript\nthis.props = {\n    holdDuration: 1000,\n    fillColor: \"rgba(0,0,0,0.1)\",\n    confirmedShadow: \"0 0 0 5px rgba(0,100,0,0.5)\"\n}\n```\n\n---\n\nFind more high quality modules from [shaack.com](https://shaack.com)\non [our projects page](https://shaack.com/works).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaack%2Ftouch-and-hold-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaack%2Ftouch-and-hold-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaack%2Ftouch-and-hold-button/lists"}