From 359ee35bfc5cd3e331dfd20342fefe2b1b470ebc Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Fri, 18 May 2018 18:02:08 +0300 Subject: [PATCH] enhance styles of preloader --- .../preloader/__bounce/preloader__bounce.scss | 35 --------- web/app/components/preloader/index.js | 4 +- web/app/components/preloader/preloader.scss | 5 -- web/app/components/root/root.jsx | 38 +++++----- web/iframe.html | 76 ++++++++++++------- 5 files changed, 69 insertions(+), 89 deletions(-) delete mode 100644 web/app/components/preloader/__bounce/preloader__bounce.scss delete mode 100644 web/app/components/preloader/preloader.scss diff --git a/web/app/components/preloader/__bounce/preloader__bounce.scss b/web/app/components/preloader/__bounce/preloader__bounce.scss deleted file mode 100644 index 009c0c7d..00000000 --- a/web/app/components/preloader/__bounce/preloader__bounce.scss +++ /dev/null @@ -1,35 +0,0 @@ -.preloader__bounce { - display: inline-block; - width: 10px; - height: 10px; - margin-right: 3px; - background-color: #333; - border-radius: 100%; - animation: preloaderBounce 1.4s infinite ease-in-out both; - - &:first-child { - animation-delay: -.32s; - } - - &:nth-child(2) { - animation-delay: -.16s; - } - - &:last-child { - margin-right: 0; - } - - @keyframes preloaderBounce { - 0% { - transform: scale(0); - } - - 40% { - transform: scale(1); - } - - 80%, 100% { - transform: scale(0); - } - } -} diff --git a/web/app/components/preloader/index.js b/web/app/components/preloader/index.js index 74d4e5b1..76c20d37 100644 --- a/web/app/components/preloader/index.js +++ b/web/app/components/preloader/index.js @@ -1,5 +1,3 @@ export { default } from './preloader'; -require('./preloader.scss'); - -require('./__bounce/preloader__bounce.scss'); +// all styles were moved to iframe.html diff --git a/web/app/components/preloader/preloader.scss b/web/app/components/preloader/preloader.scss deleted file mode 100644 index 932b616b..00000000 --- a/web/app/components/preloader/preloader.scss +++ /dev/null @@ -1,5 +0,0 @@ -.preloader { - width: 60px; - text-align: center; - font-size: 0; -} diff --git a/web/app/components/root/root.jsx b/web/app/components/root/root.jsx index c31d208a..c9095765 100644 --- a/web/app/components/root/root.jsx +++ b/web/app/components/root/root.jsx @@ -51,25 +51,27 @@ export default class Root extends Component { componentDidMount() { const { sort } = this.state; - api.getConfig().then(config => { - store.set('config', config); - this.setState({ config }); - }); - Promise.all([ - api.getUser() - .then(data => store.set('user', data)) - .catch(() => store.set('user', {})), - api.find({ sort, url }) - .then(({ comments = [] } = {}) => store.set('comments', comments)) - .catch(() => store.set('comments', [])), - ]).finally(() => { - this.setState({ - isLoaded: true, - user: store.get('user'), - }); - setTimeout(this.checkUrlHash); - }) + api.getConfig().then(config => { + store.set('config', config); + this.setState({ config }); + }); + + Promise.all([ + api.getUser() + .then(data => store.set('user', data)) + .catch(() => store.set('user', {})), + api.find({ sort, url }) + .then(({ comments = [] } = {}) => store.set('comments', comments)) + .catch(() => store.set('comments', [])), + ]).finally(() => { + this.setState({ + isLoaded: true, + user: store.get('user'), + }); + + setTimeout(this.checkUrlHash); + }); } checkUrlHash() { diff --git a/web/iframe.html b/web/iframe.html index af90da77..5ec2f5a2 100644 --- a/web/iframe.html +++ b/web/iframe.html @@ -13,41 +13,61 @@ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } - .iframe_preloader { - position: absolute; - left: 0; - right: 0; - margin: 0 auto; - width: 60px; - text-align: center; - font-size: 0; + + .preloader { + width: 60px; + text-align: center; + font-size: 0; } - .iframe_preloader__bounce { - display: inline-block; - width: 10px; - height: 10px; - margin-right: 3px; - background-color: #333; - border-radius: 100%; - animation: iframePreloaderBounce 1.4s infinite ease-in-out both; + + .preloader_view_iframe { + margin: 0 auto; } - .iframe_preloader__bounce:first-child {animation-delay: -.32s;} - .iframe_preloader__bounce:nth-child(2) {animation-delay: -.16s;} - .iframe_preloader__bounce:last-child {margin-right: 0;} - @keyframes iframePreloaderBounce { - 0% {transform: scale(0);} - 40% {transform: scale(1);} - 80%, 100% {transform: scale(0);} + + .preloader__bounce { + display: inline-block; + width: 10px; + height: 10px; + margin-right: 3px; + background-color: #333; + border-radius: 100%; + animation: iframePreloaderBounce 1.4s infinite ease-in-out both; + } + + .preloader__bounce:first-child { + animation-delay: -.32s; + } + + .preloader__bounce:nth-child(2) { + animation-delay: -.16s; + } + + .preloader__bounce:last-child { + margin-right: 0; + } + + @keyframes iframePreloaderBounce { + 0% { + transform: scale(0); + } + + 40% { + transform: scale(1); + } + + 80%, 100% { + transform: scale(0); + } }
-
-
-
-
-
+
+
+
+
+