Advertisement
Guest User

Untitled

a guest
Apr 24th, 2021
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. In cards.js:
  2.  
  3. export function getCard(Card) {
  4.  
  5. let fillMode = (Card.style === null) ? 'both' : Card.style.fillMode
  6. let duration = (Card.style === null) ? '1s' : Card.style.duration
  7.  
  8. const tmp = keyframes`
  9.  
  10. from,to {
  11. width: ${Card.width};
  12. height: ${Card.height};
  13. background-color: ${Card.colorCard};
  14. background: linear-gradient(${Card.colorCard2}, ${Card.colorCard});
  15. box-shadow: 0 16px 16px -8px rgba(0,0,0,0.4);
  16. border-radius: 6px;
  17. overflow: hidden;
  18. position: relative;
  19. margin: ${Card.marginCard};
  20. }
  21. `;
  22.  
  23. const CardFinal = styled.div`
  24. animation: ${duration} ${tmp} ${fillMode};
  25. `;
  26.  
  27. return CardFinal
  28. }
  29.  
  30.  
  31. In App.js:
  32.  
  33.  
  34. Const CardContainer = getCard(card1)
  35.  
  36. return (
  37. <CardContainer></CardContainer>
  38. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement