svg-module | Super simple svg loading module for Nuxt.js | Animation library
kandi X-RAY | svg-module Summary
kandi X-RAY | svg-module Summary
This package is for loading SVG's into Nuxt.js pages. It allows you to import .svg files in multiple ways depending on the resource query you provide. Currently, this allows you to do the following:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of svg-module
svg-module Key Features
svg-module Examples and Code Snippets
Community Discussions
Trending Discussions on svg-module
QUESTION
I have built a fade carousel which also requires to change the color of an inline svg on top of it (an overlay decoration, basically). The expected result should be similar to this:
I tried several ways to achive this kind of fade transition using transition: fill 0.2s ease
, animation
and keyframes
but it doesn't work. Instead of transitioning, it just changed the color instantly.
I defined the linear gradient inside the SVG and use something like this fill: url(#primary)
to fill: url(#blue)
to change the color for every classes because I couldn't find a way to apply gradient inside the path
via CSS.
I'm wondering what is the proper way to do this..
hero-overlay.svg
ANSWER
Answered 2021-Feb-09 at 17:56I found the way to do this, thanks @Robert for pointing out about the use of linearGradient
. The solution for this is to use watch
and ref
property and listen to the new values. I had to refactor the script a little bit and removed the .blue, .purple, .primary
class from the css.
The final script looks like this:
hero-overlay.svg
(simplified, it now only use 1 )
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install svg-module
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page