diff --git a/mfr/server/static/css/mfr.css b/mfr/server/static/css/mfr.css index 5c8cc2d2c..65cb526e3 100644 --- a/mfr/server/static/css/mfr.css +++ b/mfr/server/static/css/mfr.css @@ -1,72 +1,59 @@ -.mfr-logo-spin { - -webkit-animation: mfr-spin 3s infinite linear, mfr-opacity 3s infinite linear; - -moz-animation: mfr-spin 3s infinite linear mfr-opacity 3s infinite linear; - animation: mfr-spin 3s infinite linear, mfr-opacity 3s infinite linear; - position: absolute; - top: 0; - left: 50%; - z-index: -1; + +/*The osf will ask for this file. It is never actually linked to anything specific in MFR. +This CSS was stripped out of base.css from the osf-style repo. +*/ + +#mfrIframe .ball-pulse > div:nth-child(0) { + -webkit-animation: scale 0.75s -0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); + animation: scale 0.75s -0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } -@-moz-keyframes mfr-spin { - from { - -moz-transform: rotate(0deg); - } - to { - -moz-transform: rotate(360deg); - } +#mfrIframe .ball-pulse > div:nth-child(1) { + -webkit-animation: scale 0.75s -0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); + animation: scale 0.75s -0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } -@-webkit-keyframes mfr-spin { - from { - -webkit-transform: rotate(0deg); - } - to { - -webkit-transform: rotate(360deg); - } +#mfrIframe .ball-pulse > div:nth-child(2) { + -webkit-animation: scale 0.75s -0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); + animation: scale 0.75s -0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } -@keyframes mfr-spin { - from { - -webkit-transform: rotate(0deg); - transform:rotate(0deg); - } - to { - -webkit-transform: rotate(360deg); - transform:rotate(360deg); - } +#mfrIframe .ball-pulse > div:nth-child(3) { + -webkit-animation: scale 0.75s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); + animation: scale 0.75s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } -@-moz-keyframes mfr-opacity { - 0% { - opacity : 0.1 - } - 50% { - opacity: 1 - } - 100% { - opacity: 0.1 - } +#mfrIframe .ball-pulse > div { + background-color: #fff; + width: 15px; + height: 15px; + border-radius: 100%; + margin: 2px; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + display: inline-block; } -@-webkit-keyframes mfr-opacity { - 0% { - opacity : 0.1 - } - 50% { - opacity: 1 - } - 100% { - opacity: 0.1 - } + + +#mfrIframe .ball-dark > div { + background-color: #337AB7; } -@keyframes mfr-opacity { - 0% { - opacity : 0.1 - } - 50% { - opacity: 1 - } - 100% { - opacity: 0.1 - } + +#mfrIframe .ball-scale { + position: absolute; + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 250px; + top: 0; + left: 0; } -.embed-responsive-pdf { +#mfrIframe .embed-responsive-pdf { padding-bottom: 95%; -} \ No newline at end of file +} + +#mfrIframe iframe { + opacity: 0.0; +} + +#mfrIframe { + min-height: 250px; +} diff --git a/mfr/server/static/images/cos_logo.png b/mfr/server/static/images/cos_logo.png deleted file mode 100644 index 59ce60d9f..000000000 Binary files a/mfr/server/static/images/cos_logo.png and /dev/null differ diff --git a/mfr/server/static/js/mfr.child.js b/mfr/server/static/js/mfr.child.js index 8b320037e..35e355163 100644 --- a/mfr/server/static/js/mfr.child.js +++ b/mfr/server/static/js/mfr.child.js @@ -17,7 +17,7 @@ } }); }); - }); + }, false); window.addEventListener('resize', function () { window.pymChild.sendHeight(); diff --git a/mfr/server/static/js/mfr.js b/mfr/server/static/js/mfr.js index 6129495c4..cbf305a0a 100644 --- a/mfr/server/static/js/mfr.js +++ b/mfr/server/static/js/mfr.js @@ -45,16 +45,12 @@ return el; } - function _createSpinner(url, imgName) { - var parser = document.createElement('a'); - parser.href = url; - + function _createSpinner() { + // The the OSF asks for the CSS for this spinner (/static/css/mfr) + // MFR itself does not use it anywhere var spinner = document.createElement('div'); - var img = document.createElement('img'); - spinner.setAttribute('class', 'mfr-logo-spin text-center'); - imgName = imgName || 'loading.png'; - img.setAttribute('src', parser.protocol + '//' + parser.host + '/static/images/' + imgName); - spinner.appendChild(img); + spinner.setAttribute('class', 'ball-scale ball-dark ball-scale-blue text-center'); + spinner.appendChild(document.createElement('div')); return spinner; } @@ -68,11 +64,13 @@ * @param {String} imgName The filename of an image in mfr/server/static/images/ to use as a loading spinner */ lib.Render = function (id, url, config, imgName) { + // we no longer use this, but need to support it as an arg till the OSF side is fixed + imgName = undefined; var self = this; self.id = id; self.url = url; self.config = config; - self.spinner = _createSpinner(url, imgName); + self.spinner = _createSpinner(); self.init = function () { self.pymParent = new pym.Parent(self.id, self.url, self.config); @@ -82,9 +80,10 @@ self.pymParent.iframe.setAttribute('sandbox', 'allow-scripts allow-popups allow-same-origin'); self.pymParent.el.appendChild(self.spinner); - $(self.pymParent.iframe).on('load', function () { + $(self.pymParent.iframe).on('load', function() { self.pymParent.el.removeChild(self.spinner); - }); + this.style.opacity = "1.0" + }) self.pymParent.onMessage('embed', function(message) { _addClass(self.pymParent.el, 'embed-responsive');