GithubHelp home page GithubHelp logo

motorcortex-leonsans's Introduction

MotorCortex-LeonSans

Table of Contents

Demo

Check it out here

Intro / Features

MotorCortex-LeonSans brings some capabilities of LeonSans library into MotorCortex. With LeonSans plugin you can render exquisite text anywhere in your clip.

This Plugin exposes two Incidents:

  • LeonSans Clip
  • LeonIncident

Getting Started

Installation

$ npm install --save @donkeyclip/motorcortex-leonsans
# OR
$ yarn add @donkeyclip/motorcortex-leonsans

Importing and loading

import { loadPlugin } from "@donkeyclip/motorcortex/";
import LeonPlugin from "@donkeyclip/motorcortex-leonsans";
const LeonSans = loadPlugin(LeonPlugin);

Creating Incidents

LeonSans Clip

By the use of the plugin's Clip you can render a canvas which will host your text.

The 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.

Example

const clipName = new LeonSans.Clip(
  {
    canvasId: "leonObj",
    sw: 800,
    sh: 600,
    text: "abcdefghijklmn\nopqrstuvwxyz",
    weight: 100,
    round: true,
    multiply: true,
    drawing: "colorful",
    color: [["#64d3ce", "#2a92ce82", "#2a92ce40", "#2a92ce2e", "#2a92ce00"]],
    colorful: ["#64d3ce", "#2a92ce82", "#2a92ce40", "#2a92ce2e", "#2a92ce00"],
    pathGap: -1,
    patternWidth: 1,
    patternHeight: 10,
    speed: 1,
    tracking: 20,
    leading: 10,
    size: 80,
  },
  {
    selector: ".test",
  }
);

LeonSans Clip Attrs

Name Are Values
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
sw width of clip canvas (how many pixels) all positive numbers
sh height of clip canvas (how many pixels) all positive numbers
text the text to display string
weight The weight of the font number 1 - 900
round round the corners of font if they are not path boolean
multiply applying multiply effect when the font has more then 1 colors boolean
drawing type of the font effect one of: drawing, pattern, colorful, colorPattern
color The colors of the characters array of arrays of colors
colorful The list of colors of each character. Only applicable if drawing property is colorfull array of colors
pathGap The gap between each coordinate of the points on a line of each character number
patternWidth: the width of the lines when drawing property is pattern number
patternHeight the height of the lines when drawing property is pattern number
speed speed of color changing when drawing property is colorPattern number, from 0 to 10
tracking The spacing between the characters of a block of text number
leading The distance between each line of text number
size size of text number

LeonIncident

Example

const nameOfIncident = new LeonSans.LeonIncident(
  {
    animatedAttrs: {
      LeonAtrs: {
        completion_rate: 1,
        weight: 600,
        // tracking: 20,
        leading: 10,
        // size: 90,
        // pathGap: 1,
        patternWidth: 100,
        // patternHeight: 90
      },
    },
    initialValues: {
      LeonAtrs: {
        completion_rate: 0,
        weight: 100,
        // tracking: 10,
        // leading: 1,
        size: 80,
        // pathGap: 0,
        patternWidth: 1,
        // patternHeight: 10
      },
    },
  },
  {
    duration: 2000,
    selector: "!#leonObj",
  }
);

LeonIncident Attrs

The LeonIncident attrs takes on the animatedAttrs object just one composite attribute: LeonAtrs. The supported attributes of this composite attribute are:

Name Are Values
completion_rate The rate of text completion num from 0 to 1
weight The weight of the font: 1 - 900 number
pathGap The gap between each coordinate of the points on a line of each character number
patternWidth: the width of the lines when drawing property is pattern number
patternHeight the height of the lines when drawing property is pattern number
tracking The spacing between the characters of a block of text number
leading The distance between each line of text number
size size of text number

IMPORTANT

Along 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: !#<canvasId>

Adding Incidents in your clip

clipName.addIncident(incidentName,startTime);

Contributing

In general, we follow the "fork-and-pull" Git workflow, so if you want to submit patches and additions you should follow the next steps:

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

License

MIT License

Sponsored by

motorcortex-leonsans's People

Contributors

alexdor avatar andreas-trad avatar dependabot[bot] avatar elisavetampatzidou avatar github-actions[bot] avatar ivanvl01 avatar kissmybutton-bot avatar prieston avatar renovate-bot avatar renovate[bot] avatar

Watchers

 avatar  avatar  avatar  avatar

motorcortex-leonsans's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

File: renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid configuration option: separateMajorReleases

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): replace dependency eslint-plugin-node with eslint-plugin-n 14.0.0
  • chore(deps): replace dependency rollup-plugin-terser with @rollup/plugin-terser 0.1.0
  • chore(deps): update dependency caniuse-lite to v1.0.30001612
  • chore(deps): update dependency webpack-dev-server to v4.15.2
  • chore(deps): update babel monorepo (@babel/cli, @babel/core, @babel/eslint-parser, @babel/plugin-syntax-jsx, @babel/preset-env)
  • chore(deps): update dependency @donkeyclip/motorcortex to v9.17.0
  • chore(deps): update dependency browserslist to v4.23.0
  • chore(deps): update dependency core-js to v3.37.0
  • chore(deps): update dependency eslint to v8.57.0
  • chore(deps): update dependency webpack to v5.91.0
  • chore(deps): update reviewdog/action-eslint action to v1.24.0
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency eslint-config-prettier to v9
  • chore(deps): update dependency eslint-plugin-prettier to v5
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency lint-staged to v15
  • chore(deps): update dependency prettier to v3
  • chore(deps): update dependency rollup to v4
  • chore(deps): update dependency webpack-dev-server to v5
  • chore(deps): update googlecloudplatform/release-please-action action to v4
  • chore(deps): update peaceiris/actions-gh-pages action to v4
  • chore(deps): update peter-evans/create-pull-request action to v6
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/bundle-size.yml
  • actions/checkout v3.6.0
  • actions/setup-node v3.8.2
  • pkg-size/action v1
.github/workflows/eslint.yml
  • actions/checkout v3.6.0
  • reviewdog/action-eslint v1.22.0
.github/workflows/github-page.yml
  • actions/checkout v3.6.0
  • actions/setup-node v3.8.2
  • peaceiris/actions-gh-pages v3.9.3
.github/workflows/misspell.yml
  • actions/checkout v3.6.0
  • sobolevn/misspell-fixer-action 0.1.0
  • peter-evans/create-pull-request v3.14.0
.github/workflows/release-please.yml
  • actions/checkout v3.6.0
  • GoogleCloudPlatform/release-please-action v3.7.13
  • actions/checkout v3.6.0
  • actions/setup-node v3.8.2
.github/workflows/test.yaml
  • actions/checkout v3.6.0
  • actions/setup-node v3.8.2
npm
package.json
  • @babel/cli 7.23.9
  • @babel/core 7.23.9
  • @babel/eslint-parser 7.23.10
  • @babel/plugin-syntax-jsx 7.23.3
  • @babel/plugin-transform-react-jsx 7.23.4
  • @babel/preset-env 7.23.9
  • @donkeyclip/motorcortex 9.14.0
  • @donkeyclip/motorcortex-player 2.10.11
  • @rollup/plugin-babel 5.3.1
  • @rollup/plugin-commonjs 22.0.2
  • @rollup/plugin-json 4.1.0
  • @rollup/plugin-node-resolve 13.3.0
  • babel-loader 8.3.0
  • browserslist 4.22.3
  • caniuse-lite 1.0.30001582
  • concurrently 7.6.0
  • core-js 3.35.1
  • eslint 8.56.0
  • eslint-config-prettier 8.10.0
  • eslint-plugin-babel 5.3.1
  • eslint-plugin-import 2.29.1
  • eslint-plugin-node 11.1.0
  • eslint-plugin-prettier 4.2.1
  • eslint-plugin-promise 6.1.1
  • hammerjs 2.0.8
  • husky 8.0.3
  • lint-staged 13.3.0
  • prettier 2.8.8
  • rimraf 3.0.2
  • rollup 2.79.1
  • rollup-plugin-terser 7.0.2
  • tslib 2.6.2
  • webpack 5.90.1
  • webpack-cli 4.10.0
  • webpack-dev-server 4.15.1
  • node >=8.3.2

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.