Skip to content

Commit

Permalink
add animations description
Browse files Browse the repository at this point in the history
  • Loading branch information
jimhigson committed Sep 24, 2024
1 parent 44e0ad6 commit f6fc90c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions content/animations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
🦄 Animations
==========

The number one question I get asked about this site is how I made the the animations on the <a href="/why">Why Oboe.js</a> page.

jQuery was common back when this site was made, but was starting to get a bad rep. The animations are all rendered
using jQuery to manipulate <a href="https://github.com/jimhigson/oboe.js-website/tree/master/svgSource">svgs</a>
(like you would manipulate any other DOM), but the principles of how they're animated could apply to React, d3, or any other more modern tech.

The crux is, there's a tiny MVC simulation engine implemented using OOP. Back in the day, es6 classes didn't exist, so
the OOP is all done via direct prototype manipulation. The code is all in the [demo](https://github.com/jimhigson/oboe.js-website/tree/master/statics/js/demo) directory. Find the simulation models in [models dir](https://github.com/jimhigson/oboe.js-website/tree/master/statics/js/demo/model) and the views in [views](https://github.com/jimhigson/oboe.js-website/tree/master/statics/js/demo/view). The models all use pub-sub to communicate with each other (when they start or end doing something) and the views also subscribe to the pubsub to know when they should render.

There's a widespread understanding that jQuery is opposed to MVC. Sure, I wouldn't use it today, but when it was
strictly called only from the view code, it could be useful for manipulating the DOM. Today I'd use React, or call the
vanilla DOM directly.

I think it's an interesting window into how we could still make custom things with constrained tech, and severely limited and incompatible browsers.
1 change: 1 addition & 0 deletions content/listing
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ examples.md
api.md
download.md
discuss.md
animations.md

0 comments on commit f6fc90c

Please sign in to comment.