-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Elastic logo loading component (#3017)
* Add Elastic logo loading component * Modify scaling * Add larger size * Add changelog
- Loading branch information
Showing
8 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
import { EuiLoadingElastic } from '../../../../src/components/loading'; | ||
|
||
export default () => ( | ||
<div> | ||
<EuiLoadingElastic size="m" /> | ||
<EuiLoadingElastic size="l" /> | ||
<EuiLoadingElastic size="xl" /> | ||
<EuiLoadingElastic size="xxl" /> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
@import 'variables'; | ||
@import 'loading_kibana'; | ||
@import 'loading_elastic'; | ||
@import 'loading_chart'; | ||
@import 'loading_content'; | ||
@import 'loading_spinner'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
.euiLoadingElastic { | ||
position: relative; | ||
display: inline-block; | ||
} | ||
|
||
.euiLoadingElastic--medium { | ||
width: $euiSize; | ||
} | ||
|
||
.euiLoadingElastic--large { | ||
width: $euiSizeL; | ||
} | ||
|
||
.euiLoadingElastic--xLarge { | ||
width: $euiSizeXL; | ||
} | ||
|
||
.euiLoadingElastic--xxLarge { | ||
width: $euiSizeXXL; | ||
} | ||
|
||
|
||
.euiLoadingElastic path { | ||
animation-name: euiLoadingElastic; | ||
animation-fill-mode: forwards; | ||
animation-direction: alternate; | ||
transform-style: preserve-3d; | ||
animation-duration: 1s; | ||
animation-timing-function: cubic-bezier(0, .63, .49, 1); | ||
animation-iteration-count: infinite; | ||
transform-origin: 50% 50%; | ||
} | ||
|
||
.euiLoadingElastic path:nth-of-type(1) { | ||
animation-delay: 0s; | ||
} | ||
|
||
.euiLoadingElastic path:nth-of-type(2) { | ||
animation-delay: .035s; | ||
} | ||
|
||
.euiLoadingElastic path:nth-of-type(3) { | ||
animation-delay: .125s; | ||
} | ||
|
||
.euiLoadingElastic path:nth-of-type(4) { | ||
animation-delay: .155s; | ||
} | ||
|
||
.euiLoadingElastic path:nth-of-type(5) { | ||
animation-delay: .075s; | ||
} | ||
|
||
.euiLoadingElastic path:nth-of-type(6) { | ||
animation-delay: .06s; | ||
}; | ||
|
||
|
||
@keyframes euiLoadingElastic { | ||
0% { | ||
transform: scale3d(0, 0, -.7); | ||
opacity: 0; | ||
} | ||
|
||
40% { | ||
transform: scale3d(1, 1, 2); | ||
opacity: 1; | ||
} | ||
|
||
50% { | ||
transform: scale3d(.99, .99, 2); | ||
} | ||
|
||
70% { | ||
transform: scale3d(.96, .96, -2.5); | ||
} | ||
|
||
100% { | ||
transform: scale3d(.98, .98, 2); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export { EuiLoadingKibana } from './loading_kibana'; | ||
export { EuiLoadingElastic } from './loading_elastic'; | ||
export { EuiLoadingChart } from './loading_chart'; | ||
export { EuiLoadingContent } from './loading_content'; | ||
export { EuiLoadingSpinner } from './loading_spinner'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { HTMLAttributes, FunctionComponent } from 'react'; | ||
import classNames from 'classnames'; | ||
import { CommonProps, keysOf } from '../common'; | ||
import { EuiIcon } from '../icon'; | ||
|
||
const sizeToClassNameMap = { | ||
m: 'euiLoadingElastic--medium', | ||
l: 'euiLoadingElastic--large', | ||
xl: 'euiLoadingElastic--xLarge', | ||
xxl: 'euiLoadingElastic--xxLarge', | ||
}; | ||
|
||
export const SIZES = keysOf(sizeToClassNameMap); | ||
|
||
export interface EuiLoadingElasticProps { | ||
size?: keyof typeof sizeToClassNameMap; | ||
} | ||
|
||
export const EuiLoadingElastic: FunctionComponent< | ||
CommonProps & HTMLAttributes<HTMLDivElement> & EuiLoadingElasticProps | ||
> = ({ size = 'm', className, ...rest }) => { | ||
const classes = classNames( | ||
'euiLoadingElastic', | ||
sizeToClassNameMap[size], | ||
className | ||
); | ||
|
||
return ( | ||
<span className={classes} {...rest}> | ||
<EuiIcon type="logoElastic" size={size} /> | ||
</span> | ||
); | ||
}; |