feat: first commit
This commit is contained in:
33
src/components/skeleton-loading/index.less
Normal file
33
src/components/skeleton-loading/index.less
Normal file
@ -0,0 +1,33 @@
|
||||
.skeleton-loading {
|
||||
|
||||
@keyframes skeleton {
|
||||
0% {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
50% {
|
||||
/* +0.5s of delay between each loop */
|
||||
transform: translateX(100%);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
}
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: #f2f3f5;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
transform: translateX(-100%);
|
||||
background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.04), transparent);
|
||||
animation: skeleton 1.6s linear 0.5s infinite;
|
||||
}
|
||||
}
|
||||
15
src/components/skeleton-loading/index.tsx
Normal file
15
src/components/skeleton-loading/index.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
import classNames from 'classnames';
|
||||
import './index.less';
|
||||
|
||||
interface IProps {
|
||||
className?: string;
|
||||
customName?: string;
|
||||
}
|
||||
|
||||
const PREFIX = 'skeleton-loading';
|
||||
|
||||
function SkeletonLoading(props: IProps) {
|
||||
return <div className={classNames(PREFIX, props.className, props.customName)}></div>;
|
||||
}
|
||||
|
||||
export default SkeletonLoading;
|
||||
Reference in New Issue
Block a user