Quick JS program for creating animations
WARNING! Internal tool! Turn back while you still can! On that note, anim has started to become actively managed! Feel free to submit issues and they just may be addressed :-)
Anim is used to make animations and graphs for the youtube series, https://www.youtube.com/watch?v=ZzWaow1Rvho
This was made to assist in creating quick animations for my youtube series on neural networks. You can add text, circles, and draw shapes. An object's properties are smoothly transitioned while presenting.
(If you are planning to modify
anim, see the development setup guide!)
animis available both as source code and as a bundled
main.*.jsand a few extra files (including licenses and source maps). If you are not planning to modify
anim, you should proceed with the second option. This section describes how to do so.
anim, you can visit the GitHub Pages site which hosts the compiled code. However, the code is available for download at https://github.com/JonComo/anim/releases (instructions are available under Downloading). This enables you to open an
index.htmlfile in your favorite browser and use
animthere, with the added benefit of
animworking while you don't have a valid internet connection. Keep in mind that a local copy of
animmight become outdated.
Visit https://github.com/JonComo/anim/releases and pick a release (if you have no preference, go with the latest).
Choose an archive format. Click on it to download. You'll need to be able to unarchive it once it's downloaded, so make sure your computer has the necessary software installed that correspond to the format you pick.
Navigate to where the archive was downloaded onto your system. If you are on Windows and have downloaded the
.ziparchive, right-click it and select Extract All, and then follow the on-screen instructions. On macOS, it should be sufficient to double-click the archive. Finally, if you're running Linux, you can execute
tar -xzvf .tar.gzor
unzip .zipto unarchive the download. If you prefer the GUI, you might have an archive manager installed that will unarchive the download for you.
Navigate into thedirectory (it doesn't have a file extension!) and open
index.htmlin your favorite browser. If all went well, you should now have a local copy of (compiled)
Since the archive has been extracted, you can delete it. If you'd like to download another version of
anim, follow the previous steps again. If you are not planning to use a local version of
animanymore, you can delete the extracted directory that contains it.
(A more elaborate help section can be found by scrolling down on
Exit present mode:
Change frames: keys
0 and up or left and right arrow keys.
Remove current frame:
Select the tool for the object you want to create
Text: click to place a line of text under the mouse
Shape or vector: click and keep clicking to draw a shape
esc to finish
Circle: click to place a circle under the mouse pointer
You can select objects with the select tool (which uses rectangular selection)
You can define functions in text objects by just typing them in.
f(x) = x^(2)
Then you can graph them:
view xy button in the menu to rotate the 3D coordinate axes to see your 2D graph)
You can interact with a variable by using a slider (just type in into a text object):
Then enter presentation mode,
ctrl enter, and drag (with your mouse) the variable name left and right to change it's value.
This section explains the process of setting up your own environment for developing
Before starting, you must have Node.js (https://nodejs.org/) and NPM (https://npmjs.com) installed on your system. Make sure you have Git (https://git-scm.com/) installed if you're planning to submit your modifications (or just want to keep track of your changes)!
First things first, you must download
anim's code. Here are some options:
If you're planning to play around with
anim's code, but aren't really interested in contributing, go with this option. First, clone this repository using the command
git clone https://github.com/JonComo/anim. Using this option will also let you update your local version of this repository whenever you feel like it. Just run
git pullin the repository directory!
Use the GitHub CLI!
If you have the GitHub CLI installed, then you can just clone this repository by executing
gh repo clone JonComo/anim.
If you're going to submit code changes to this repository, then you should create a fork of it. To do so, navigate to this repository's URL (https://github.com/JonComo/anim) and press the Fork button in the top-right corner of the GitHub UI. Then, clone it using
git clone https://github.com//animor whatever software you please!
Fork with the GitHub CLI
To fork this repo and then clone the fork with the GitHub CLI, run
gh repo fork --clone JonComo/anim.
I think you know what to do.
Once you have this repository's contents on your system, you must install some packages with NPM. These include ones like
jqueryand more! To install them, run
Now, you should be all set to start modifying the code.
animuses the Webpack bundler: a program which squashes all of a project's code into a few files. You've already installed it in the previous step when running
npm install. Now, all you need to do is run
npm startto start the Webpack development server (Webpack dev server for short). Now, open your browser to https://localhost:9000/ and wait for a page to load. The Webpack dev server automatically bundles
animevery time you change the code. Try editing the code and wait for the browser page to reload. Wow! Your changes are reflected in the browser. When you feel like you want to share your new and improved code with others, head on down to the next section.
Once you're satisfied with your changes, you can bundle everything up. Just run
npm run buildand look in the
dist/directory. You should see a new file named
main.js. This file is Webpack's compiled version of your code. Opening up
dist/index.htmlin your browser should open up
animaccompanied by your changes. Hooray!