mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-19 18:02:13 +00:00
simple buffering loaded implemented
This commit is contained in:
parent
425e7adeb2
commit
3df2901900
3 changed files with 52 additions and 0 deletions
25
src/routes/Player/BufferingLoader/BufferingLoader.js
Normal file
25
src/routes/Player/BufferingLoader/BufferingLoader.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import React, { PureComponent } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
import styles from './styles';
|
||||
|
||||
class BufferingLoader extends PureComponent {
|
||||
render() {
|
||||
if (!this.props.buffering) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={classnames(this.props.className, styles['buffering-loader-container'])}>
|
||||
<div className={styles['bufferring-loader']} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
BufferingLoader.propTypes = {
|
||||
className: PropTypes.string,
|
||||
buffering: PropTypes.bool
|
||||
};
|
||||
|
||||
export default BufferingLoader;
|
||||
3
src/routes/Player/BufferingLoader/index.js
Normal file
3
src/routes/Player/BufferingLoader/index.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import BufferingLoader from './BufferingLoader';
|
||||
|
||||
export default BufferingLoader;
|
||||
24
src/routes/Player/BufferingLoader/styles.less
Normal file
24
src/routes/Player/BufferingLoader/styles.less
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.buffering-loader-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.bufferring-loader {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
border: 10px solid #f3f3f3;
|
||||
border-top: 10px solid #3498db;
|
||||
animation: spin 2s linear infinite;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue