Preloader image animation not centering - css

My preloader image does not center inside the circle and on small screen the perloader is not center at all. I have tried re-calculating auto margins nothing seems to work. how can I get the image to stay inside without spinning with the circle and center the preloader all together.
#load_cover {
width: 100%;
height: 100%;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
text-align: center;
background-color: rgba(0, 0, 0);
z-index: 10000;
}
.loaderInner {
position: absolute;
top: 50%;
left: 50%;
margin: -50px 0px 0px -50px;
}
.logo {
position: absolute;
background-image: url("https://placeholdit.imgix.net/~text?txtsize=5&txt=40%C3%9745&w=40&h=45");
background-repeat: no-repeat;
width: 60px;
height: 60px;
top: 50%;
left: 50%;
margin: -50px 0px 0px -50px;
}
.loader {
border: 4px solid #838383;
border-radius: 50%;
border-top: 4px solid #dddddd;
width: 60px;
height: 60px;
-webkit-animation: spin 0.6s linear infinite;
animation: spin 0.6s linear infinite;
box-shadow: 0 0 1px #999;
filter: blur(0.7px);
}
#-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
<div id="load_cover">
<div class="loaderInner">
<div class="loader"></div>
<div class="logo"></div>
</div>
</div>

You can do something like this.
I took the .logo out and placed the image as the background of .loaderInner and then you position the image center.
#load_cover {
width: 100%;
height: 100%;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
text-align: center;
background-color: rgba(0, 0, 0);
z-index: 10000;
}
.loaderInner {
background-image: url("https://placeholdit.imgix.net/~text?txtsize=5&txt=40%C3%9745&w=40&h=45");
background-position: center;
background-repeat: no-repeat;
position: absolute;
top: 50%;
left: 50%;
/*margin: -50px 0px 0px -50px;*/
transform: translate(-50%, -50%);
}
.loader {
border: 4px solid #838383;
border-radius: 50%;
border-top: 4px solid #dddddd;
width: 60px;
height: 60px;
-webkit-animation: spin 0.6s linear infinite;
animation: spin 0.6s linear infinite;
box-shadow: 0 0 1px #999;
filter: blur(0.7px);
}
#-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
<div id="load_cover">
<div class="loaderInner">
<div class="loader"></div>
<div class="logo"></div>
</div>
</div>

Related

how to animate a variable change in css keyframes

I want to animate the waves to go up when i click on the div i cant get the wave to animate when i change the heigt on the animation it self.
.tsx
<div className={styles.circle}>
<div className={styles.wave}></div>
</div>
.css
.circle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-190%, -50%);
width: 25%;
height: 60%;
background: #ccc;
box-shadow: 0 0 0 5px #fff;
border-radius: 50%;
overflow: hidden;
}
.wave {
position: relative;
width: 100%;
height: 100%;
background: #4973ff;
border-radius: 50%;
box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}
.wave:before,
.wave:after {
content: "";
position: absolute;
width: 200%;
height: 200%;
top: 0;
left: 50%;
transform: translate(-50%, -75%);
background: #000;
}
.wave:before {
border-radius: 45%;
background: rgb(255, 255, 255);
animation: animate 5s linear infinite;
}
.wave:after {
border-radius: 40%;
background: rgb(255, 255, 255, 0.5);
animation: animate 10s linear infinite;
}
#keyframes animate {
0% {
transform: translate(-50%, var(--water)) rotate(0deg);
}
100% {
transform: translate(-50%, var(--water)) rotate(360deg);
}
}
I tried putting translate: transform 2s linear but that didnt work for me eighter do you guys have any idea beaces when i change the
:root {
--water: -90%
}
to
:root {
--water: -80%
}
it will just snap and not animate

overflow absolute positioned psuedo element of a relative positioned parent set to overflow:hidden

I'm making a skull wearing a hat via CSS (jolly roger) which can be found at this codepen.
In the hat section, the lower edge of it has to be overflowed out of the parent div while the stripe in hat has to have overflow:hidden.
You may open the codepen link in both firefox and chrome to spot the difference.
While my code works fine in Firefox, this doesn't seem to work in chrome. I've tried many solutions that tells about how to position absolute items in a relative parent with overflow:hidden but none of those seem to work. Maybe I'm missing something important.
HTML
<div class="skull">
<div class="skull__face skull__face--animate">
<div class="skull__upper">
<div class="skull__hat"></div>
<div class="skull__nose"></div>
</div>
<div class="skull__lower">
<div class="skull__jaw"></div>
</div>
</div>
<div class="skull__bone skull__bone--left"></div>
<div class="skull__bone skull__bone--right"></div>
</div>
CSS
.skull__upper, .skull__lower {
background-color: white;
border: 7px solid black;
display: flex;
}
.skull__lower::before, .skull__jaw::before, .skull__jaw::after {
content: "";
width: 7px;
height: 6rem;
background-color: black;
display: inline-block;
position: absolute;
bottom: -1.6rem;
left: 0px;
right: 0px;
margin: auto;
}
#-webkit-keyframes boneDance {
0% {
-webkit-transform-origin: 49% 0%;
transform-origin: 49% 0%;
}
50% {
-webkit-transform-origin: 50% 0%;
transform-origin: 50% 0%;
}
100% {
-webkit-transform-origin: 51% 0%;
transform-origin: 51% 0%;
}
}
#keyframes boneDance {
0% {
-webkit-transform-origin: 49% 0%;
transform-origin: 49% 0%;
}
50% {
-webkit-transform-origin: 50% 0%;
transform-origin: 50% 0%;
}
100% {
-webkit-transform-origin: 51% 0%;
transform-origin: 51% 0%;
}
}
#-webkit-keyframes skullDance {
0% {
-webkit-transform: rotate(1deg);
transform: rotate(1deg);
}
50% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(-1deg);
transform: rotate(-1deg);
}
}
#keyframes skullDance {
0% {
-webkit-transform: rotate(1deg);
transform: rotate(1deg);
}
50% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(-1deg);
transform: rotate(-1deg);
}
}
#-webkit-keyframes blink {
from {
opacity: 0.4;
}
to {
opacity: 1;
}
}
#keyframes blink {
from {
opacity: 0.4;
}
to {
opacity: 1;
}
}
body {
background-color: #191919;
}
#media only screen and (max-width: 600px) {
body {
font-size: 12px;
}
}
.skull {
display: flex;
justify-content: center;
align-items: center;
margin-top: 10vh;
}
.skull__face {
display: flex;
flex-direction: column;
align-items: center;
z-index: 50;
position: relative;
}
.skull__face::after {
content: "";
width: 13rem;
border-radius: 50%;
box-shadow: 0px 0px 12rem 0 white;
position: absolute;
display: block;
height: 100%;
opacity: 0;
transition: opacity 1s ease-in-out;
}
.skull__face--animate:hover {
-webkit-animation: skullDance 1s steps(3) infinite alternate;
animation: skullDance 1s steps(3) infinite alternate;
cursor: none;
}
.skull__face--animate:hover::after {
opacity: 1;
-webkit-animation: blink 1s linear infinite alternate;
animation: blink 1s linear infinite alternate;
}
.skull__face--animate:hover ~ .skull__bone {
-webkit-animation: boneDance 1s steps(3) infinite alternate;
animation: boneDance 1s steps(3) infinite alternate;
}
.skull__upper {
width: 20rem;
height: 20rem;
border-radius: 50%;
z-index: 50;
position: relative;
}
.skull__upper::before, .skull__upper::after {
content: "";
display: block;
}
.skull__upper::before {
position: absolute;
border-radius: 50%;
box-shadow: 5.5rem 13.5rem 0px 2.8rem black, 14.5rem 13.5rem 0px 2.8rem black;
width: 1px;
height: 1px;
background-color: transparent;
}
.skull__hat {
justify-content: center;
background-color: #FFD020;
width: 20rem;
height: 10rem;
z-index: 45;
border-top-left-radius: calc(10rem + 7px);
border-top-right-radius: calc(10rem + 7px);
overflow: hidden;
}
.skull__hat::before, .skull__hat::after {
content: "";
display: block;
left: 0px;
right: 0px;
margin: auto;
}
.skull__hat::after {
height: 1rem;
background-color: #FFD020;
position: absolute;
border: 7px solid black;
border-radius: 1rem;
width: 30rem;
left: -5.5rem;
}
.skull__hat::before {
width: 18.5rem;
height: 0;
position: relative;
border-bottom: 3rem solid #FF0012;
border-left: 0.75rem solid transparent;
border-right: 0.75rem solid transparent;
margin-top: 5.35rem;
box-shadow: 0px 0px 0px 0px #191919, 0px -7px 0px 0px black;
}
.skull__lower {
width: 14rem;
height: 16rem;
border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
z-index: 49;
margin-top: -7rem;
overflow: hidden;
position: relative;
}
.skull__lower::before {
bottom: 4.5rem;
z-index: 40;
}
.skull__nose {
width: 3rem;
height: 2rem;
background: black;
border-radius: 50%;
position: absolute;
bottom: 2rem;
left: 0px;
right: 0px;
margin: auto;
}
.skull__jaw {
width: 21rem;
height: 21rem;
border-radius: 50%;
border: 7px solid black;
position: absolute;
margin: auto;
top: -12.5rem;
left: -4rem;
box-shadow: 0px 1.8rem 0px 0px white, 0px 2.2rem 0px 0px black;
}
.skull__jaw::before {
margin-left: 6.6rem;
-webkit-transform: rotate(10deg);
transform: rotate(10deg);
}
.skull__jaw::after {
margin-right: 6.6rem;
-webkit-transform: rotate(-10deg);
transform: rotate(-10deg);
}
.skull__bone {
background: white;
height: 3rem;
width: 36rem;
position: absolute;
border: 7px solid black;
-webkit-transform-origin: 50% 0%;
transform-origin: 50% 0%;
}
.skull__bone::before, .skull__bone::after {
content: "";
position: absolute;
border-radius: 50%;
top: -1.5rem;
width: 3rem;
height: 3rem;
background: white;
}
.skull__bone::before {
left: -1.5rem;
}
.skull__bone::after {
right: -1.5rem;
}
.skull__bone--left {
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.skull__bone--left::before {
box-shadow: 0 3rem 0 white, -2px 3.1rem 0px 2px black, -2px -0.1rem 0px 2px black;
}
.skull__bone--left::after {
box-shadow: 0 3rem 0 white, 3px 3.1rem 0px 1px black, 2px -0.1rem 0px 2px black;
}
.skull__bone--right {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.skull__bone--right::before {
box-shadow: 0 3rem 0 white, -2px 3.1rem 0px 2px black, -2px -0.1rem 0px 2px black;
}
.skull__bone--right::after {
box-shadow: 0 3rem 0 white, 3px 3.1rem 0px 1px black, 2px -0.1rem 0px 2px black;
}
Any suggestions to make it work at least in Firefox and Chrome.
Just removing the z-index from the .skull__hat class did the trick.
.skull__upper, .skull__lower {
background-color: white;
border: 7px solid black;
display: flex;
}
.skull__lower::before, .skull__jaw::before, .skull__jaw::after {
content: "";
width: 7px;
height: 6rem;
background-color: black;
display: inline-block;
position: absolute;
bottom: -1.6rem;
left: 0px;
right: 0px;
margin: auto;
}
#-webkit-keyframes boneDance {
0% {
-webkit-transform-origin: 49% 0%;
transform-origin: 49% 0%;
}
50% {
-webkit-transform-origin: 50% 0%;
transform-origin: 50% 0%;
}
100% {
-webkit-transform-origin: 51% 0%;
transform-origin: 51% 0%;
}
}
#keyframes boneDance {
0% {
-webkit-transform-origin: 49% 0%;
transform-origin: 49% 0%;
}
50% {
-webkit-transform-origin: 50% 0%;
transform-origin: 50% 0%;
}
100% {
-webkit-transform-origin: 51% 0%;
transform-origin: 51% 0%;
}
}
#-webkit-keyframes skullDance {
0% {
-webkit-transform: rotate(1deg);
transform: rotate(1deg);
}
50% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(-1deg);
transform: rotate(-1deg);
}
}
#keyframes skullDance {
0% {
-webkit-transform: rotate(1deg);
transform: rotate(1deg);
}
50% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(-1deg);
transform: rotate(-1deg);
}
}
#-webkit-keyframes blink {
from {
opacity: 0.4;
}
to {
opacity: 1;
}
}
#keyframes blink {
from {
opacity: 0.4;
}
to {
opacity: 1;
}
}
body {
background-color: #191919;
}
#media only screen and (max-width: 600px) {
body {
font-size: 12px;
}
}
.skull {
display: flex;
justify-content: center;
align-items: center;
margin-top: 10vh;
}
.skull__face {
display: flex;
flex-direction: column;
align-items: center;
z-index: 50;
position: relative;
}
.skull__face::after {
content: "";
width: 13rem;
border-radius: 50%;
box-shadow: 0px 0px 12rem 0 white;
position: absolute;
display: block;
height: 100%;
opacity: 0;
transition: opacity 1s ease-in-out;
}
.skull__face--animate:hover {
-webkit-animation: skullDance 1s steps(3) infinite alternate;
animation: skullDance 1s steps(3) infinite alternate;
cursor: none;
}
.skull__face--animate:hover::after {
opacity: 1;
-webkit-animation: blink 1s linear infinite alternate;
animation: blink 1s linear infinite alternate;
}
.skull__face--animate:hover ~ .skull__bone {
-webkit-animation: boneDance 1s steps(3) infinite alternate;
animation: boneDance 1s steps(3) infinite alternate;
}
.skull__upper {
width: 20rem;
height: 20rem;
border-radius: 50%;
z-index: 50;
position: relative;
}
.skull__upper::before, .skull__upper::after {
content: "";
display: block;
}
.skull__upper::before {
position: absolute;
border-radius: 50%;
box-shadow: 5.5rem 13.5rem 0px 2.8rem black, 14.5rem 13.5rem 0px 2.8rem black;
width: 1px;
height: 1px;
background-color: transparent;
}
.skull__hat {
justify-content: center;
background-color: #FFD020;
width: 20rem;
height: 10rem;
border-top-left-radius: calc(10rem + 7px);
border-top-right-radius: calc(10rem + 7px);
overflow: hidden;
}
.skull__hat::before, .skull__hat::after {
content: "";
display: block;
left: 0px;
right: 0px;
margin: auto;
}
.skull__hat::after {
height: 1rem;
background-color: #FFD020;
position: absolute;
border: 7px solid black;
border-radius: 1rem;
width: 30rem;
left: -5.5rem;
}
.skull__hat::before {
width: 18.5rem;
height: 0;
position: relative;
border-bottom: 3rem solid #FF0012;
border-left: 0.75rem solid transparent;
border-right: 0.75rem solid transparent;
margin-top: 5.35rem;
box-shadow: 0px 0px 0px 0px #191919, 0px -7px 0px 0px black;
}
.skull__lower {
width: 14rem;
height: 16rem;
border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
z-index: 49;
margin-top: -7rem;
overflow: hidden;
position: relative;
}
.skull__lower::before {
bottom: 4.5rem;
z-index: 40;
}
.skull__nose {
width: 3rem;
height: 2rem;
background: black;
border-radius: 50%;
position: absolute;
bottom: 2rem;
left: 0px;
right: 0px;
margin: auto;
}
.skull__jaw {
width: 21rem;
height: 21rem;
border-radius: 50%;
border: 7px solid black;
position: absolute;
margin: auto;
top: -12.5rem;
left: -4rem;
box-shadow: 0px 1.8rem 0px 0px white, 0px 2.2rem 0px 0px black;
}
.skull__jaw::before {
margin-left: 6.6rem;
-webkit-transform: rotate(10deg);
transform: rotate(10deg);
}
.skull__jaw::after {
margin-right: 6.6rem;
-webkit-transform: rotate(-10deg);
transform: rotate(-10deg);
}
.skull__bone {
background: white;
height: 3rem;
width: 36rem;
position: absolute;
border: 7px solid black;
-webkit-transform-origin: 50% 0%;
transform-origin: 50% 0%;
}
.skull__bone::before, .skull__bone::after {
content: "";
position: absolute;
border-radius: 50%;
top: -1.5rem;
width: 3rem;
height: 3rem;
background: white;
}
.skull__bone::before {
left: -1.5rem;
}
.skull__bone::after {
right: -1.5rem;
}
.skull__bone--left {
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.skull__bone--left::before {
box-shadow: 0 3rem 0 white, -2px 3.1rem 0px 2px black, -2px -0.1rem 0px 2px black;
}
.skull__bone--left::after {
box-shadow: 0 3rem 0 white, 3px 3.1rem 0px 1px black, 2px -0.1rem 0px 2px black;
}
.skull__bone--right {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.skull__bone--right::before {
box-shadow: 0 3rem 0 white, -2px 3.1rem 0px 2px black, -2px -0.1rem 0px 2px black;
}
.skull__bone--right::after {
box-shadow: 0 3rem 0 white, 3px 3.1rem 0px 1px black, 2px -0.1rem 0px 2px black;
}
<div class="skull">
<div class="skull__face skull__face--animate">
<div class="skull__upper">
<div class="skull__hat"></div>
<div class="skull__nose"></div>
</div>
<div class="skull__lower">
<div class="skull__jaw"></div>
</div>
</div>
<div class="skull__bone skull__bone--left"></div>
<div class="skull__bone skull__bone--right"></div>
</div>

CSS circle border fill animation

I have a css file which makes circle border fill animation perfectly. Its in 100px width and height. But i need only in 50px width and height circle with the same animation. I tried many more times to minimize the size, but the circle not get correctly fix with animation. please help me to smaller this circle.
My need:
Width-50px
Height -50px
border size as per the image file attached -circle border fill sample image
My code
#loading
{
width: 100px;
height: 100px;
margin: 30px auto;
position: relative;
}
.outer-shadow, .inner-shadow
{
z-index: 4;
position: absolute;
width: 100%;
height: 100%;
border-radius: 100%;
box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.inner-shadow
{
top: 50%;
left: 50%;
width: 80px;
height: 80px;
margin-left: -40px;
margin-top: -40px;
border-radius: 100%;
background-color: #ffffff;
box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.hold
{
position: absolute;
width: 100%;
height: 100%;
clip: rect(0px, 100px, 100px, 50px);
border-radius: 100%;
background-color: #fff;
}
.fill, .dot span
{
background-color: #f50;
}
.fill
{
position: absolute;
width: 100%;
height: 100%;
border-radius: 100%;
clip: rect(0px, 50px, 100px, 0px);
}
.left .fill
{
z-index: 1;
-webkit-animation: left 1s linear ;
-moz-animation: left 1s linear ;
animation: left 1s linear both;
}
#keyframes left
{
0%{-webkit-transform:rotate(0deg);}
100%{transform:rotate(180deg);}
}
#-webkit-keyframes left
{
0%{-webkit-transform:rotate(0deg);}
100%{-webkit-transform:rotate(180deg);}
}
.right
{
z-index: 3;
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
transform: rotate(180deg);
}
.right .fill
{
z-index: 3;
-webkit-animation: right 1s linear ;
-moz-animation: right 1s linear ;
animation: right 1s linear both ;
-webkit-animation-delay: 1s;
-moz-animation-delay: 1s;
animation-delay: 1s;
}
#keyframes right
{
0%{-webkit-transform:rotate(0deg);}
100%{transform:rotate(180deg);}
}
#-webkit-keyframes right
{
0% {transform: rotate(0deg);}
100% {transform: rotate(180deg);}
}
My code in jsfiddle...!
You need to divide by 2 every values involved, even the clip(); ones (fiddle updated)
#loading {
width: 50px;
height: 50px;
margin: 30px auto;
position: relative;
}
.outer-shadow,
.inner-shadow {
z-index: 4;
position: absolute;
width: 100%;
height: 100%;
border-radius: 100%;
box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.inner-shadow {
top: 50%;
left: 50%;
width: 40px;
height: 40px;
margin-left: -20px;
margin-top: -20px;
border-radius: 100%;
background-color: #ffffff;
box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.hold {
position: absolute;
width: 100%;
height: 100%;
clip: rect(0px, 50px, 50px, 25px);
border-radius: 100%;
background-color: #fff;
}
.fill,
.dot span {
background-color: #f50;
}
.fill {
position: absolute;
width: 100%;
height: 100%;
border-radius: 100%;
clip: rect(0px, 25px, 50px, 0px);
}
.left .fill {
z-index: 1;
-webkit-animation: left 1s linear;
-moz-animation: left 1s linear;
animation: left 1s linear both;
}
#keyframes left {
0% {
-webkit-transform: rotate(0deg);
}
100% {
transform: rotate(180deg);
}
}
#-webkit-keyframes left {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(180deg);
}
}
.right {
z-index: 3;
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
transform: rotate(180deg);
}
.right .fill {
z-index: 3;
-webkit-animation: right 1s linear;
-moz-animation: right 1s linear;
animation: right 1s linear both;
-webkit-animation-delay: 1s;
-moz-animation-delay: 1s;
animation-delay: 1s;
}
#keyframes right {
0% {
-webkit-transform: rotate(0deg);
}
100% {
transform: rotate(180deg);
}
}
#-webkit-keyframes right {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(180deg);
}
}
.inner-shadow img {
margin-left: 8px;
margin-top: 7px;
}
<div id='loading'>
<div class='outer-shadow'>
</div>
<div class='inner-shadow'>
</div>
<div class='hold left'>
<div class='fill'></div>
</div>
<div class='hold right'>
<div class='fill'></div>
</div>
</div>
edit: in respond to comment #Filipe
How would the change from clip to clip-path be? I tried (also changing rect to inset), but the animation stops working.
Possible example with clip-path instead clip .
#loading {
width: 50px;
height: 50px;
margin: 30px auto;
position: relative;
}
.outer-shadow,
.inner-shadow {
z-index: 4;
position: absolute;
width: 100%;
height: 100%;
border-radius: 100%;
box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.inner-shadow {
top: 50%;
left: 50%;
width: 40px;
height: 40px;
margin-left: -20px;
margin-top: -20px;
border-radius: 100%;
background-color: #ffffff;
box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.hold {
position: absolute;
width: 100%;
height: 100%;
clip-path: polygon(50% 0, 0 0, 0 100%, 50% 100%);
border-radius: 100%;
background-color: #fff;
}
.fill,
.dot span {
background-color: #f50;
}
.fill {
position: absolute;
width: 100%;
height: 100%;
border-radius: 100%;
clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}
.left .fill {
z-index: 1;
-webkit-animation: left 1s linear;
-moz-animation: left 1s linear;
animation: left 1s linear both;
}
#keyframes left {
0% {
-webkit-transform: rotate(0deg);
}
100% {
transform: rotate(180deg);
}
}
#-webkit-keyframes left {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(180deg);
}
}
.right {
z-index: 3;
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
transform: rotate(180deg);
}
.right .fill {
z-index: 3;
-webkit-animation: right 1s linear;
-moz-animation: right 1s linear;
animation: right 1s linear both;
-webkit-animation-delay: 1s;
-moz-animation-delay: 1s;
animation-delay: 1s;
}
#keyframes right {
0% {
-webkit-transform: rotate(0deg);
}
100% {
transform: rotate(180deg);
}
}
#-webkit-keyframes right {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(180deg);
}
}
.inner-shadow img {
margin-left: 8px;
margin-top: 7px;
}
<div id='loading'>
<div class='outer-shadow'>
</div>
<div class='inner-shadow'>
</div>
<div class='hold left'>
<div class='fill'></div>
</div>
<div class='hold right'>
<div class='fill'></div>
</div>
</div>
is this what you expect,hope this will help to you.try this.I only concerned about the circle size of 50 px with inside circle.if this is not the case tell me.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>jquery</title>
<style type="text/css">
div.circleone{
width: 50px;
height: 50px;
border-radius: 25px;
box-shadow: 1px 2px 1px black;
}
div.circletwo
{
width: 25px;
height: 25px;
border-radius: 12.5px;
box-shadow: 1px -1px 1px black;
position: relative;
top: 25%;
left: 25%;
}
</style>
</head>
<body>
<div class="circleone">
<div class="circletwo"></div>
</div>
</body>
</html>

Partially completed circle (with text) in CSS

I'm trying to create the following effect with on a design: http://i.imgur.com/RIaSA3N.png
I can create a bordered circle fine - but the matter of partially completing the circle is proving difficult. There are a myriad of different ways to do this with Javascript and Canvas, but I can't find a solid way to achieve it in CSS. I don't mind having a number of different classes for different values, but is there an elegant solution available?
Updated: this is very possible using pure CSS3.
(You should be able to open the below demo and customize to your result)
Use #keyframes to animate between the numbers. You'll need to add this.
Below is using #keyframes 'rotate' { for the circular motion.
body { background: #222; }
.circle {
width: 100px;
height: 100px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
background: #333;
border-radius: 50%;
}
.inner-circle {
width: 92%;
height: 92%;
background: #222;
border-radius: 50%;
margin: auto;
vertical-align: middle;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.spinner {
height: 0;
width: 0;
border-radius: 50%;
border-right: 50px solid rgba(255,255,255,0.3);
border-top: 50px solid transparent;
border-left: 50px solid transparent;
border-bottom: 50px solid transparent;
-webkit-animation: rotate 1.6s infinite;
animation: rotate 1.6s infinite;
}
#-webkit-keyframes 'rotate' {
from {
-webkit-transform: rotate(0);
transform: rotate(0);
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#keyframes 'rotate' {
from {
-webkit-transform: rotate(0);
transform: rotate(0);
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
<div class="circle">
<div class="spinner"></div>
<div class="inner-circle"></div>
</div>

Marker animation working in Chrome browser and not in Safari

How do I make the below animation fully work in safari browser ? It is working fine in Chrome.
Open the below link in chrome to see its full functionality (bounce and pulse effect), and in Safari to see the issue. Pulse effect around the pin doesn't work in safari!!
How can I fix this ?
Here is the JS FIDDLE link
html code:
<div class='pin bounce'></div>
<div class='pulse'></div>
CSS code:
body {
background: #e6e6e6;
}
.pin {
width: 30px;
height: 30px;
border-radius: 50% 50% 50% 0;
background: #00cae9;
position: absolute;
-webkit-transform: rotate(-45deg);
left: 50%;
top: 50%;
margin: -20px 0 0 -20px;
}
.pin:after {
content: "";
width: 14px;
height: 14px;
margin: 8px 0 0 8px;
background: #e6e6e6;
position: absolute;
border-radius: 50%;
}
.bounce {
-webkit-animation-name: bounce;
-webkit-animation-fill-mode: both;
-webkit-animation-duration: 1s;
}
.pulse {
background: #d6d4d4;
border-radius: 50%;
height: 14px;
width: 14px;
position: absolute;
left: 50%;
top: 50%;
margin: 11px 0px 0px -12px;
-webkit-transform: rotateX(55deg);
z-index: -2;
}
.pulse:after {
content: "";
border-radius: 50%;
height: 40px;
width: 40px;
position: absolute;
margin: -13px 0 0 -13px;
-webkit-animation: pulsate 1s ease-out;
-webkit-animation-iteration-count: infinite;
opacity: 0;
box-shadow: 0 0 1px 2px #00cae9;
-webkit-animation-delay: 1.1s;
}
#-webkit-keyframes pulsate {
0% {
-webkit-transform: scale(0.1, 0.1);
opacity: 0;
}
50% {
opacity: 1;
}
100% {
-webkit-transform: scale(1.2, 1.2);
opacity: 0;
}
}
#-webkit-keyframes bounce {
0% {
opacity: 0;
-webkit-transform: translateY(-2000px) rotate(-45deg);
}
60% {
opacity: 1;
-webkit-transform: translateY(30px) rotate(-45deg);
}
80% {
-webkit-transform: translateY(-10px) rotate(-45deg);
}
100% {
-webkit-transform: translateY(0) rotate(-45deg);
}
}

Resources