{"id":13580239,"url":"https://github.com/daybrush/figur","last_synced_at":"2025-09-11T17:12:07.921Z","repository":{"id":57357876,"uuid":"154141554","full_name":"daybrush/figur","owner":"daybrush","description":"Make SVG Polygon \u0026 Star Shape","archived":false,"fork":false,"pushed_at":"2023-05-24T06:44:52.000Z","size":999,"stargazers_count":31,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T06:43:08.030Z","etag":null,"topics":["css","javascript","poly","polygon","shape","star","svg","tri","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/daybrush.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-10-22T12:39:26.000Z","updated_at":"2025-01-21T07:38:26.000Z","dependencies_parsed_at":"2024-02-05T22:04:18.088Z","dependency_job_id":"b97cad78-6782-4235-b98c-2c8d9289583a","html_url":"https://github.com/daybrush/figur","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daybrush%2Ffigur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daybrush%2Ffigur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daybrush%2Ffigur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daybrush%2Ffigur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daybrush","download_url":"https://codeload.github.com/daybrush/figur/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618276,"owners_count":21134200,"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":["css","javascript","poly","polygon","shape","star","svg","tri","typescript"],"created_at":"2024-08-01T15:01:49.051Z","updated_at":"2025-04-19T03:12:17.414Z","avatar_url":"https://github.com/daybrush.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# figur  [![npm version](https://badge.fury.io/js/shape.svg)](https://badge.fury.io/js/figur)\n\n![](./polygon.png)\n\nMake CSS Polygon Shape\n\n* [Polygons \u0026 Stars Demo](https://codepen.io/daybrush/pen/ReYxLy)\n\n```sh\n$ npm install figur\n```\n\n## Options\n```ts\nimport {poly, star} from \"figur\";\n\nimport { CLASS_NAME, STROKE_LINEJOIN } from \"./consts\";\n\nexport interface Shape {\n    left?: number;\n    top?: number;\n    right?: number;\n    bottom?: number;\n    width?: number;\n    heigh?t: number;\n    fill?: string;\n    strokeLinejoin?: STROKE_LINEJOIN;\n    strokeWidth?: number;\n    className?: string;\n    origin?: string | number;\n    [key: string]: any;\n}\nexport interface RoundRectShape extends Shape {\n  round?: number;\n  css?: boolean;\n}\nexport interface PolyShape extends Shape {\n  side?: number;\n  split?: number;\n  css?: boolean;\n  innerRadius?: number;\n}\nexport interface OvalShape extends Shape {\n  r?: number;\n  rx?: number;\n  ry?: number;\n}\n\nexport function getPath(points: number[][]): string;  // path('M 0 0 L 0 0 Z');\nexport function be(path: SVGPathElement, options: PolyShape, container?: SVGElement): void;\nexport function star(options: PolyShape, container?: SVGElement): SVGElement;\nexport function poly(options: PolyShape, container?: SVGElement): SVGElement;\nexport function oval(options: OvalShape, container?: SVGElement): SVGElement;\nexport function rect(options: RoundRectShape, container?: SVGElement): SVGElement;\n```\n\n\n## How to Use\n```html\n\u003cscript src=\"//daybrush.com/figur/release/latest/dist/shape.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"//daybrush.com/figur/release/latest/dist/shape.min.js\"\u003e\u003c/script\u003e\n```\n```js\nimport {poly, star, be} from \"figur\";\n\n// 10 star\n// Shape.poly\nconst el = poly({width: 100, side: 10, strokeWidth: 5, fill: \"transparent\", strokeLinejoin: \"round\"});\n// Shape.star\nconst el = star({width: 100, css: true, side: 10, innerRadius: 30, strokeWidth: 5, strokeLinejoin: \"bavel\"});\n\ndocument.body.appendChild(el);\n\n// Shape.be\n// 10 star =\u003e 5 polygon (split 4)\nbe(el, {width: 100, side: 5, css: true, split: 4, innerRadius: 30, strokeWidth: 5, strokeLinejoin: \"bavel\"});\n\n```\n\n## Animation(Transition)\nuse ```be``` function with ```{css: true}``` or change `d path` syle.\n\nbut ```side``` X ```split``` must be the same to be animated. (```star```(inner-radius) is ```split``` twice)\n\n* ex) poly side: 6\n  * star side: 3\n  * poly side: 3, split: 2\n* ex) poly side: 12, split: 2\n  * star side: 4, split: 3\n  * star side: 3, split: 4\n  * poly side: 6, split: 4\n  * poly side: 24, split: 1","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaybrush%2Ffigur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaybrush%2Ffigur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaybrush%2Ffigur/lists"}