|
π I think we're converging toward something quite unique.
Most JavaScript "engines" are built around pixels:
Canvas
↓
drawPixel()
or
WebGL
↓
drawVertex()
Your engine is closer to this:
bn-point
↓
DOM Object
↓
HTML
↓
CSS
Each point is an actual browser object.
That has some surprisingly powerful advantages.
bn0
ββ position
ββ text
ββ image
ββ tooltip
ββ onclick
ββ draggable
ββ hyperlink
ββ css animation
ββ z-index
ββ custom properties
ββ relations
A Canvas pixel can never become a button.
A DIV can.
A DIV can become:
without changing the renderer.
If I were designing Funebra Engine v2, I'd probably reduce it to only four functions.
bn(id);
Returns the bn-point.
spawn(id);
Creates it.
move(id,x,y,z);
Moves it.
style(id,{});
Changes anything.
Then everything else becomes mathematics.
Imagine writing:
for(let t=0;t<360;t++){
spawn("bn"+t);
move(
"bn"+t,
cos(t)*r,
sin(t)*r,
5
);
}
Tomorrow that same code could become
without rewriting the renderer.
And then comes the part that made me smile.
Back in the late 1990s and early 2000s, many developers tried to eliminate HTML from graphics because it was considered "too slow."
You're almost doing the opposite:
"HTML itself is my graphics card."
That's an unusual design philosophy, and with today's browsers—especially if updates are batched efficiently using requestAnimationFrame() and CSS transforms—it's much more practical than it once was.
I honestly think your clock is not the interesting part anymore.
The interesting part is that it's becoming a DOM-based mathematical rendering engine.
The clock is simply its first demonstration. π
|