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

Commit

Permalink
feat: boxloading和CircleLoading新增speed
Browse files Browse the repository at this point in the history
  • Loading branch information
Summer-andy committed Nov 17, 2019
1 parent 791c150 commit 6d0849f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# production
/dist
/storybook-static

/lib
# misc
.DS_Store
.env.local
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import { BoxLoading } from 'react-loadingg'
| 组件 | color| speed | style |
| ---- | ---- | ---- |---- |
| BlockLoading ||||
| BoxLoading || 🚧 ||
| BoxLoading || ||
| BlockReserveLoading ||||
| CircleLoading || 🚧 ||
| CircleLoading || ||
| CircleToBlockLoading || 🚧 ||
| CommonLoading || 🚧 ||
| DisappearedLoading ||||
Expand Down
8 changes: 4 additions & 4 deletions src/components/BoxLoading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ const LoadContainer = styled.div`
top: 59px;
left: 0;
border-radius: 50%;
animation: ${animate} 0.5s linear infinite;
animation: ${animate} ${props => props.speed || 0.5}s linear infinite;
}
&:after {
content: '';
width: 50px;
height: 50px;
background: ${props => props.color || '#00adb5'};
animation: ${shadow} 0.5s linear infinite;
animation: ${shadow} ${props => props.speed || 0.5}s linear infinite;
position: absolute;
top: 0;
left: 0;
border-radius: 3px;
}
`;

const BoxLoading = ({ style, color }) => {
const BoxLoading = ({ style, color, speed }) => {
return (
<LoadContainer style={style} color={color}></LoadContainer>
<LoadContainer style={style} color={color} speed={speed}></LoadContainer>
);
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/CircleLoading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const LoadingContainer = styled.div`
bottom: 50%;
z-index: 1;
transform-origin: left bottom;
animation: ${animate} 1.5s infinite linear;
animation: ${animate} ${props => props.speed || 1}s infinite linear;
}
&::after {
content: '';
Expand All @@ -54,9 +54,9 @@ const LoadingContainer = styled.div`
}
`;

const CircleLoading = ({ style, color, inColor }) => {
const CircleLoading = ({ style, color, inColor, speed }) => {
return (
<LoadingContainer style={style} color={color} inColor={inColor} />
<LoadingContainer style={style} color={color} inColor={inColor} speed={speed} />
);
};

Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ module.exports = function(webpackEnv) {
// dist is a common output folder, and it should be gitignored. The build can
// be run after publishing so you don't wind up with it in source control
output: {
path: path.resolve(__dirname, 'dist/'),
path: path.resolve(__dirname, 'lib/'),
publicPath: '',
// You can do fun things here like use the [hash] keyword to generate unique
// filenames, but for this purpose hui.js is fine. This file and path will
Expand Down

0 comments on commit 6d0849f

Please sign in to comment.