Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG keyframes #1664

Closed
vseverestek opened this issue Nov 16, 2021 · 1 comment
Closed

SVG keyframes #1664

vseverestek opened this issue Nov 16, 2021 · 1 comment

Comments

@vseverestek
Copy link

Can we add keyframes css to svg? If yes, can you please share an example of how to do it?
Currently my Code

  const xml = `<svg width="20" height="20" fill="none" viewBox="0 0 20 20" stroke="#fff" strokeWidth="1" strokeLinecap="round" strokeLinejoin="round">
  <style>
  
  @keyframes bounceAlpha {
      0% {opacity: 1; transform: translateY(0px) scale(1);}
      25%{opacity: 0; transform:translateY(10px) scale(0.9);}
      26%{opacity: 0; transform:translateY(-10px) scale(0.9);}
      55% {opacity: 1; transform: translateY(0px) scale(1);}
    }
    
    .bounceAlpha {
        animation-name: bounceAlpha;
        animation-duration:1.4s;
        animation-iteration-count:infinite;
        animation-timing-function:linear;
    }
    
    .arrow.primera.bounceAlpha {
        animation-name: bounceAlpha;
        animation-duration:1.4s;
        animation-delay:0.2s;
        animation-iteration-count:infinite;
        animation-timing-function:linear;
    }
     .arrow{
        animation-name: bounceAlpha;
        animation-duration:1.4s;
        animation-iteration-count:infinite;
        animation-timing-function:linear;
    }
     .arrow.primera{
        animation-name: bounceAlpha;
        animation-duration:1.4s;
        animation-delay:0.2s;
        animation-iteration-count:infinite;
        animation-timing-function:linear;
    }          
    .primera{
      background:red;
      margin-left:20px;
    }
</style>


  <path dy="-10" class="arrow primera" d="M5 9l4 4 4-4" />
  <path dy="-10" d="M 10,30 9l4 4 4-4" class="arrow segunda" />
  </svg>`
 return (
    <SvgCss xml={xml} />)

@bohdanprog
Copy link
Member

Hello @vseverestek,
Unfortunately, we don't support such kind of animation, maybe in the future we will add that feature but now we haven't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants