{"id":20762032,"url":"https://github.com/donkeyclip/motorcortex-leonsans","last_synced_at":"2025-04-30T06:29:06.429Z","repository":{"id":37396280,"uuid":"222386817","full_name":"donkeyclip/motorcortex-leonsans","owner":"donkeyclip","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-24T16:05:51.000Z","size":40364,"stargazers_count":0,"open_issues_count":16,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-25T23:20:55.519Z","etag":null,"topics":["leonsans","motorcortex","motorcortex-plugin"],"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/donkeyclip.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2019-11-18T07:21:05.000Z","updated_at":"2022-04-01T08:44:17.000Z","dependencies_parsed_at":"2024-02-07T07:24:40.255Z","dependency_job_id":"c45f9840-6d18-4725-b0a6-339b5095b37b","html_url":"https://github.com/donkeyclip/motorcortex-leonsans","commit_stats":{"total_commits":818,"total_committers":15,"mean_commits":54.53333333333333,"dds":0.5305623471882641,"last_synced_commit":"f22d913e8b9adc4c8c7056ccd549e1729a1cea55"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donkeyclip%2Fmotorcortex-leonsans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donkeyclip%2Fmotorcortex-leonsans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donkeyclip%2Fmotorcortex-leonsans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donkeyclip%2Fmotorcortex-leonsans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donkeyclip","download_url":"https://codeload.github.com/donkeyclip/motorcortex-leonsans/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225026527,"owners_count":17409248,"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":["leonsans","motorcortex","motorcortex-plugin"],"created_at":"2024-11-17T10:28:46.693Z","updated_at":"2024-11-17T10:28:47.278Z","avatar_url":"https://github.com/donkeyclip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MotorCortex-LeonSans\n\n**Table of Contents**\n\n- [MotorCortex-LeonSans](#motorcortex-leonsans)\n  - [Demo](#demo)\n- [Intro / Features](#intro--features)\n- [Getting Started](#getting-started)\n  - [Installation](#installation)\n  - [Importing and Loading](#importing-and-loading)\n- [Creating Incidents](#creating-incidents)\n  - [LeonSans Clip](#leonsans-clip)\n  - [LeonIncident](#leonincident)\n- [Adding Incidents in your clip](#adding-incidents-in-your-clip)\n- [Contributing](#contributing)\n- [License](#license)\n- [Sponsored by](#sponsored-by)\n\n## Demo\n\n[Check it out here](https://donkeyclip.github.io/motorcortex-leonsans/demo/)\n\n# Intro / Features\nMotorCortex-LeonSans brings some capabilities of [LeonSans](https://github.com/cmiscm/leonsans#readme) library into MotorCortex. With LeonSans plugin you can render exquisite text anywhere in your clip.\n\nThis Plugin exposes two Incidents:\n- LeonSans Clip\n- LeonIncident\n\n# Getting Started\n\n## Installation\n\n```bash\n$ npm install --save @donkeyclip/motorcortex-leonsans\n# OR\n$ yarn add @donkeyclip/motorcortex-leonsans\n```\n\n## Importing and loading\n\n```javascript\nimport { loadPlugin } from \"@donkeyclip/motorcortex/\";\nimport LeonPlugin from \"@donkeyclip/motorcortex-leonsans\";\nconst LeonSans = loadPlugin(LeonPlugin);\n```\n# Creating Incidents\n\n## LeonSans Clip\n\nBy the use of the plugin's `Clip` you can render a canvas which will host your text.\n\nThe `Clip` takes a number of attributes (listed below) that define both the canvas and the rendered text characteristics and it can accept an unlimited number of `LeonSans` Incidents that can animate the rendered text.\n\n### Example\n\n```javascript\nconst clipName = new LeonSans.Clip(\n  {\n    canvasId: \"leonObj\",\n    sw: 800,\n    sh: 600,\n    text: \"abcdefghijklmn\\nopqrstuvwxyz\",\n    weight: 100,\n    round: true,\n    multiply: true,\n    drawing: \"colorful\",\n    color: [[\"#64d3ce\", \"#2a92ce82\", \"#2a92ce40\", \"#2a92ce2e\", \"#2a92ce00\"]],\n    colorful: [\"#64d3ce\", \"#2a92ce82\", \"#2a92ce40\", \"#2a92ce2e\", \"#2a92ce00\"],\n    pathGap: -1,\n    patternWidth: 1,\n    patternHeight: 10,\n    speed: 1,\n    tracking: 20,\n    leading: 10,\n    size: 80,\n  },\n  {\n    selector: \".test\",\n  }\n);\n```\n\n### LeonSans Clip Attrs\n\n| Name          |                                                                                   Are                                                                                   |                                                   Values |\n| ------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -------------------------------------------------------: |\n| canvasId      | the id of the rendered canvas that contains the text. This id will be used by all `LeonIncident` Incidents, added to the `Clip` timeline, via their `selector` property |                                                   string |\n| sw            |                                                                 width of clip canvas (how many pixels)                                                                  |                                     all positive numbers |\n| sh            |                                                                 height of clip canvas (how many pixels)                                                                 |                                     all positive numbers |\n| text          |                                                                           the text to display                                                                           |                                                   string |\n| weight        |                                                                         The weight of the font                                                                          |                                           number 1 - 900 |\n| round         |                                                             round the corners of font if they are not path                                                              |                                                  boolean |\n| multiply      |                                                      applying multiply effect when the font has more then 1 colors                                                      |                                                  boolean |\n| drawing       |                                                                         type of the font effect                                                                         | one of: `drawing`, `pattern`, `colorful`, `colorPattern` |\n| color         |                                                                      The colors of the characters                                                                       |                                array of arrays of colors |\n| colorful      |                                        The list of colors of each character. Only applicable if drawing property is `colorfull`                                         |                                          array of colors |\n| pathGap       |                                                The gap between each coordinate of the points on a line of each character                                                |                                                   number |\n| patternWidth: |                                                        the width of the lines when drawing property is `pattern`                                                        |                                                   number |\n| patternHeight |                                                       the height of the lines when drawing property is `pattern`                                                        |                                                   number |\n| speed         |                                                     speed of color changing when drawing property is `colorPattern`                                                     |                                     number, from 0 to 10 |\n| tracking      |                                                          The spacing between the characters of a block of text                                                          |                                                   number |\n| leading       |                                                                 The distance between each line of text                                                                  |                                                   number |\n| size          |                                                                              size of text                                                                               |                                                   number |\n\n## LeonIncident\n\n### Example\n\n```javascript\nconst nameOfIncident = new LeonSans.LeonIncident(\n  {\n    animatedAttrs: {\n      LeonAtrs: {\n        completion_rate: 1,\n        weight: 600,\n        // tracking: 20,\n        leading: 10,\n        // size: 90,\n        // pathGap: 1,\n        patternWidth: 100,\n        // patternHeight: 90\n      },\n    },\n    initialValues: {\n      LeonAtrs: {\n        completion_rate: 0,\n        weight: 100,\n        // tracking: 10,\n        // leading: 1,\n        size: 80,\n        // pathGap: 0,\n        patternWidth: 1,\n        // patternHeight: 10\n      },\n    },\n  },\n  {\n    duration: 2000,\n    selector: \"!#leonObj\",\n  }\n);\n```\n\n### LeonIncident Attrs\n\nThe `LeonIncident` attrs takes on the `animatedAttrs` object just one composite attribute: `LeonAtrs`. The supported attributes of this composite attribute are:\n\n| Name            |                                    Are                                    |          Values |\n| --------------- | :-----------------------------------------------------------------------: | --------------: |\n| completion_rate |                        The rate of text completion                        | num from 0 to 1 |\n| weight          |                      The weight of the font: 1 - 900                      |          number |\n| pathGap         | The gap between each coordinate of the points on a line of each character |          number |\n| patternWidth:   |         the width of the lines when drawing property is `pattern`         |          number |\n| patternHeight   |        the height of the lines when drawing property is `pattern`         |          number |\n| tracking        |           The spacing between the characters of a block of text           |          number |\n| leading         |                  The distance between each line of text                   |          number |\n| size            |                               size of text                                |          number |\n\n#### IMPORTANT\nAlong with the attributes, all `LeonIncident` incidents must take on their props the `selector` key which targets the canvas id of their parent Clip via the convention: `!#\u003ccanvasId\u003e`\n\n# Adding Incidents in your clip\n\n```javascript\nclipName.addIncident(incidentName,startTime);\n```\n\n# Contributing \n\nIn general, we follow the \"fork-and-pull\" Git workflow, so if you want to submit patches and additions you should follow the next steps:\n1.\t**Fork** the repo on GitHub\n2.\t**Clone** the project to your own machine\n3.\t**Commit** changes to your own branch\n4.\t**Push** your work back up to your fork\n5.\tSubmit a **Pull request** so that we can review your changes\n\n# License\n\n[MIT License](https://opensource.org/licenses/MIT)\n\n# Sponsored by\n[\u003cimg src=\"https://presskit.donkeyclip.com/logos/donkey%20clip%20logo.svg\" width=250\u003e\u003c/img\u003e](https://donkeyclip.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonkeyclip%2Fmotorcortex-leonsans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonkeyclip%2Fmotorcortex-leonsans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonkeyclip%2Fmotorcortex-leonsans/lists"}