{"id":19425480,"url":"https://github.com/anmolsukki/scratch-win-react","last_synced_at":"2025-07-09T03:10:12.568Z","repository":{"id":234940343,"uuid":"789798301","full_name":"anmolsukki/scratch-win-react","owner":"anmolsukki","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-21T16:08:24.000Z","size":30,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T09:19:55.065Z","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/anmolsukki.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}},"created_at":"2024-04-21T15:30:15.000Z","updated_at":"2024-12-23T03:41:00.000Z","dependencies_parsed_at":"2024-04-21T17:59:22.242Z","dependency_job_id":"e33aad69-69ef-4970-8c3c-90b7dc6ea704","html_url":"https://github.com/anmolsukki/scratch-win-react","commit_stats":null,"previous_names":["anmolsukki/scratch-win-react"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anmolsukki/scratch-win-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmolsukki%2Fscratch-win-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmolsukki%2Fscratch-win-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmolsukki%2Fscratch-win-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmolsukki%2Fscratch-win-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anmolsukki","download_url":"https://codeload.github.com/anmolsukki/scratch-win-react/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmolsukki%2Fscratch-win-react/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264384389,"owners_count":23599612,"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":[],"created_at":"2024-11-10T14:03:35.498Z","updated_at":"2025-07-09T03:10:12.549Z","avatar_url":"https://github.com/anmolsukki.png","language":"JavaScript","readme":"### 👆 Scratch Card React\n\n## 1.Installation\n\n```\nnpm install --save scratch-win-react\n```\n\n```jsx\nimport { useRef } from 'react';\nimport ScratchCard from 'scratch-win-react';\n```\n\n## 2.Usage\n\n```jsx\nconst ref = useRef(null);\n```\n\n```jsx\nconst finishScrashHandler = () =\u003e console.log('event call on finish=====\u003e\u003e');\n```\n\n```jsx\n\u003cScratchCard ref={ref} width={250} height={250} brushSize={20} finishPercent={50} onComplete={() =\u003e finishScrashHandler()} image=\"https://raw.githubusercontent.com/anmolsukki/scratch-win-react/master/src/coupon.png\"\u003e\n  \u003cp\u003ePlay \u0026 Win Game\u003c/p\u003e\n\u003c/ScratchCard\u003e\n```\n\n## Props\n\n| Prop          | Default |   Type   | Description                                                         |\n| ------------- | :-----: | :------: | :------------------------------------------------------------------ |\n| width         |    -    |  Number  | Width of the scratch card in pixels                                 |\n| height        |    -    |  Number  | Height of the scratch card in pixels                                |\n| image         |    -    |  String  | URL or path to the image to be displayed on the scratch card        |\n| brushSize     |    -    |  Number  | Brush Size of the scratch card in pixels                            |\n| brushCursor   |  arrow  |  String  | URL or path to the image to be displayed on the scratch card        |\n| finishPercent |    -    |  Number  | Percentage of the scratch card to be covered for the final layer    |\n| onComplete    |    -    | Function | Callback function to be executed when the scratch card is completed |\n\n\u003cu\u003eNote: Custome Cursor Example\u003c/u\u003e\n\n```jsx\nbrushCursor={\"url('https://raw.githubusercontent.com/anmolsukki/scratch-win-react/master/src/brush-paint.png'),auto\"}\n\n----- OR ----\n\nbrushCursor={\"pointer\"}\n```\n\n---\n\n### Hi there, I'm [Anmol](https://www.linkedin.com/in/anmolsukki/) 👋\n\n[![CodeSandbox](https://img.shields.io/badge/Codesandbox-000000?style=flat-round\u0026logo=CodeSandbox)](https://codesandbox.io/u/anmolsukki)\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?style=flat-round\u0026logo=discord\u0026logoColor=white)](https://discord.gg/zMkSphwHjE)\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[![Linkedin](https://img.shields.io/badge/-LinkedIn-blue?style=flat-round\u0026logo=Linkedin\u0026logoColor=white\u0026link=https://www.linkedin.com/in/anmolsukki/)](https://www.linkedin.com/in/anmolsukki/)\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[![facebook](https://aleen42.github.io/badges/src/facebook.svg)](https://www.facebook.com/Anmolsukki/)\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[![twitter](https://aleen42.github.io/badges/src/twitter.svg)](https://twitter.com/anmolsukki)\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[![Instagram](https://img.shields.io/badge/-Instagram-e4405f?style=flat-round\u0026logo=Instagram\u0026logoColor=white)](https://www.instagram.com/anmolsukki/)\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[![slack](https://aleen42.github.io/badges/src/slack.svg)](https://join.slack.com/t/anmolsukki/shared_invite/zt-k7cfber5-JVl_kGaNdNqvwsMADPiUWg)\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[![stackoverflow](https://aleen42.github.io/badges/src/stackoverflow.svg)](https://stackoverflow.com/users/10825957/anmol-kumar-singh)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmolsukki%2Fscratch-win-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanmolsukki%2Fscratch-win-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmolsukki%2Fscratch-win-react/lists"}