{"id":22367805,"url":"https://github.com/mystroken/canvas","last_synced_at":"2025-03-26T15:53:24.267Z","repository":{"id":57129004,"uuid":"206610646","full_name":"mystroken/canvas","owner":"mystroken","description":":kiwi_fruit: Object oriented canvas 2D rendering in JavaScript.","archived":false,"fork":false,"pushed_at":"2020-02-09T05:41:15.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T09:39:20.796Z","etag":null,"topics":["canvas","canvas2d","javascript-oop"],"latest_commit_sha":null,"homepage":"","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/mystroken.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2019-09-05T16:35:09.000Z","updated_at":"2020-02-09T05:41:17.000Z","dependencies_parsed_at":"2022-08-31T18:33:47.162Z","dependency_job_id":null,"html_url":"https://github.com/mystroken/canvas","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mystroken%2Fcanvas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mystroken%2Fcanvas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mystroken%2Fcanvas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mystroken%2Fcanvas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mystroken","download_url":"https://codeload.github.com/mystroken/canvas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245689500,"owners_count":20656416,"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","canvas2d","javascript-oop"],"created_at":"2024-12-04T18:21:28.400Z","updated_at":"2025-03-26T15:53:24.235Z","avatar_url":"https://github.com/mystroken.png","language":"JavaScript","readme":"# Canvas\n\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/mystroken/canvas/issues)\n\n\u003e :kiwi_fruit: Object oriented canvas 2D rendering in JavaScript.\n\n\u003cbr\u003e\n\n## Installation\n\n```bash\nnpm install @mystroken/canvas\n```\n\n\u003cbr\u003e\n\n## Usage\n\nLook at the sources files for more information.\n\n###### Import\n\n```javascript\n\nimport Canvas from '@mystroken/canvas';\nimport Renderable from '@mystroken/canvas/Renderable'; \n```\n\n###### Create a renderable.\n\n```javascript\nclass Circle extends Renderable {\n\n    render(ctx) {\n        ctx.beginPath();\n        ctx.arc(110, 110, 25, Math.PI * 2, false);\n        ctx.closePath();\n\n        ctx.stroke();\n    }\n}\n```\n\n###### Add renderables on the canvas.\n\n```javascript\nconst canvas = new Canvas(document.querySelector('#canvas'));\ncanvas.resize(window.innerWidth, window.innerHeight);\n\n// Get some renderables.\nconst circle = new Circle();\nconst rect = new Rectangle();\n\n// Adds renderables to canvas.\ncanvas.add(circle);\ncanvas.add(rect);\n\n// Render the canvas.\ncanvas.render();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmystroken%2Fcanvas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmystroken%2Fcanvas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmystroken%2Fcanvas/lists"}