Skip to content

Commit c0776e4

Browse files
committed
Revert "Update default MFR spinner to follow COS style guide"
This reverts commit 3fe38ed.
1 parent 3d28ee9 commit c0776e4

File tree

3 files changed

+73
-42
lines changed

3 files changed

+73
-42
lines changed

mfr/server/static/css/mfr.css

Lines changed: 63 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,72 @@
1-
2-
/*The osf will ask for this file. It is never actually linked to anything specific in MFR.
3-
This CSS was stripped out of base.css from the osf-style repo.
4-
*/
5-
6-
.ball-pulse > div:nth-child(0) {
7-
-webkit-animation: scale 0.75s -0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
8-
animation: scale 0.75s -0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
1+
.mfr-logo-spin {
2+
-webkit-animation: mfr-spin 3s infinite linear, mfr-opacity 3s infinite linear;
3+
-moz-animation: mfr-spin 3s infinite linear mfr-opacity 3s infinite linear;
4+
animation: mfr-spin 3s infinite linear, mfr-opacity 3s infinite linear;
5+
position: absolute;
6+
top: 0;
7+
left: 50%;
8+
z-index: -1;
99
}
10-
.ball-pulse > div:nth-child(1) {
11-
-webkit-animation: scale 0.75s -0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
12-
animation: scale 0.75s -0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
10+
@-moz-keyframes mfr-spin {
11+
from {
12+
-moz-transform: rotate(0deg);
13+
}
14+
to {
15+
-moz-transform: rotate(360deg);
16+
}
1317
}
14-
.ball-pulse > div:nth-child(2) {
15-
-webkit-animation: scale 0.75s -0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
16-
animation: scale 0.75s -0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
18+
@-webkit-keyframes mfr-spin {
19+
from {
20+
-webkit-transform: rotate(0deg);
21+
}
22+
to {
23+
-webkit-transform: rotate(360deg);
24+
}
1725
}
18-
.ball-pulse > div:nth-child(3) {
19-
-webkit-animation: scale 0.75s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
20-
animation: scale 0.75s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
26+
@keyframes mfr-spin {
27+
from {
28+
-webkit-transform: rotate(0deg);
29+
transform:rotate(0deg);
30+
}
31+
to {
32+
-webkit-transform: rotate(360deg);
33+
transform:rotate(360deg);
34+
}
2135
}
22-
.ball-pulse > div {
23-
background-color: #fff;
24-
width: 15px;
25-
height: 15px;
26-
border-radius: 100%;
27-
margin: 2px;
28-
-webkit-animation-fill-mode: both;
29-
animation-fill-mode: both;
30-
display: inline-block;
36+
@-moz-keyframes mfr-opacity {
37+
0% {
38+
opacity : 0.1
39+
}
40+
50% {
41+
opacity: 1
42+
}
43+
100% {
44+
opacity: 0.1
45+
}
3146
}
32-
33-
34-
.ball-dark > div {
35-
background-color: #337AB7;
47+
@-webkit-keyframes mfr-opacity {
48+
0% {
49+
opacity : 0.1
50+
}
51+
50% {
52+
opacity: 1
53+
}
54+
100% {
55+
opacity: 0.1
56+
}
57+
}
58+
@keyframes mfr-opacity {
59+
0% {
60+
opacity : 0.1
61+
}
62+
50% {
63+
opacity: 1
64+
}
65+
100% {
66+
opacity: 0.1
67+
}
3668
}
3769

3870
.embed-responsive-pdf {
3971
padding-bottom: 95%;
40-
}
72+
}
5.95 KB
Loading

mfr/server/static/js/mfr.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@
4545
return el;
4646
}
4747

48-
function _createSpinner() {
49-
// The the OSF asks for the CSS for this spinner (/static/css/mfr)
50-
// MFR itself does not use it anywhere
51-
var spinner = document.createElement('div');
52-
spinner.setAttribute('class', 'ball-pulse ball-dark text-center');
53-
for(i=0; i < 3; i++){
54-
spinner.appendChild(document.createElement('div'));
55-
}
48+
function _createSpinner(url, imgName) {
49+
var parser = document.createElement('a');
50+
parser.href = url;
5651

52+
var spinner = document.createElement('div');
53+
var img = document.createElement('img');
54+
spinner.setAttribute('class', 'mfr-logo-spin text-center');
55+
imgName = imgName || 'loading.png';
56+
img.setAttribute('src', parser.protocol + '//' + parser.host + '/static/images/' + imgName);
57+
spinner.appendChild(img);
5758
return spinner;
5859
}
5960

@@ -67,13 +68,11 @@
6768
* @param {String} imgName The filename of an image in mfr/server/static/images/ to use as a loading spinner
6869
*/
6970
lib.Render = function (id, url, config, imgName) {
70-
// we no longer use this, but need to support it as an arg till the OSF side is fixed
71-
imgName = undefined;
7271
var self = this;
7372
self.id = id;
7473
self.url = url;
7574
self.config = config;
76-
self.spinner = _createSpinner();
75+
self.spinner = _createSpinner(url, imgName);
7776

7877
self.init = function () {
7978
self.pymParent = new pym.Parent(self.id, self.url, self.config);

0 commit comments

Comments
 (0)