All Projects → bibixx → react-adobe-animate

bibixx / react-adobe-animate

Licence: MIT license
Component helping to embed animations from Adobe Animate

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to react-adobe-animate

brutalism
Battleaxe's component library for Adobe CEP panels
Stars: ✭ 43 (+104.76%)
Mutual labels:  adobe, adobe-animate
inker
Measure & copy CSS from your designs of Sketch, Gravit Designer, Adobe XD, Vectr, etc. Pro version: https://github.com/inker8/
Stars: ✭ 56 (+166.67%)
Mutual labels:  adobe
aem-touch-ui-validation
AEM Touch UI Validation Library
Stars: ✭ 40 (+90.48%)
Mutual labels:  adobe
porter
Multi-region blue-green Docker deployments and a whole lot more
Stars: ✭ 43 (+104.76%)
Mutual labels:  adobe
Indentz
Collection of InDesign scripts for simple and repetitive tasks.
Stars: ✭ 23 (+9.52%)
Mutual labels:  adobe
ExtendScript
🍆 Getting started with ExtendScript ✨ by Jeff Davis
Stars: ✭ 23 (+9.52%)
Mutual labels:  adobe
cookbook-cq
Chef cookbook for Adobe CQ (aka AEM)
Stars: ✭ 20 (-4.76%)
Mutual labels:  adobe
aem-spa-project-archetype
Maven Archetype for creating new AEM SPA projects
Stars: ✭ 64 (+204.76%)
Mutual labels:  adobe
open-type-features
Testing the OpenType features of installed fonts in Adobe InDesign
Stars: ✭ 40 (+90.48%)
Mutual labels:  adobe
aem-docker-getting-started
Getting started guide for development with Adobe Experience Manager and Docker.
Stars: ✭ 38 (+80.95%)
Mutual labels:  adobe
phaser-ui-comps
Phaser 3 UI Components built by Adobe Animate
Stars: ✭ 60 (+185.71%)
Mutual labels:  adobe-animate
commerce-cif-connector
AEM Commerce connector for Magento and GraphQL
Stars: ✭ 42 (+100%)
Mutual labels:  adobe
ovid-editor
Adobe panel providing the most advanced scripting environment possible -- Typescript, app DOM autocomplete, full I/O features and more
Stars: ✭ 43 (+104.76%)
Mutual labels:  adobe
adobe-cep-react-create
Create Adobe-CEP extension with React, Material-UI, Native Node modules, Webpack, Babel and ExtendScript
Stars: ✭ 95 (+352.38%)
Mutual labels:  adobe
plugin-toolkit-react
Adobe XD plugin UI components for React
Stars: ✭ 30 (+42.86%)
Mutual labels:  adobe
Virtual Controllers
Virtual controls for use in Flash based games on touch devices. Includes thumbstick and button ui elements
Stars: ✭ 16 (-23.81%)
Mutual labels:  adobe
user-profile-plugin-adobe-xd
User Profile plugin for Adobe XD enables designers to displays beautiful generated avatars 📸 in your design prototype
Stars: ✭ 17 (-19.05%)
Mutual labels:  adobe
commerce-cif-magento-graphql
Magento GraphQL data models and query builders for AEM
Stars: ✭ 20 (-4.76%)
Mutual labels:  adobe
magento2-checkout-success-misc-script
Add Miscellaneous HTML and JavaScript codes to Magento2 checkout conformation page
Stars: ✭ 26 (+23.81%)
Mutual labels:  adobe
acsm-calibre-plugin
Calibre plugin for ACSM->EPUB and ACSM->PDF conversion.
Stars: ✭ 118 (+461.9%)
Mutual labels:  adobe

Adobe Animate React component

npm npm npm Snyk Vulnerabilities for GitHub Repo semantic-release Commitizen friendly

The component for embedding animations from Adobe Animate.

Installation

npm install -S react-adobe-animate

Examples

Dependencies

  • React
  • CreateJS – add this to your page <script src="https://code.createjs.com/1.0.0/createjs.min.js"></script>
  • Your animation – add .js file exported from Adobe Animate to page with <script> tag

How to use

Example

index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>React Adobe Animate exmaple</title>
  </head>
  <body>
    <div id="root"></div>
    <script src="https://code.createjs.com/1.0.0/createjs.min.js" type="text/javascript"></script>
    <script src="./lishtml5-with-background.js" type="text/javascript"></script>
    <script src="./lishtml5.js" type="text/javascript"></script>
  </body>
</html>

App.tsx

import { useState } from "react";
import AnimateCC, { GetAnimationObjectParameter } from "react-adobe-animate";

const App = () => {
  const [paused, setPaused] = useState(true);
  const [animationObject, getAnimationObject] = useState<GetAnimationObjectParameter|null>(null);
  const onClick = () => setPaused(!paused);

  console.log(animationObject);

  return (
    <div style={{ width: "400px" }}>
      <AnimateCC
        animationName="lishtml5"
        getAnimationObject={getAnimationObject}
        paused={paused}
      />

      <AnimateCC
        animationName="lishtml5"
        composition="C1475B64B160904BB90B34246A5FF54B"
        paused={paused}
      />

      <button onClick={onClick}>{paused ? "Unpause" : "Pause"}</button><br />
    </div>
  );
};

Next.js

To use the component with Next.js you have to include CreateJS and Animate files (you have to put those into public folder first) in Head component.

pages/index.tsx

import { useState } from "react";
import Head from 'next/head';
import AnimateCC, { GetAnimationObjectParameter } from "react-adobe-animate";

export default function Home() {
  const [paused, setPaused] = useState(true);
  const [animationObject, getAnimationObject] = useState<GetAnimationObjectParameter|null>(null);
  const onClick = () => setPaused(!paused);

  console.log(animationObject);

  return (
    <div style={{ width: "400px" }}>
      <Head>
        <script src="https://code.createjs.com/1.0.0/createjs.min.js" type="text/javascript"></script>
        <script src="/lishtml5.js" type="text/javascript"></script>
        <script src="/lishtml5-with-background.js" type="text/javascript"></script>
      </Head>

      <AnimateCC
        animationName="lishtml5"
        getAnimationObject={getAnimationObject}
        paused={paused}
      />

      <AnimateCC
        animationName="lishtml5"
        composition="C1475B64B160904BB90B34246A5FF54B"
        paused={paused}
      />

      <button onClick={onClick}>{paused ? "Unpause" : "Pause"}</button><br />
    </div>
  );
}

Props

Prop name Type Required Description
animationName string true Name of animation (exportRoot = new lib.animationName(); in js file. There the name is (lib.animationName = function. Also usually name of published file)
composition string false If you have two animations with same name you can specify an id of that animation. You can get it from .html file generate by Adobe Animate (var comp=AdobeAn.getComposition("C1475B64B160904BB90B34246A5FF54B");)
getAnimationObject function false It is fired after component was mounted. It takes 1 argument – animation object that enables you to fire functions created in Adobe Animate
paused boolean false Whether an animation should be paused

All other props will be passed to div surrounding canvas

FAQ

How do I insert animations published from the same file?

Unfortunately it isn't possible to export from Adobe Animate two unique animations. However you can make one! Simply replace all occurrences of composition id inside your .js file of an animation to one created by you. Composition id is this long string in var comp=AdobeAn.getComposition("C1475B64B160904BB90B34246A5FF54B"); found in .html file published by Adobe Animate.

🙋‍♂️ Questions

Should you have any questions on how to use/setup the component feel free to ask you questions on the discussions page.

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

For development purposes you can use the example folder.
You'll find instructions on how to use it in example/README.md

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019-2020 bibixx [email protected].
This project is MIT licensed.

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