Loading screen

This commit is contained in:
Jori Lallo
2016-04-30 13:24:13 -07:00
parent 12f0e5d501
commit aa8dbe5626
6 changed files with 65 additions and 1 deletions

View 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)}%` }}>&nbsp;</div>
<div className={ cx(styles.mask, styles.bodyText) } style={{ width: `${randomInteger(85,100)}%` }}>&nbsp;</div>
<div className={ cx(styles.mask, styles.bodyText) } style={{ width: `${randomInteger(85,100)}%` }}>&nbsp;</div>
<div className={ cx(styles.mask, styles.bodyText) } style={{ width: `${randomInteger(85,100)}%` }}>&nbsp;</div>
</div>
);
};

View 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; }
}

View File

@@ -0,0 +1,2 @@
import AtlasPreviewLoading from './AtlasPreviewLoading';
export default AtlasPreviewLoading;

View File

@@ -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>
);
}

View File

@@ -0,0 +1,7 @@
.content {
display: flex;
flex: 1;
max-width: 600px;
margin: 40px 20px;
}

7
src/utils/random.js Normal file
View File

@@ -0,0 +1,7 @@
const randomInteger = (min, max) => {
return Math.floor(Math.random()*(max-min+1)+min);
}
export {
randomInteger
};