Hello! I’m having an unusual problem. On my site, as you hover over menu items, the background changes (a simple show/hide interaction).
Text A: 550 KB SVG image
Text B: 138 KB JPG image
Text C: 254 KB PNG image
When you hover between B & C (JPG ↔ PNG), the background changes within 5 milliseconds, if not faster:
When you hover between image A &B (SVG ↔ JPG), the background doesn’t change for 200 milliseconds.
Looking at the GPU usage, it seems just “showing/hiding” an SVG consumes 40% GPU usage vs “showing/hiding” a PNG/JPG at 10% GPU usage. Is there another interaction I can try to reduce the SVG paint time?
I would’ve assumed, if a background has already been loaded once, how can it be taking so long to draw again? The browser’s already rendered the SVG once…why is it re-computing it every hover event?
EDIT: I’ve tried switching to opacity (0% vs 100%) on the interactions, but the same issue: ~over 200 ms on the SVG vs instant on the PNG
EDIT 2: I thought maybe 0% opacity was removing the SVG (thus requiring a re-draw), so I thought a 1% to 100% opacity would work better. Nope: still is a 200 ms operation!
EDIT 3: Adding easing/transition time does not help. Because the SVG hasn’t even rendered, the transition (I tried 200ms and 500ms) don’t do much. The GPU is still drawing, so the background just pops out, instead of smoothly transitioning.
From my research, it turns out Webflow Interactions are wholly JavaScript-based, which seems to be a big no-no for animating larger SVGs. The recommendations are for CSS transitions, which are much lighter, but Webflow doesn’t make CSS transitions easy! Anyone know how to use CSS transitions to make a parent element be the trigger for a child element (it won’t work in the current layout since the text is arranged as list, which can’t nest anything anyways)…
Here is my site Read-Only: LINK
(Here is my live site)