I have an SVG and it uses some css classes, the CSS classes are in a seperate file and I'm not really sure how to get them to connect. I can get other SVG's to display but this one won't, I suspect it's because I need to load the CSS classes that it's relying upon
here's the SVG
.loader-container {
position: relative;
}
/*------------------------------------*\
#OVERLAYS
\*------------------------------------*/
.set--overlay {
position: relative;
//Helps iOS detect taps on overlaid pseudo-element.
cursor: pointer;
}
//Forces overlay on top of everything.
//Limit to 20, so that other components can "punch through".
.set--overlay-all {
&:after {
z-index: 1080;
}
}
.loader,
.set--overlay:after {
position: absolute;
}
.loader,
.set--overlay:not(.header-container):after,
.page:after,
.header:after {
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.set--overlay:not(.header-container):after,
.page:after,
.header:after {
background-color: transparentize($color-black, 0.75);
transition: opacity $transition-speed-fast $transition-ease-default,
visibility $transition-speed-fast $transition-ease-default;
}
.set--overlay:not(.header-container),
.page,
.header {
&:after {
content: '';
}
}
/*------------------------------------*\
#LOADER
\*------------------------------------*/
//Local variables
$_loader-offset: 187;
$_loader-duration: 1.4s;
.loader {
z-index: 10000; //It's over 9000!. This should overlay *everything*.
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition-property: opacity, visibility;
transition-timing-function: $transition-ease-in;
transition-duration: $transition-speed-slow;
#include set-invisible();
&.set--alt {
background-color: transparentize($color-black, 0.75);
.loader-indicator__path {
//stroke: $color-white;
}
}
&:not(.set--alt) {
background-color: transparentize($color-white, 0.75);
.loader-indicator__path {
// stroke: $color-secondary;
}
}
&.set--fixed {
position: fixed;
.loader-indicator, .face-loader {
top: 50%;
transform: translateY(-50%);
}
}
&.set--visible {
transition-timing-function: $transition-ease-out;
transition-duration: $transition-speed-slow;
#include set-visible();
}
}
.face-loader-wrapper {
#eye-sx, #eye-dx {
fill: #c10016;
opacity: 0;
animation: eye 500ms 300ms ease infinite;
}
}
.loader-indicator {
position: absolute;
top: 0;
width: 100%;
height: 100%;
max-width: 5rem;
max-height: 5rem;
pointer-events: none;
}
.loader-indicator__path {
fill: #949494;
}
.hide {
position: absolute;
width: 0;
height: 0;
}
.face-loader {
position: absolute;
top: 0;
width: 80px;
height: 80px;
display: block;
clip-path: url(#clipping-face);
&:before {
content: '';
display: block;
background: #c10016;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
transform: translateY(-100%);
animation: loader-horizontal 500ms 300ms ease forwards;
transform-origin: 0 0;
}
}
.face-loader--reverse {
&:before {
transform: translateY(100%);
animation: loader-horizontal-reverse 500ms 300ms ease forwards;
}
}
.loader-message {
max-width: 20.625rem;
padding: 0 1rem;
text-align: center;
font-weight: $font-weight-bold;
color: $color-secondary;
background-color: transparentize($color-white, .25);
}
//Credit: https://codepen.io/mrrocks/pen/EiplA
/*! rtl:begin:ignore */
#keyframes rotator {
0% { transform: rotate(0deg); }
100% { transform: rotate(270deg); }
}
#keyframes dash {
0% { stroke-dashoffset: $_loader-offset; }
50% {
stroke-dashoffset: $_loader-offset/4;
transform:rotate(135deg);
}
100% {
stroke-dashoffset: $_loader-offset;
transform:rotate(450deg);
}
}
#keyframes loader-horizontal {
from {
transform: translateY(-100%);
}
to {
transform: translateY(0);
}
}
#keyframes loader-horizontal-reverse {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
#keyframes eye {
0% {
opacity: 0.4;
}
50% {
opacity: 1;
}
55% {
opacity: 0.9;
}
60% {
opacity: 1;
}
80% {
opacity: 0.6;
}
100% {
opacity: 0.4;
}
}
/*! rtl:end:ignore */
<svg class="loader-indicator">
<g class="face">
<path class="loader-indicator__path" d="M57.89,40.39l-7.18-5,3.71-6.73h0L59.74,19l.93,4.89Zm-6.1,8.74L40.52,39.45,50,36.06l7.55,5.31ZM32.32,70c-5.08-.21-7.21-2.8-7.88-3.88l7.83-2.74,7.81,2.73C37.29,69.93,32.35,70,32.32,70ZM3.92,23.86l.93-4.92,5.33,9.67h0l3.72,6.73-7.2,5ZM1.09,4.65a.43.43,0,0,0,0-.12,3,3,0,0,1,.54-1.08C5.15,1.07,13.33,6.76,16.85,9.67l-12,7.1C.09,7.14,1.09,4.66,1.09,4.65Zm15.13.11L17,8.47C14.75,6.71,9.68,3,5.44,2.07c4.09,0,9.62,2.2,10.78,2.69ZM34.05,1c.09,0,5.51,0,13.27,3.67L42.55,31,32.8,28V1c.42,0,.83,0,1.25,0ZM59.23,2.08C55,3,49.8,6.79,47.64,8.52l.68-3.74C49.4,4.32,55.09,2,59.23,2.08ZM53.65,28l-10.07,3,3.7-20.39,12,7.14ZM21.6,32l2.53,6.39L14.9,35.09l-3.26-5.91Zm-.26-1.12L11,28,5.29,17.67l12.06-7.14ZM31.8,28l-9.44,3L17.23,4.7A49.12,49.12,0,0,1,31.8,1.07Zm1,8.53V29.05l9.46,2.88-3,6.72Zm-7.3,3.09,6.8-2.2L39,39.63V53.41H25.5Zm6.3-3.09-6.51,2.1-2.66-6.71,9.17-2.88Zm.49,22.3-5.81-4.43H38.07ZM7.05,41.35l7.57-5.29L24,39.44,12.79,49.11ZM13.25,50,24.5,40.35V53.61L15,58.71ZM23.8,65.28l-8.25-5.75,9.4-5,6.85,5.22v2.77Zm17,0-8-2.79V59.72l6.79-5.22,9.45,5Zm8.85-6.58L40,53.61V40.35l11.29,9.71Zm.08-23.62L40.48,38.4,43.31,32,53,29.19Zm10-18.32L47.82,9.67C51.3,6.76,59.43,1.1,62.92,3.46a3,3,0,0,1,.53,1.07l0,.1s1,2.51-3.73,12.14Zm.74.79c4.9-9.87,4.14-12.8,3.9-13.33a3.72,3.72,0,0,0-.69-1.36.22.22,0,0,0-.05-.08,3.92,3.92,0,0,0-1.41-1.11C58-.32,49.44,3.21,47.94,3.85,39.82,0,34.3,0,34.05,0,33.51,0,33,0,32.42,0L32.3,0a.58.58,0,0,0-.19,0A48.54,48.54,0,0,0,16.66,3.86C15.18,3.22,6.56-.32,2.34,1.68A4.16,4.16,0,0,0,.92,2.79l0,0a3.86,3.86,0,0,0-.71,1.4c-.24.53-1,3.46,3.9,13.32L2.92,23.76a.49.49,0,0,0,0,.17L5.84,41.31h0a.39.39,0,0,0,.08.2h0L12.24,50l1.87,9.53a.15.15,0,0,0,0,.07.64.64,0,0,0,0,.07h0a.43.43,0,0,0,.14.16l9,6.29c.39.79,2.58,4.56,9,4.83.24,0,5.94,0,8.94-4.81l9-6.31a.54.54,0,0,0,.14-.16h0a.1.1,0,0,0,0-.07.21.21,0,0,0,0-.07L52.35,50l6.31-8.51a.85.85,0,0,0,.09-.22l2.92-17.38a.49.49,0,0,0,0-.17Z">
</path>
</g>
<g class="eyes">
<polygon id="eye-sx" points="14.9 35.09 11.64 29.18 21.6 32.03 24.13 38.42 14.9 35.09"></polygon>
<polygon id="eye-dx" points="40.48 38.4 43.31 32.03 52.96 29.19 49.71 35.09 40.48 38.4"></polygon>
</g>
</svg>
I'm not really sure how make the image appear on the screen when I try I get the following errorerror
I am trying to create a animation with the help of four boxes, each of the square should change opacity one by one to make a loading type animation, I tried with CSS, but not able to achieve, can anyone help with this CSS animation?
Here is the working JSfiddle
body, html {
width: 100%;
height: 100%;
}
body {
background-color: #efefef;
}
.wrapper {
height: 40px;
width: 40px;
position: absolute;
top: 50%;
left: 50%;
margin-top: -22.5px;
margin-left: -22.5px;
}
ul {
list-style-type: none;
margin: 0 auto;
padding: 0;
width: 80px;
height: 80px;
position: relative;
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
ul li {
width: 2em;
height: 2em;
position: absolute;
/*animation: dance 888ms infinite alternate;
animation-timing-function: cubic-bezier(0.5, 0, 0.5, 1);*/
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.block-1 {
top: 0;
left: 0;
background:#0076aa;
}
.block-2 {
top: 0;
right: 0;
background:#98bd81;
}
.block-3 {
bottom: 0;
right: 0;
background:#98bd81;
}
.block-4 {
bottom: 0;
left: 0;
background:#0076aa;
}
li.block-1 {
animation-delay: 222ms;
}
li.block-2 {
animation-delay: 444ms;
}
li.block-3 {
animation-delay: 666ms;
}
li.block-4 {
animation-delay: 888ms;
}
#keyframes dance {
to {
-moz-transform: scale(1);
-ms-transform: scale(1);
-webkit-transform: scale(1);
transform: scale(1);
}
}
<div class='wrapper'>
<ul class='blocks'>
<li class='block-1'></li>
<li class='block-2'></li>
<li class='block-3'></li>
<li class='block-4'></li>
</ul>
</div>
This is after fixing your code:
#-webkit-keyframes dance {
from {
opacity: 1
}
to {
opacity: 0.1
}
}
li.block-1 {
animation: dance 1s infinite;
animation-delay: 222ms;
animation-direction: alternate;
}
Here is the JSFiddle demo
You can fine tune the value to your preference :)
You need to add the animation call to your li elements otherwise it wont run.
Using the animation shorthand property you can achieve this.
body, html {
width: 100%;
height: 100%;
}
body {
background-color: #efefef;
}
.wrapper {
height: 40px;
width: 40px;
position: absolute;
top: 50%;
left: 50%;
margin-top: -22.5px;
margin-left: -22.5px;
}
ul {
list-style-type: none;
margin: 0 auto;
padding: 0;
width: 80px;
height: 80px;
position: relative;
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
ul li {
width: 2em;
height: 2em;
position: absolute;
/*animation: dance 888ms infinite alternate;
animation-timing-function: cubic-bezier(0.5, 0, 0.5, 1);*/
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
animation: dance 888ms infinite alternate;
}
.block-1 {
top: 0;
left: 0;
background:#0076aa;
}
.block-2 {
top: 0;
right: 0;
background:#98bd81;
}
.block-3 {
bottom: 0;
right: 0;
background:#98bd81;
}
.block-4 {
bottom: 0;
left: 0;
background:#0076aa;
}
li.block-1 {
animation-delay: 222ms;
}
li.block-2 {
animation-delay: 444ms;
}
li.block-3 {
animation-delay: 666ms;
}
li.block-4 {
animation-delay: 888ms;
}
#keyframes dance {
from {
opacity: 1;
}
to {
opacity: 0.2;
}
}
<div class='wrapper'>
<ul class='blocks'>
<li class='block-1'></li>
<li class='block-2'></li>
<li class='block-3'></li>
<li class='block-4'></li>
</ul>
</div>
this worked for me..
body, html {
width: 100%;
height: 100%;
}
body {
background-color: #efefef;
}
.wrapper {
height: 40px;
width: 40px;
position: absolute;
top: 50%;
left: 50%;
margin-top: -22.5px;
margin-left: -22.5px;
}
ul {
list-style-type: none;
margin: 0 auto;
padding: 0;
width: 80px;
height: 80px;
position: relative;
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
ul li {
width: 2em;
height: 2em;
position: absolute;
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.block-1 {
top: 0;
left: 0;
background:#0076aa;
}
.block-2 {
top: 0;
right: 0;
background:#98bd81;
}
.block-3 {
bottom: 0;
right: 0;
background:#98bd81;
}
.block-4 {
bottom: 0;
left: 0;
background:#0076aa;
}
li.block-1 {
animation: dance 1.5s ease-out infinite;
animation-delay: 0.91s;
}
li.block-2 {
animation: dance 1.5s ease-out infinite;
animation-delay: 1.54s;
}
li.block-3 {
animation: dance 1.5s ease-out infinite;
animation-delay: 1.77s;
}
li.block-4 {
animation: dance 1.5s ease-out infinite;
animation-delay: 1.99s;
}
#keyframes dance {
50%{
opacity: 0;
}
}
Just set opacity: 0 property in your animation like so:
https://jsfiddle.net/60jnk66d/6/
body,
html {
width: 100%;
height: 100%;
}
body {
background-color: #efefef;
}
.wrapper {
height: 40px;
width: 40px;
position: absolute;
top: 50%;
left: 50%;
margin-top: -22.5px;
margin-left: -22.5px;
}
ul {
list-style-type: none;
margin: 0 auto;
padding: 0;
width: 80px;
height: 80px;
position: relative;
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
ul li {
width: 2em;
height: 2em;
position: absolute;
/*animation: dance 888ms infinite alternate;
animation-timing-function: cubic-bezier(0.5, 0, 0.5, 1);*/
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
border-radius:50%;
}
.block-1 {
top: 0;
left: 0;
background: #0076aa;
}
.block-2 {
top: 0;
right: 0;
background: #98bd81;
}
.block-3 {
bottom: 0;
right: 0;
background: #98bd81;
}
.block-4 {
bottom: 0;
left: 0;
background: #0076aa;
}
li.block-1 {
animation: dance 1s infinite;
animation-delay: 222ms;
animation-direction: alternate;
}
li.block-2 {
animation: dance 1s infinite;
animation-delay: 444ms;
animation-direction: alternate;
}
li.block-3 {
animation: dance 1s infinite;
animation-delay: 666ms;
animation-direction: alternate;
}
li.block-4 {
animation: dance 1s infinite;
animation-delay: 888ms;
animation-direction: alternate;
}
#keyframes dance {
from {
opacity: 1
}
to {
opacity: 0.1
}
}
#-webkit-keyframes dance {
from {
opacity: 1
}
to {
opacity: 0.1
}
}
<div class='wrapper'>
<ul class='blocks'>
<li class='block-1'></li>
<li class='block-2'></li>
<li class='block-3'></li>
<li class='block-4'></li>
</ul>
</div>
Try It
I have some moving word css3 animation.
The animation is fine (snippet). If someone use hover the animation stops (fine), but don't accept a change of the opacity and z-index (.bubble:hover).
opacity: 1;
z-index: 100;
The .bubble:hover class is in use the transform action works.
transform: scale(1.2);
The aim is to pop the hovered bubble in the foreground.
If the bubble is left the animation should move on from the point of stop.
How can I fix it?
Thanks for help.
.solSystem {
postion: absolute;
height: 25vw;
}
.orbitLink,
.orbitLink:active,
.orbitLink:visited {
color: #FFF;
}
.mars:hover,
.earth:hover {
animation-play-state: paused;
}
.bubble:hover {
background: #DE383B !Important;
padding: 1vw;
border: 0.1vw solid #000;
color: #FFF !Important;
transform: scale(1.2);
opacity: 1;
z-index: 100;
}
.mars {
float: left;
margin: 4vw auto;
border-radius: 50%;
position: absolute;
animation-name: moveRigthToLeft, scale, color;
animation-iteration-count: infinite, infinite;
animation-timing-function: ease-in-out, linear;
}
.earth {
float: left;
margin: 4vw auto;
border-radius: 50%;
position: absolute;
animation-name: moveLeftToRigth, scale, color;
animation-iteration-count: infinite, infinite;
animation-timing-function: ease-in-out, linear;
}
.bubble {
padding: 1vw;
color: #FFF;
border-color: #000;
border-width: 0.1vw;
background-color: #004A99;
font-weight: bold;
font-size: 1.1vw;
font-family: Arial, FreeSans, sans-serif;
position: absolute;
border-style: solid;
border-radius: 100%;
}
#keyframes moveLeftToRigth {
0% {
left: 15vw;
}
50% {
left: 40vw;
}
100% {
left: 15vw;
}
}
#keyframes scale {
0% {
transform: scale(1);
}
32% {
transform: scale(0.7);
animation-timing-function: ease-in;
}
70% {
transform: scale(0.8);
animation-timing-function: ease-in;
}
75% {
transform: scale(0.9);
animation-timing-function: ease-in-out;
}
86% {
transform: scale(1.2);
}
98% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
#keyframes color {
0% {
opacity: 0.5;
z-index: 1;
}
20% {
opacity: 0.6;
z-index: 2;
}
40% {
opacity: 0.7;
z-index: 3;
}
60% {
opacity: 0.8;
z-index: 4;
}
80% {
opacity: 0.9;
z-index: 5;
}
90% {
opacity: 1;
z-index: 6;
}
95% {
opacity: 0.8;
z-index: 4;
}
100% {
opacity: 0.6;
z-index: 2;
}
}
<div class="solSystem">
<a href="Test1.html">
<div class="earth" style="animation-duration: 20s,20s,20s;">
<div class="bubble" style="left:12vw;">
Test1
</div>
</div>
</a>
<a href="Test2.html">
<div class="mars" style="animation-duration: 30s,30s,30s;">
<div class="bubble" style="left:30vw;">
Test2
</div>
</div>
</a>
</div>
This happend cause you gave to parent div less opacity with "color" keyframes and then apply that animation to parent of a hovered div. You should make color changes on "bubble" div.
codepen:
http://codepen.io/bra1N/pen/dXKLbp
.solSystem {
postion: absolute;
height: 25vw;
}
.orbitLink,
.orbitLink:active,
.orbitLink:visited {
color: #FFF;
}
.mars:hover,
.earth:hover {
animation-play-state: paused;
}/*
.bubble:hover {
background: #DE383B !Important;
padding: 1vw;
border: 0.1vw solid #000;
color: #FFF !Important;
transform: scale(1.2);
opacity: 1 !important;
z-index: 100 !important;
}*/
.mars {
float: left;
margin: 4vw auto;
border-radius: 50%;
position: absolute;
animation-name: moveRigthToLeft, scale;
animation-iteration-count: infinite, infinite;
animation-timing-function: ease-in-out, linear;
}
.earth {
float: left;
margin: 4vw auto;
border-radius: 50%;
position: absolute;
animation-name: moveLeftToRigth, scale;
animation-iteration-count: infinite, infinite;
animation-timing-function: ease-in-out, linear;
}
.bubble {
padding: 1vw;
color: #FFF;
border-color: #000;
border-width: 0.1vw;
background-color: #004A99;
font-weight: bold;
font-size: 1.1vw;
font-family: Arial, FreeSans, sans-serif;
position: absolute;
border-style: solid;
border-radius: 100%;
animation-name: color;
animation-iteration-count: infinite;
animation-duration: 30s;
}
#keyframes moveLeftToRigth {
0% {
left: 15vw;
}
50% {
left: 40vw;
}
100% {
left: 15vw;
}
}
#keyframes scale {
0% {
transform: scale(1);
}
32% {
transform: scale(0.7);
animation-timing-function: ease-in;
}
70% {
transform: scale(0.8);
animation-timing-function: ease-in;
}
75% {
transform: scale(0.9);
animation-timing-function: ease-in-out;
}
86% {
transform: scale(1.2);
}
98% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
#keyframes color {
0% {
opacity: 0.4;
z-index: 1;
}
20% {
opacity: 0.6;
z-index: 2;
}
40% {
opacity: 0.7;
z-index: 3;
}
60% {
opacity: 0.8;
z-index: 4;
}
80% {
opacity: 0.9;
z-index: 5;
}
90% {
opacity: 1;
z-index: 6;
}
95% {
opacity: 0.8;
z-index: 4;
}
100% {
opacity: 0.6;
z-index: 2;
}
}
<div class="solSystem">
<a href="Test1.html">
<div class="earth" style="animation-duration: 20s,20s,20s;">
<div class="bubble" style="left:12vw;">
Test1
</div>
</div>
</a>
<a href="Test2.html">
<div class="mars" style="animation-duration: 30s,30s,30s;">
<div class="bubble" style="left:30vw;">
Test2
</div>
</div>
</a>
</div>