show-your-terms
show-your-terms copied to clipboard
Several animated terminal windows, ability to pause animations
Hello, I made some other changes, but this is my first coffeescript, I'm sure some things can be done in a more elegant and effective way. But I wanted to play a little bit with this code.
WOW, that's great! I'll give a look today night. (about 7 hours from now) 💃 👯
@gasparfm, can you provide some API reference, what commands is enabled now?
With that update, you have one more argument in the constructor. termsOptions = { single: [boolean], // default false pauseOnClick: [boolean] // default true };
If single is true, it will have the same behaviour as ShowYourTerms now, you specify, you specify ".showyourterms" as container, and only the first object found will be animated. If single is false, every object with class "showyourterms" will be animated.
If pauseOnClick is true, when you click any showyourterms window, it will pause when typing (it will be cool to pause when type != "command", I can do it later).
Functions like declarativeBuilder, play, outputGenerator, callNextOutput have now one more argument (outputTerm, defaults to 0), which indicates which window will be affected, as you can use it with several windows, it's just a counter.
I added a status control (variable sstatus) indicating whether the window is "ready" (configured but not playing), "playing" (already animating) or "pause".
As you can see content, container, sstatus are now arrays so they store information for all windows matching the selector.
We have some new functions like:
- isPlaying(outputTerm) : indicates if this window is currently Playing
- togglePause(outputTerm) : pause / unpause windows
- playAgain(outputTerm) : resets window status and starts playing (I think it will be cool adding a tiny button to start playing from the beginning at any time).
One thing I forgot and just realized:
- Functions addCommand and addLine just affect first window. I have to add outputTerm argument too.
I think that's all :)
Hello again, I added a few things. addCommand and addLine has outputTerm argument and you can also pause terminal when printing lines. Did not make a pull request to avoid saturation in PRs for this project.
I've made lots of commits with the compiled scripts, it may seem there are lots of changes, but they're just a few lines.