{"id":21195637,"url":"https://github.com/qiqiboy/sketch","last_synced_at":"2025-07-10T04:30:30.849Z","repository":{"id":25025058,"uuid":"28444478","full_name":"qiqiboy/sketch","owner":"qiqiboy","description":"Just a HTML5 sketch-pad. ","archived":false,"fork":false,"pushed_at":"2022-02-08T12:51:18.000Z","size":112,"stargazers_count":10,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-27T18:58:20.075Z","etag":null,"topics":["canvas","draw-graphics","html5-sketch-pad","javascript-library","sketch"],"latest_commit_sha":null,"homepage":"http://github.boy.im/sketch/","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/qiqiboy.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}},"created_at":"2014-12-24T09:46:26.000Z","updated_at":"2023-02-20T16:28:39.000Z","dependencies_parsed_at":"2022-09-13T21:10:49.873Z","dependency_job_id":null,"html_url":"https://github.com/qiqiboy/sketch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/qiqiboy/sketch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiqiboy%2Fsketch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiqiboy%2Fsketch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiqiboy%2Fsketch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiqiboy%2Fsketch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qiqiboy","download_url":"https://codeload.github.com/qiqiboy/sketch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiqiboy%2Fsketch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263754368,"owners_count":23506180,"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":["canvas","draw-graphics","html5-sketch-pad","javascript-library","sketch"],"created_at":"2024-11-20T19:29:23.500Z","updated_at":"2025-07-10T04:30:30.593Z","avatar_url":"https://github.com/qiqiboy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sketch Lite\n\nJust a HTML5 sketch-pad based on canvas.\n简易 H5 画板，支持绘画与擦除\n\n[English Document](./en/README.md)\n\n## 安装\n\n```bash\n# Use npm\n$ npm install sketch-lite --save\n# Use Yarn\n$ yarn add sketch-lite\n```\n\n## 如何使用\n\n```javascript\nvar SketchLite = require('sketch-lite');\n\n// @Class Sketch\n// @param String|HTMLCanvasElement id canvas节点id或者该对象\n// @param Object config 初始画板配置\n//                      .width int 画板宽度\n//                      .height int 画板高度\n//                      .lineWidth int 笔画宽度\n//                      .color 笔画颜色\n//                      .bgcolor 背景颜色\n//                      .multi 是否支持多指同时绘画\n\nvar sketch=new SketchLite('canvas',{\n    width:document.body.clientWidth,\n    height:document.body.clientHeight,\n    bgcolor:'transparent'\n    lineWidth:5,\n    color:'red',\n    multi:false\n});\n\n// @event\n// start 开始绘画\n// move 绘画中\n// end 绘画结束\n\nsketch.on('start',function(){\n\tconsole.log('开始绘画');\n});\nsketch.on('move',function(){\n\tconsole.log('绘画中');\n});\nsketch.on('end',function(){\n\tconsole.log('绘画结束');\n});\n\n// @method\nsketch.clear(); //清除画布重新开始\nsketch.cancel(num); //上一步，num为取消步数，默认为1\nsketch.toDataUrl(type); //转为dataUrl数据\nsketch.toBlob(callback,type); //生成blob对象（不支持ie9-）\n\n// 更改笔画宽度、颜色\nsketch.lineWidth=10;\nsketch.color='green';\n\n// erase擦除\nsketch.erase=true; //该属性为true时表示是擦除状态\n```\n\n## DEMO\n\nhttp://github.boy.im/sketch/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiqiboy%2Fsketch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqiqiboy%2Fsketch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiqiboy%2Fsketch/lists"}