diff --git a/client/less/main.less b/client/less/main.less index 6b370ce09e..a61a04b9e9 100644 --- a/client/less/main.less +++ b/client/less/main.less @@ -1201,3 +1201,4 @@ and (max-width : 400px) { @import "map.less"; @import "sk-wave.less"; @import "classic-modal.less"; +@import "skeleton-shimmer.less"; diff --git a/client/less/skeleton-shimmer.less b/client/less/skeleton-shimmer.less new file mode 100644 index 0000000000..2a0257691d --- /dev/null +++ b/client/less/skeleton-shimmer.less @@ -0,0 +1,41 @@ +@keyframes skeletonShimmer{ + 0% { + transform: translateX(-48px); + } + 100% { + transform: translateX(1000px); + } +} + +.shimmer { + position: relative; + min-height: 18px; + + .row { + height: 18px; + + .col-xs-12 { + padding-right: 12px; + height: 17px; + } + } + + .sprite-wrapper { + background-color: #333; + height: 17px; + width: 75%; + } + + .sprite { + animation-name: skeletonShimmer; + animation-duration: 2.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: normal; + background: white; + box-shadow: 0 0 3px 2px; + height: 17px; + width: 2px; + z-index: 5; + } +} diff --git a/common/app/routes/challenges/components/classic/Editor.jsx b/common/app/routes/challenges/components/classic/Editor.jsx index ba8f7ed871..344fdd04a6 100644 --- a/common/app/routes/challenges/components/classic/Editor.jsx +++ b/common/app/routes/challenges/components/classic/Editor.jsx @@ -7,6 +7,8 @@ import Codemirror from 'react-codemirror'; import NoSSR from 'react-no-ssr'; import PureComponent from 'react-pure-render/component'; +import CodeMirrorSkeleton from '../skeleton/CodeMirrorSkeleton.jsx'; + const mapStateToProps = createSelector( state => state.app.windowHeight, state => state.app.navHeight, @@ -123,7 +125,7 @@ export class Editor extends PureComponent { className='challenges-editor' style={ style } > - + }> - + }> + + +
+
+
+ + +
+ ); + } + + render() { + const { + content + } = this.props; + const editorLines = content.split('\n'); + return ( +
+
+
+
+
+
+
+
+ + { editorLines.map(this.renderLine) } + +
+
+
+
+
+
+ ); + } +} + +CodeMirrorSkeleton.displayName = 'CodeMirrorSkeleton'; +CodeMirrorSkeleton.propTypes = propTypes;