I'm seeing that this entire thing is written in JS / CSS and HTML. Therefore this may be a good candidate for bundling into a web component so that it can be reused in other applications easier, without having to worry about how it's implementation may be impacted by external contexts.