All Projects → mojs → Mojs Curve Editor

mojs / Mojs Curve Editor

Licence: mit
GUI for live easing/property curves editing

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Mojs Curve Editor

Mojs Timeline Editor
GUI for interactive `html`/`custom points`/`timeline` editing while crafting your animations
Stars: ✭ 215 (+9.69%)
Mutual labels:  tool, editor, gui
Zwerg
Distance Field Editor (experimental)
Stars: ✭ 41 (-79.08%)
Mutual labels:  tool, editor
Swagger Toolbox
💡 Swagger schema model (in yaml, json) generator from json data
Stars: ✭ 194 (-1.02%)
Mutual labels:  tool, editor
Animockup
Create animated mockups in the browser 🔥
Stars: ✭ 1,152 (+487.76%)
Mutual labels:  tool, editor
Bridge.
Minecraft Add-on Editor | We strive to provide the best development experience possible
Stars: ✭ 193 (-1.53%)
Mutual labels:  tool, editor
Openapi Gui
GUI / visual editor for creating and editing OpenAPI / Swagger definitions
Stars: ✭ 891 (+354.59%)
Mutual labels:  editor, gui
Googledriveuploadtool
A tool for Windows to upload and manage files in Google Drive. It resumes uploads in case of an error or failure. Perfect for uploading large files or if your connection is unstable.
Stars: ✭ 58 (-70.41%)
Mutual labels:  tool, gui
Netbeans Mmd Plugin
Free mind map and PlantUML editor with plugins for both NetBeans and Intellij
Stars: ✭ 283 (+44.39%)
Mutual labels:  editor, gui
Develnext
JavaFX and IDE for JPHP (only russian localization, english - in progress)
Stars: ✭ 89 (-54.59%)
Mutual labels:  editor, gui
Black Widow
GUI based offensive penetration testing tool (Open Source)
Stars: ✭ 124 (-36.73%)
Mutual labels:  tool, gui
Git Cola
git-cola: The highly caffeinated Git GUI
Stars: ✭ 1,787 (+811.73%)
Mutual labels:  editor, gui
Core2d
A multi-platform data driven 2D diagram editor.
Stars: ✭ 475 (+142.35%)
Mutual labels:  editor, gui
Zoonavigator
Web-based ZooKeeper UI / editor / browser
Stars: ✭ 326 (+66.33%)
Mutual labels:  editor, gui
Unity File Extension
Shows file extension in 1 column project window.
Stars: ✭ 20 (-89.8%)
Mutual labels:  editor, gui
Stuntrally
The main repository containing Stunt Rally sources and game data. A 3D racing game based on VDrift and OGRE with track editor.
Stars: ✭ 314 (+60.2%)
Mutual labels:  editor, gui
Casbin Editor
Web-based model & policy editor for Casbin
Stars: ✭ 45 (-77.04%)
Mutual labels:  editor, gui
Oni
Oni: Modern Modal Editing - powered by Neovim
Stars: ✭ 11,466 (+5750%)
Mutual labels:  editor, gui
Json Apis With Github
🔨 Tool to make Simple and Quick JSON APIs with GitHub.
Stars: ✭ 240 (+22.45%)
Mutual labels:  tool, editor
Mojs Player
GUI player to control your animations
Stars: ✭ 243 (+23.98%)
Mutual labels:  tool, gui
Ptdesigner
Library and GUI tool for designing and generation of procedural textures, made as a part of my Bachelor thesis.
Stars: ✭ 77 (-60.71%)
Mutual labels:  tool, gui

@mojs/curve-editor – npm

GUI for live easing/property curves editing.

mojs-curve-editor

MojsCurveEditor is a GUI plugin for interactive custom easings and property curves editing while crafting your animations. It is part of mojs tools.

Installation

The MojsCurveEditor depends on mojs >= 0.225.2, tween autoupdates available for mojs >= 0.276.2. Please make sure you've linked mojs library first.

# npm
npm install @mojs/curve-editor

# cdn
<script src="https://cdn.jsdelivr.net/npm/@mojs/curve-editor"></script>

Import MojsCurveEditor constructor inside your code, depending on your environment:

const MojsCurveEditor = require('mojs-curve-editor').default;

// or
import MojsCurveEditor from '@mojs/curve-editor';

If you installed it with script link - you should have MojsCurveEditor global

Usage

Construct MojsCurveEditor with the next options:

  const mojsCurve = new MojsCurveEditor({

    // name of the Curve you are working on. The name is used to
    // identify record in `localStorage` to restore the state from
    // when page gets reloaded, so please specify unique names if
    // you use more than one editor on the same page.
    name: 'bounce curve'
  });

After that you can "connect" the curve with your mojs modules by passing a "sample" of the curve to the easing property of the module, like this:

  const mojsCurve = new MojsCurveEditor();

  const tween = new mojs.Tween({
    easing: mojsCurve.getEasing()
  });

  // or

  const shape = new mojs.Shape({
    easing: mojsCurve.getEasing()
  });

  // or as `property curve`

  const html = new mojs.Html({
    el: '#js-el',
    x: {
      0: 100,
      curve: mojsCurve.getEasing()
    }
  });

Each tween/module should have it's out sample of the curve, this means you need to call mojsCurve.getEasing() send the sample of the curve to the easing property of modules.

If you use mojs>0.276.5 the state of the modules with the curve sample will be updated automatically.

The getEasing function receives options hash:

  easing: mojsCurve.getEasing({

    // `transform` function that pipes through the current value
    // of the curve so you can transform it
    transform: (k) => { return k; }
  });

After you are happy with the curve you made, you need to change the sample, mojsCurve.getEasing() calls, with the actual path data that you can get by clicking on the code button code button:

  const html = new mojs.Html({
    el: '#js-el',
    x: {
      0: 100,
      easing: 'M0, 100 L100, 0'
    }
  });

Options

Constructor accepts the next options:

const curveEditor = new MojsCurveEditor({

  // name of the curve editor
  name: 'bounce curve'

  // if should preserve state on page reloads
  isSaveState: true,

  // start path - will be loaded on initialization of the curve,
  // e.g. before any user modifications were made. Path of 'M0, 100 L100, 0' is set by default.
  startPath: 'M0, 100 L100, 0',

  // callback on path change, accepts path string
  onChange: function (path) {},

  // if should hide when minimized - useful when you try to embed
  isHiddenOnMin: false
});

Public Methods

curveEditor

  // get `easing function` of the curve
  .getEasing()

  // maximize the curve editor
  .maximize()

  // minimize the curve editor
  .minimize()

  // toggle `maximize/minimize` methods regarding editor's state
  .toggleSize();

Shortcuts

  • alt + z - undo curve action
  • alt + x - redo curve action
  • alt + d - delete selected point(s)
  • [3 times] alt + \ - reset curve

All shortcuts work only for active editor - it should have orange mojs logo indicator at bottom left.

Development

Install webpack globally:

[sudo] npm install webpack -g

Install dependencies with npm:

[sudo] npm install

Run webpack:

webpack

Please make sure you started a feature branch with the feature name (better from the dev branch) before making changes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].