Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In cards.js:
- export function getCard(Card) {
- let fillMode = (Card.style === null) ? 'both' : Card.style.fillMode
- let duration = (Card.style === null) ? '1s' : Card.style.duration
- const tmp = keyframes`
- from,to {
- width: ${Card.width};
- height: ${Card.height};
- background-color: ${Card.colorCard};
- background: linear-gradient(${Card.colorCard2}, ${Card.colorCard});
- box-shadow: 0 16px 16px -8px rgba(0,0,0,0.4);
- border-radius: 6px;
- overflow: hidden;
- position: relative;
- margin: ${Card.marginCard};
- }
- `;
- const CardFinal = styled.div`
- animation: ${duration} ${tmp} ${fillMode};
- `;
- return CardFinal
- }
- In App.js:
- Const CardContainer = getCard(card1)
- return (
- <CardContainer></CardContainer>
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement