Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
feat: 新增CircleToBlockLoading组件
Browse files Browse the repository at this point in the history
  • Loading branch information
Summer-andy committed Nov 11, 2019
1 parent 5610c17 commit 438084b
Show file tree
Hide file tree
Showing 7 changed files with 11,266 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { BoxLoading } from 'react-loadingg'
- [x] LoopCircleLoading
- [x] TransverseLoading
- [x] WaveLoading
- [x] CircleToBlockLoading
- [ ] 持续开发中...


Expand Down
15 changes: 15 additions & 0 deletions src/components/CircleToBlockLoading/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import styles from './style.scss';
const CircleToBlockLoading = ({ style }) => {
return (
<div className="load-container-block" style={style}>
<div className="circleToBlock">
<div className="circleToBlock-item"></div>
<div className="circleToBlock-item"></div>
<div className="circleToBlock-item"></div>
</div>
</div>
);
};

export default CircleToBlockLoading;
45 changes: 45 additions & 0 deletions src/components/CircleToBlockLoading/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.circleToBlock {
height: 100px;
width: 100px;
margin: auto;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
justify-content: space-between;
flex-wrap: nowrap;
align-items: center;
.circleToBlock-item {
height: 20px;
width: 20px;
background-color: #00adb5;
position: absolute;
margin: auto;
border-radius: 2px;
transform: translateY(0) rotate(45deg) scale(0);
animation: changeSharp 3s linear infinite;
}
.circleToBlock-item:nth-of-type(1) {
animation-delay: calc(3s * 2 / -1.5);
}
.circleToBlock-item:nth-of-type(2) {
animation-delay: calc(3s * 3 / -1.5);
}
.circleToBlock-item:nth-of-type(3) {
animation-delay: calc(3s * 4 / -1.5);
}
}

@keyframes changeSharp {
0% {
transform: translateX(0) rotate(45deg) scale(0);
}
50% {
transform: translateX(250%) rotate(45deg) scale(1);
}
100% {
transform: translateX(500%) rotate(45deg) scale(0);
}
}
2 changes: 1 addition & 1 deletion src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// export { default as BoxLoading } from './BoxLoading';
export { default as CommonLoading } from './CommonLoading';
export { default as WaveLoading } from './WaveLoading';
export { default as CircleLoading } from './CircleLoading';
export { default as LoopCircleLoading } from './LoopCircleLoading';
export { default as TransverseLoading } from './TransverseLoading';
export { default as BlockLoading } from './BlockLoading';
export { default as BoxLoading } from './BoxLoading'
export { default as CircleToBlockLoading } from './CircleToBlockLoading'
17 changes: 17 additions & 0 deletions src/stories/CircleToBlockLoading.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';
import { CircleToBlockLoading } from '~/components';
import Container from './compoment/Container';
storiesOf('CircleToBlock', module)
.addDecorator(withKnobs)
.add(
'CircleToBlock',
() => {
return (
<Container>
<CircleToBlockLoading></CircleToBlockLoading>
</Container>
);
}
);
4 changes: 2 additions & 2 deletions src/stories/compoment/DemoContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
WaveLoading,
BlockLoading,
BoxLoading,
CircleLoading,
LoopCircleLoading,
TransverseLoading,
CircleToBlockLoading
} from '~/components';
import './style.scss';
const DemoContainer = () => {
Expand Down Expand Up @@ -48,7 +48,7 @@ const DemoContainer = () => {
<BoxLoading style={{ margin: '25px auto' }} />
</div>
<div className="item">
<CircleLoading />
<CircleToBlockLoading />
</div>
<div className="item">
<LoopCircleLoading />
Expand Down
Loading

0 comments on commit 438084b

Please sign in to comment.