Styled-components Animation
2022. 3. 29. 03:09ㆍ코딩공부/React
import { keyframes } from 'styled-components';
import React from 'react';
import styled from 'styled-components';
import { keyframes } from 'styled-components';
const Father = styled.div`
display: flex;
`;
const animation = keyframes`
from {
transform: rotate(0deg);
}
to{
transform: rotate(360deg);
}
`;
const animationTwo = keyframes`
0% {
transform: rotate(0deg);
border-radius: 0px;
}
50% {
transform: rotate(360deg);
border-radius: 100px;
}
100% {
transform: rotate(0deg);
border-radius: 0px;
}
`;
const Box = styled.div`
height: 200px;
width: 200px;
background-color: tomato;
animation: ${animation} 1s linear infinite;
`;
function App() {
return (
<Father>
<Box/>
</Father>
);
}
export default App;
'코딩공부 > React' 카테고리의 다른 글
왜 Styled-components를 쓰는가? (0) | 2022.03.29 |
---|---|
Styled-components Pseudo selectors (0) | 2022.03.29 |
Styled-components 태그 속성 한번에 주기 (0) | 2022.03.29 |
Styled-components as 속성 (0) | 2022.03.29 |
Styled-components 변수처리&확장 (0) | 2022.03.29 |