Loading screen
This commit is contained in:
18
src/components/AtlasPreviewLoading/AtlasPreviewLoading.js
Normal file
18
src/components/AtlasPreviewLoading/AtlasPreviewLoading.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
|
||||
import styles from './AtlasPreviewLoading.scss';
|
||||
import classNames from 'classnames/bind';
|
||||
const cx = classNames.bind(styles);
|
||||
|
||||
import { randomInteger } from 'utils/random';
|
||||
|
||||
export default (props) => {
|
||||
return (
|
||||
<div className={ cx(styles.container, styles.animated) }>
|
||||
<div className={ cx(styles.mask, styles.header) } style={{ width: `${randomInteger(65,80)}%` }}> </div>
|
||||
<div className={ cx(styles.mask, styles.bodyText) } style={{ width: `${randomInteger(85,100)}%` }}> </div>
|
||||
<div className={ cx(styles.mask, styles.bodyText) } style={{ width: `${randomInteger(85,100)}%` }}> </div>
|
||||
<div className={ cx(styles.mask, styles.bodyText) } style={{ width: `${randomInteger(85,100)}%` }}> </div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
26
src/components/AtlasPreviewLoading/AtlasPreviewLoading.scss
Normal file
26
src/components/AtlasPreviewLoading/AtlasPreviewLoading.scss
Normal file
@@ -0,0 +1,26 @@
|
||||
.mask {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
.header {
|
||||
height: 28px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.bodyText {
|
||||
height: 18px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.animated {
|
||||
width: 100%;
|
||||
animation: PULSATE 1.3s infinite;
|
||||
}
|
||||
|
||||
@keyframes PULSATE {
|
||||
0% { opacity: 1; }
|
||||
50% { opacity: 0.5; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
2
src/components/AtlasPreviewLoading/index.js
Normal file
2
src/components/AtlasPreviewLoading/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import AtlasPreviewLoading from './AtlasPreviewLoading';
|
||||
export default AtlasPreviewLoading;
|
||||
@@ -6,6 +6,8 @@ import { replace } from 'react-router-redux';
|
||||
import { client } from 'utils/ApiClient';
|
||||
|
||||
import Layout from 'components/Layout';
|
||||
import AtlasPreviewLoading from 'components/AtlasPreviewLoading';
|
||||
|
||||
import styles from './Dashboard.scss';
|
||||
|
||||
class Dashboard extends React.Component {
|
||||
@@ -18,7 +20,9 @@ class Dashboard extends React.Component {
|
||||
<Layout
|
||||
header={<div>header!</div>}
|
||||
>
|
||||
holla!
|
||||
<div className={ styles.content }>
|
||||
<AtlasPreviewLoading />
|
||||
</div>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
.content {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
max-width: 600px;
|
||||
|
||||
margin: 40px 20px;
|
||||
}
|
||||
7
src/utils/random.js
Normal file
7
src/utils/random.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const randomInteger = (min, max) => {
|
||||
return Math.floor(Math.random()*(max-min+1)+min);
|
||||
}
|
||||
|
||||
export {
|
||||
randomInteger
|
||||
};
|
||||
Reference in New Issue
Block a user