I'm building a site that has an embedded SVG logo at the top. It has a nifty animation as it draws itself. Though in tests, the animation is distracting as it animates on every page. I added a class to the SVG where if it has
<svg class="showAnimation">
it animates, and if it doesn't have that class, it doesn't animate. Or even if the showAnimation class is on any parent, that will work. But doing
<embed src="/media/logo.svg" class="showAnimation">
doesn't work as I guess classes in the HTML aren't propagated down. I don't want to inline the SVG file and have the whole thing re-loaded on every page.
The long story short is: I'm looking for an efficient way to add/remove classes to an embedded SVG from the HTML/CSS/Javascript side before the SVG is shown. Inline is inefficient as it can't be cached, making two separate SVG files with only one word different is inefficient.