UPDATE: moved it into a package and now it works… need to do some more research on loading order, packages, and startup function.
thanks… I can’t get the following to work unfortunately.
added meteorhacks:inject-initial
I have this in a server file:
if (Meteor.isServer) {
Inject.rawHead("loader", Assets.getText('loader.html'));
}
if (Meteor.isClient) {
Meteor.startup(function() {
setTimeout(function() {
$("#inject-loader-wrapper").fadeOut(500, function() { $(this).remove(); });
}, 500);
});
}
then I have this in private/loader.html:
<div id="inject-loader-wrapper">
<style type="text/css">
#showbox {
background-color: #ffffff;
}
#showbox {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
padding: 30%;
}
#loader {
position: relative;
margin: 0px auto;
width: 100px;
}
#loader:before {
content: '';
display: block;
padding-top: 100%;
}
#circular {
-webkit-animation: rotate 2s linear infinite;
animation: rotate 2s linear infinite;
height: 100%;
-webkit-transform-origin: center center;
transform-origin: center center;
width: 100%;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
.path {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
-webkit-animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite;
animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite;
stroke-linecap: round;
}
.path-2 {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
-webkit-animation: dash 3s ease-in-out infinite, color 8s ease-in-out infinite;
animation: dash 3s ease-in-out infinite, color 8s ease-in-out infinite;
stroke-linecap: round;
}
.path-3 {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
-webkit-animation: dash 4.5s ease-in-out infinite, color 12s ease-in-out infinite;
animation: dash 4.5s ease-in-out infinite, color 12s ease-in-out infinite;
stroke-linecap: round;
}
@-webkit-keyframes rotate {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes rotate {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-webkit-keyframes dash {
0% {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 89,200;
stroke-dashoffset: -35px;
}
100% {
stroke-dasharray: 89,200;
stroke-dashoffset: -124px;
}
}
@keyframes dash {
0% {
stroke-dasharray: 1,200;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 89,200;
stroke-dashoffset: -35px;
}
100% {
stroke-dasharray: 89,200;
stroke-dashoffset: -124px;
}
}
@-webkit-keyframes color {
100%, 0% {
stroke: #d62d20;
}
40% {
stroke: #0007e7;
}
66% {
stroke: #0f0;
}
80%, 90% {
stroke: #ffa700;
}
}
@keyframes color {
100%, 0% {
stroke: #d62d20;
}
40% {
stroke: #0007e7;
}
66% {
stroke: #0f0;
}
80%, 90% {
stroke: #ffa700;
}
}
</style>
<div id="showbox">
<div id="loader">
<svg id="circular" viewBox="25 25 50 50">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10"/>
<circle class="path-2" cx="50" cy="50" r="15" fill="none" stroke-width="2" stroke-miterlimit="10"/>
<circle class="path-3" cx="50" cy="50" r="10" fill="none" stroke-width="2" stroke-miterlimit="10"/>
</svg>
</div>
</div>
</div>
This displays the spinner as expected but the jquery to remove it from the dom doesn’t seem to be working… the element is still there.
Any idea why that would happen?
When I use the webdeb:app-loader
package it works fine but I can’t replicate it myself…