Related
I have a 3D triangle with a base color for every shape, but I want the base (aka the square) to have an animated color, but after adding the animation, the triangles all lay flat all of the sudden. When I remove the animation, the shapes readjust as they should.
For the animation I hue-rotate the linear-gradient color of the square in #keframes animate.
Here is the html code:
<div class="wrapper">
<div class="pyramid">
<div class="square">
<div class="triangle"></div>
<div class="triangle"></div>
<div class="triangle"></div>
<div class="triangle"></div>
</div>
</div>
</div>
And CSS:
#-webkit-keyframes animate {
0%, 100% {
filter: hue-rotate(0deg);
}
50% {
filter: hue-rotate(360deg);
}
}
#keyframes animate {
0%, 100% {
filter: hue-rotate(0deg);
}
50% {
filter: hue-rotate(360deg);
}
}
#-webkit-keyframes rotate {
from {
transform: rotateX(120deg) rotateZ(0deg);
}
50% {
transform: rotateX(120deg) rotateZ(180deg);
}
to {
transform: rotateX(120deg) rotateZ(360deg);
}
}
#keyframes rotate {
from {
transform: rotateX(120deg) rotateZ(0deg);
}
50% {
transform: rotateX(120deg) rotateZ(180deg);
}
to {
transform: rotateX(120deg) rotateZ(360deg);
}
}
.wrapper {
position: relative;
display: flex;
justify-content: center;
align-items: center;
top: 500px;
left: 50%;
margin-bottom: 0;
transform-style: preserve-3d;
width: 3.75rem;
height: 3.75rem;
transform-origin: 1.875rem 1.875rem;
transform: rotateX(120deg) rotateZ(45deg);
-webkit-animation: rotate 4s linear infinite;
animation: rotate 4s linear infinite;
}
.pyramid {
position: absolute;
perspective: 500px;
transform-style: preserve-3d;
}
.square {
width: 3.75rem;
height: 3.75rem;
transform-style: preserve-3d;
background: linear-gradient(to left, #008aff, #00ffe7);
-webkit-animation: animate 5s linear infinite;
animation: animate 5s linear infinite;
}
.triangle {
position: absolute;
width: 5rem;
height: 5rem;
}
.triangle:nth-child(1) {
width: 3.75rem;
top: -33%;
background: #f1ecfb;
-webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
transform-origin: 50% 100%;
transform: rotateX(-68deg);
}
.triangle:nth-child(2) {
width: 3.75rem;
background: #f1ecfb;
-webkit-clip-path: polygon(50% 100%, 0 0, 100% 0);
clip-path: polygon(50% 100%, 0 0, 100% 0);
transform-origin: 50% 0%;
transform: rotateX(68deg);
}
.triangle:nth-child(3) {
height: 3.75rem;
left: -33%;
background: white;
transform-origin: 100% 50%;
-webkit-clip-path: polygon(100% 100%, 0 50%, 100% 0);
clip-path: polygon(100% 100%, 0 50%, 100% 0);
transform: rotateY(68deg);
}
.triangle:nth-child(4) {
height: 3.75rem;
background: white;
transform-origin: 0% 50%;
-webkit-clip-path: polygon(0 100%, 100% 50%, 0 0);
clip-path: polygon(0 100%, 100% 50%, 0 0);
transform: rotateY(-68deg);
}
I changed it so that the animation changes the background color which resolves the issue.
#-webkit-keyframes animate {
0%, 100%{
background: #ffadad;
}
12.5%{
background: #ffd6a5;
}
25%{
background: #fdffb6;
}
37.5%{
background: #caffbf;
}
50%{
background: #9bf6ff;
}
62.5%{
background: #a0c4ff;
}
75%{
background: #bdb2ff;
}
87.5%{
background: #ffc6ff;
}
}
#keyframes animate {
0%, 100%{
background: #ffadad;
}
12.5%{
background: #ffd6a5;
}
25%{
background: #fdffb6;
}
37.5%{
background: #caffbf;
}
50%{
background: #9bf6ff;
}
62.5%{
background: #a0c4ff;
}
75%{
background: #bdb2ff;
}
87.5%{
background: #ffc6ff;
}
}
Beautiful Navigation Knob
I want to use this awesome CSS work, but I can't figure out how to change it from 6 buttons to 3 buttons only.
Original:
https://codepen.io/ademilter/pen/Dwelk
My try:
https://codepen.io/shellx3/pen/KKyKaKM
.den #switch_1:checked ~ .light {
-moz-transform: rotate(-30deg);
-webkit-transform: rotate(-30deg);
-o-transform: rotate(-30deg);
}
Just played with deg to get this. https://codepen.io/Sreehariavikkal/pen/mdqdWWR Please try inspecting and changing according to your need.
<div class="container">
<!-- OUTER SHADOW -->
<div class="de">
<!-- TEXT -->
<div class="den">
<!-- LINE -->
<hr class="line">
<hr class="line">
<!-- SWITCH -->
<div class="switch">
<!-- TEXT -->
<label for="switch_off"><span>OFF</span></label>
<label for="switch_1"><span>1</span></label>
<label for="switch_2"><span>2</span></label>
<label for="switch_3"><span>3</span></label>
<!-- <label for="switch_4"><span>4</span></label>
<label for="switch_5"><span>5</span></label> -->
<!-- INPUT -->
<input id="switch_off" name="switch" checked type="radio">
<input id="switch_1" name="switch" type="radio">
<input id="switch_2" name="switch" type="radio">
<input id="switch_3" name="switch" type="radio">
<!-- <input id="switch_4" name="switch" type="radio">
<input id="switch_5" name="switch" type="radio"> -->
<!-- LIGHT -->
<div class="light"><span></span></div>
<!-- DOT -->
<div class="dot"><span></span></div>
<!-- CENTER -->
<div class="dene">
<div class="denem">
<div class="deneme">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
/* MASTER
--------------------------------------------- */
html, body {
height: 100%;
}
body {
font-family: Helvetica, Arial, sans-serif;
color: #333;
font-size: 13px;
background: #fefefe;
background: -moz-linear-gradient(top, #fefefe 0%, #dbe5e7 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fefefe), color-stop(100%, #dbe5e7));
background: -webkit-linear-gradient(top, #fefefe 0%, #dbe5e7 100%);
background: -o-linear-gradient(top, #fefefe 0%, #dbe5e7 100%);
background-attachment: fixed;
}
/* SWITCH
--------------------------------------------- */
.container {
width: 230px;
width: 230px;
margin: 40px auto 0;
}
.container .origin {
position: absolute;
left: 50%;
top: 50%;
z-index: 111;
width: 2px;
height: 2px;
margin: -1px 0 0 -1px;
background-color: #f50;
}
.de {
-webkit-user-select: none;
position: relative;
width: 230px;
height: 230px;
border-radius: 100%;
box-shadow: 0 0 25px rgba(0, 0, 0, .1);
background-color: transparent;
}
.de .den, .de .dene, .de .denem, .de .deneme, .de .light, .de .dot {
position: absolute;
left: 50%;
top: 50%;
}
.den {
position: relative;
width: 220px;
height: 220px;
margin: -110px 0 0 -110px;
border-radius: 100%;
box-shadow: inset 0 3px 10px rgba(0, 0, 0, .6), 0 2px 20px rgba(255, 255, 255, 1);
background: #888888;
background: -moz-radial-gradient(center, ellipse cover, #888888 0%, #333333 100%);
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #888888), color-stop(100%, #333333));
background: -webkit-radial-gradient(center, ellipse cover, #888888 0%, #333333 100%);
background: -o-radial-gradient(center, ellipse cover, #888888 0%, #333333 100%);
}
.dene {
z-index: 4;
width: 140px;
height: 140px;
margin: -70px 0 0 -70px;
border-radius: 100%;
box-shadow: inset 0 2px 2px rgba(255, 255, 255, .4), 0 3px 13px rgba(0, 0, 0, .85);
background: #f2f6f5;
background: -moz-linear-gradient(top, #f2f6f5 0%, #cbd5d6 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f2f6f5), color-stop(100%, #cbd5d6));
background: -webkit-linear-gradient(top, #f2f6f5 0%, #cbd5d6 100%);
background: -o-linear-gradient(top, #f2f6f5 0%, #cbd5d6 100%);
}
.denem {
width: 120px;
height: 120px;
margin: -60px 0 0 -60px;
border-radius: 100%;
background: #cbd5d6;
background: -moz-linear-gradient(top, #cbd5d6 0%, #f2f6f5 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #cbd5d6), color-stop(100%, #f2f6f5));
background: -webkit-linear-gradient(top, #cbd5d6 0%, #f2f6f5 100%);
background: -o-linear-gradient(top, #cbd5d6 0%, #f2f6f5 100%);
}
.deneme {
width: 100px;
height: 100px;
margin: -50px 0 0 -50px;
border-radius: 100%;
box-shadow: inset 0 2px 3px rgba(255, 255, 255, .6), 0 8px 20px rgba(0, 0, 0, .9);
background: #eef7f6;
background: -moz-linear-gradient(top, #eef7f6 0%, #8d989a 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eef7f6), color-stop(100%, #8d989a));
background: -webkit-linear-gradient(top, #eef7f6 0%, #8d989a 100%);
background: -o-linear-gradient(top, #eef7f6 0%, #8d989a 100%);
}
.den .switch {
z-index: 3;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.den .switch label {
z-index: 2;
position: absolute;
top: 50%;
left: 50%;
width: 50%;
height: 70px;
margin-top: -35px;
-moz-transform-origin: 0% 50%;
-webkit-transform-origin: 0% 50%;
-o-transform-origin: 0% 50%;
}
.den .switch label:after {
content: "";
position: absolute;
top: 6px;
left: 1px;
width: 100%;
height: 30px;
-moz-transform: rotate(-30deg);
-webkit-transform: rotate(-30deg);
-o-transform: rotate(-30deg);
}
.den .switch label:before {
content: "";
position: absolute;
bottom: 6px;
left: 1px;
width: 100%;
height: 30px;
-moz-transform: rotate(30deg);
-webkit-transform: rotate(30deg);
-o-transform: rotate(30deg);
}
.den .switch label span {
z-index: 2;
position: absolute;
top: 0;
right: 0;
width: 40px;
height: 100%;
font-weight: bold;
font-size: 15px;
line-height: 70px;
text-align: center;
color: #eee;
text-shadow: 0 1px 0 #444;
}
.den .switch label:nth-child(1) {
-moz-transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
}
.den .switch label:nth-child(1) span {
right: 2px;
font-size: 13px;
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
-o-transform: rotate(90deg);
}
.den .switch label:nth-child(2) {
-moz-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-o-transform: rotate(360deg);
}
.den .switch label:nth-child(2) span {
-moz-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-o-transform: rotate(360deg);
}
.den .switch label:nth-child(3) {
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
-o-transform: rotate(90deg);
}
.den .switch label:nth-child(3) span {
-moz-transform: rotate(270deg);
-webkit-transform: rotate(270deg);
-o-transform: rotate(270deg);
}
.den .switch label:nth-child(4) {
-moz-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-o-transform: rotate(180deg);
}
.den .switch label:nth-child(4) span {
-moz-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-o-transform: rotate(180deg);
}
.den .switch label:nth-child(5) {
-moz-transform: rotate(150deg);
-webkit-transform: rotate(150deg);
-o-transform: rotate(150deg);
}
.den .switch label:nth-child(5) span {
-moz-transform: rotate(-150deg);
-webkit-transform: rotate(-150deg);
-o-transform: rotate(-150deg);
}
.den .switch label:nth-child(6) {
-moz-transform: rotate(210deg);
-webkit-transform: rotate(210deg);
-o-transform: rotate(210deg);
}
.den .switch label:nth-child(6) span {
-moz-transform: rotate(-210deg);
-webkit-transform: rotate(-210deg);
-o-transform: rotate(-210deg);
}
.den .switch input {
position: absolute;
opacity: 0;
visibility: hidden;
}
/* SWITCH LIGHT */
.den .light {
z-index: 1;
width: 50%;
height: 100px;
margin-top: -50px;
-moz-transform-origin: 0% 50%;
-webkit-transform-origin: 0% 50%;
-o-transform-origin: 0% 50%;
-moz-transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-webkit-transition: all .5s;
-moz-transition: all .5s;
-o-transition: all .5s;
}
.den .light span {
opacity: .4;
position: absolute;
top: 0;
left: 15px;
width: 100px;
height: 100px;
background: -moz-radial-gradient(center, ellipse cover, rgba(184, 163, 204, 1) 0%, rgba(159, 197, 224, 0.42) 42%, rgba(111, 113, 179, 0) 72%, rgba(67, 34, 137, 0) 100%);
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, rgba(184, 163, 204, 1)), color-stop(42%, rgba(159, 197, 224, 0.42)), color-stop(72%, rgba(111, 113, 179, 0)), color-stop(100%, rgba(67, 34, 137, 0)));
background: -webkit-radial-gradient(center, ellipse cover, rgba(184, 163, 204, 1) 0%, rgba(159, 197, 224, 0.42) 42%, rgba(111, 113, 179, 0) 72%, rgba(67, 34, 137, 0) 100%);
background: -o-radial-gradient(center, ellipse cover, rgba(184, 163, 204, 1) 0%, rgba(159, 197, 224, 0.42) 42%, rgba(111, 113, 179, 0) 72%, rgba(67, 34, 137, 0) 100%);
}
/* SWITCH LIGHT POSITION */
.den #switch_off:checked ~ .light {
-moz-transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
}
.den #switch_1:checked ~ .light {
-moz-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
-o-transform: rotate(0deg);
}
.den #switch_2:checked ~ .light {
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
-o-transform: rotate(90deg);
}
.den #switch_3:checked ~ .light {
-moz-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-o-transform: rotate(180deg);
}
/* SWITCH LIGHT */
.den .dot {
z-index: 6;
width: 50%;
height: 12px;
margin-top: -6px;
-moz-transform-origin: 0% 50%;
-webkit-transform-origin: 0% 50%;
-o-transform-origin: 0% 50%;
-webkit-transition: all .5s;
-moz-transition: all .5s;
-o-transition: all .5s;
}
.den .dot span {
position: absolute;
top: 0;
left: 30px;
width: 12px;
height: 12px;
border-radius: 100%;
background: #dae2e4;
background: -moz-linear-gradient(top, #dae2e4 0%, #ecf5f4 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #dae2e4), color-stop(100%, #ecf5f4));
background: -webkit-linear-gradient(top, #dae2e4 0%, #ecf5f4 100%);
background: -o-linear-gradient(top, #dae2e4 0%, #ecf5f4 100%);
}
/* SWITCH LIGHT POSITION */
.den #switch_off:checked ~ .dot {
-moz-transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
}
.den #switch_off:checked ~ .dot span {
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
-o-transform: rotate(90deg);
}
.den #switch_1:checked ~ .dot {
-moz-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
-o-transform: rotate(0deg);
}
.den #switch_1:checked ~ .dot span {
opacity: .9;
-moz-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
-o-transform: rotate(0deg);
}
.den #switch_2:checked ~ .dot {
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
-o-transform: rotate(90deg);
}
.den #switch_2:checked ~ .dot span {
opacity: .5;
-moz-transform: rotate(-30deg);
-webkit-transform: rotate(-30deg);
-o-transform: rotate(-30deg);
}
.den #switch_3:checked ~ .dot {
-moz-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-o-transform: rotate(180deg);
}
.den #switch_3:checked ~ .dot span {
opacity: .4;
-moz-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-o-transform: rotate(180deg);
}
/* LINE */
.den hr.line {
z-index: 1;
position: absolute;
top: 50%;
width: 100%;
height: 0;
margin-top: -1px;
border-width: 1px 0;
border-style: solid;
border-top-color: #3c3d3f;
border-bottom-color: #666769;
}
.den hr.line:nth-child(1) {
-moz-transform: rotate(-210deg);
-webkit-transform: rotate(-210deg);
-o-transform: rotate(-210deg);
}
.den hr.line:nth-child(2) {
-moz-transform: rotate(210deg);
-webkit-transform: rotate(210deg);
-o-transform: rotate(210deg);
}
I need these glowing bubbles to move around smoothly like galaxies in a universe.
There are four bubbles here just moving up, I can't seem to make them move in rounds like a galaxy scaling(1) from center and while moving to the right-top and going into deep space and decrease scaling(0.3) and while moving to the right direction, "something like that".
How do we do this in pure css?
The glowing bubbles code
body {
background: #26323e;
}
#keyframes greenPulse {
0% {
box-shadow: 0 0 30px #4bbec8
}
50% {
box-shadow: 0 0 80px #4bbec8
}
100% {
box-shadow: 0 0 30px #4bbec8
}
}
#-webkit-keyframes greenPulse {
0% {
-webkit-box-shadow: 0 0 30px #4bbec8
}
50% {
-webkit-box-shadow: 0 0 80px #4bbec8
}
100% {
-webkit-box-shadow: 0 0 30px #4bbec8
}
}
#-moz-keyframes greenPulse {
0% {
-moz-box-shadow: 0 0 30px #4bbec8
}
50% {
-moz-box-shadow: 0 0 80px #4bbec8
}
100% {
-moz-box-shadow: 0 0 30px #4bbec8
}
}
#-o-keyframes greenPulse {
0% {
-o-box-shadow: 0 0 30px #4bbec8
}
50% {
-o-box-shadow: 0 0 80px #4bbec8
}
100% {
-o-box-shadow: 0 0 30px #4bbec8
}
}
#keyframes bubbleUp {
0% {
bottom: 110px;
-webkit-transform: scale(.9);
opacity: 0
}
1% {
bottom: 110px;
-webkit-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-webkit-transform: scale(.8);
opacity: 1
}
95% {
bottom: 545px;
-webkit-transform: scale(.3);
opacity: 1
}
99% {
bottom: 550px;
-webkit-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-webkit-transform: scale(.9);
opacity: 0
}
}
#-webkit-keyframes bubbleUp {
0% {
bottom: 110px;
-webkit-transform: scale(.9);
opacity: 0
}
1% {
bottom: 110px;
-webkit-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-webkit-transform: scale(.8);
opacity: 1
}
95% {
bottom: 545px;
-webkit-transform: scale(.3);
opacity: 1
}
99% {
bottom: 550px;
-webkit-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-webkit-transform: scale(.9);
opacity: 0
}
}
#-moz-keyframes bubbleUp {
0% {
bottom: 110px;
-moz-transform: scale(.9);
opacity: 0
}
1% {
bottom: 110px;
-moz-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-moz-transform: scale(.8);
opacity: 1
}
95% {
bottom: 545px;
-moz-transform: scale(.3);
opacity: 1
}
99% {
bottom: 550px;
-moz-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-moz-transform: scale(.9);
opacity: 0
}
}
#-o-keyframes bubbleUp {
0% {
bottom: 110px;
-o-transform: scale(.9);
opacity: 0
}
1% {
bottom: 110px;
-o-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-o-transform: scale(.8);
opacity: 1
}
95% {
bottom: 545px;
-o-transform: scale(.3);
opacity: 1
}
99% {
bottom: 550px;
-o-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-o-transform: scale(.9);
opacity: 0
}
}
#keyframes bubbleUp1 {
0% {
bottom: 120px;
transform: scale(.3);
opacity: 0
}
1% {
bottom: 80px;
transform: scale(.2);
opacity: 0
}
30% {
bottom: 90px;
transform: scale(.2);
opacity: 1
}
95% {
bottom: 500px;
transform: scale(.4);
opacity: 1
}
99% {
bottom: 550px;
transform: scale(.2);
opacity: 0
}
100% {
bottom: 140px;
transform: scale(.9);
opacity: 0
}
}
#-webkit-keyframes bubbleUp1 {
0% {
bottom: 120px;
-webkit-transform: scale(.3);
opacity: 0
}
1% {
bottom: 80px;
-webkit-transform: scale(.2);
opacity: 0
}
30% {
bottom: 90px;
-webkit-transform: scale(.2);
opacity: 1
}
95% {
bottom: 500px;
-webkit-transform: scale(.4);
opacity: 1
}
99% {
bottom: 550px;
-webkit-transform: scale(.2);
opacity: 0
}
100% {
bottom: 140px;
-webkit-transform: scale(.9);
opacity: 0
}
}
#-moz-keyframes bubbleUp1 {
0% {
bottom: 120px;
-moz-transform: scale(.3);
opacity: 0
}
1% {
bottom: 80px;
-moz-transform: scale(.2);
opacity: 0
}
30% {
bottom: 90px;
-moz-transform: scale(.2);
opacity: 1
}
95% {
bottom: 500px;
-moz-transform: scale(.4);
opacity: 1
}
99% {
bottom: 550px;
-moz-transform: scale(.2);
opacity: 0
}
100% {
bottom: 140px;
-moz-transform: scale(.9);
opacity: 0
}
}
#-o-keyframes bubbleUp1 {
0% {
bottom: 120px;
-o-transform: scale(.3);
opacity: 0
}
1% {
bottom: 80px;
-o-transform: scale(.2);
opacity: 0
}
30% {
bottom: 90px;
-o-transform: scale(.2);
opacity: 1
}
95% {
bottom: 500px;
-o-transform: scale(.4);
opacity: 1
}
99% {
bottom: 550px;
-o-transform: scale(.2);
opacity: 0
}
100% {
bottom: 140px;
-o-transform: scale(.9);
opacity: 0
}
}
#keyframes bubbleUp2 {
0% {
bottom: 110px;
transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
transform: scale(.9);
opacity: 1
}
95% {
bottom: 650px;
transform: scale(.3);
opacity: 1
}
99% {
bottom: 655px;
transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
transform: scale(1);
opacity: 0
}
}
#-webkit-keyframes bubbleUp2 {
0% {
bottom: 110px;
-webkit-transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
-webkit-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-webkit-transform: scale(.9);
opacity: 1
}
95% {
bottom: 650px;
-webkit-transform: scale(.3);
opacity: 1
}
99% {
bottom: 655px;
-webkit-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-webkit-transform: scale(1);
opacity: 0
}
}
#-moz-keyframes bubbleUp2 {
0% {
bottom: 110px;
-moz-transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
-moz-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-moz-transform: scale(.9);
opacity: 1
}
95% {
bottom: 650px;
-moz-transform: scale(.3);
opacity: 1
}
99% {
bottom: 655px;
-moz-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-moz-transform: scale(1);
opacity: 0
}
}
#-o-keyframes bubbleUp2 {
0% {
bottom: 110px;
-o-transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
-o-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-o-transform: scale(.9);
opacity: 1
}
95% {
bottom: 650px;
-o-transform: scale(.3);
opacity: 1
}
99% {
bottom: 655px;
-o-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-o-transform: scale(1);
opacity: 0
}
}
#keyframes bubbleUp3 {
0% {
bottom: 110px;
transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
transform: scale(.9);
opacity: 1
}
95% {
bottom: 495px;
transform: scale(.3);
opacity: 1
}
99% {
bottom: 500px;
transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
transform: scale(1);
opacity: 0
}
}
#-webkit-keyframes bubbleUp3 {
0% {
bottom: 110px;
-webkit-transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
-webkit-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-webkit-transform: scale(.9);
opacity: 1
}
95% {
bottom: 495px;
-webkit-transform: scale(.3);
opacity: 1
}
99% {
bottom: 500px;
-webkit-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-webkit-transform: scale(1);
opacity: 0
}
}
#-moz-keyframes bubbleUp3 {
0% {
bottom: 110px;
-moz-transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
-moz-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-moz-transform: scale(.9);
opacity: 1
}
95% {
bottom: 495px;
-moz-transform: scale(.3);
opacity: 1
}
99% {
bottom: 500px;
-moz-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-moz-transform: scale(1);
opacity: 0
}
}
#-o-keyframes bubbleUp3 {
0% {
bottom: 110px;
-o-transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
-o-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-o-transform: scale(.9);
opacity: 1
}
95% {
bottom: 495px;
-o-transform: scale(.3);
opacity: 1
}
99% {
bottom: 500px;
-o-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-o-transform: scale(1);
opacity: 0
}
}
#keyframes bubbleUp4 {
0% {
bottom: 110px;
transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
transform: scale(.9);
opacity: 1
}
95% {
bottom: 595px;
transform: scale(.3);
opacity: 1
}
99% {
bottom: 600px;
transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
transform: scale(1);
opacity: 0
}
}
#-webkit-keyframes bubbleUp4 {
0% {
bottom: 110px;
-webkit-transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
-webkit-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-webkit-transform: scale(.9);
opacity: 1
}
95% {
bottom: 595px;
-webkit-transform: scale(.3);
opacity: 1
}
99% {
bottom: 600px;
-webkit-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-webkit-transform: scale(1);
opacity: 0
}
}
#-moz-keyframes bubbleUp4 {
0% {
bottom: 110px;
-moz-transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
-moz-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-moz-transform: scale(.9);
opacity: 1
}
95% {
bottom: 595px;
-moz-transform: scale(.3);
opacity: 1
}
99% {
bottom: 600px;
-moz-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-moz-transform: scale(1);
opacity: 0
}
}
#-o-keyframes bubbleUp4 {
0% {
bottom: 110px;
-o-transform: scale(1);
opacity: 0
}
1% {
bottom: 110px;
-o-transform: scale(.3);
opacity: 0
}
30% {
bottom: 110px;
-o-transform: scale(.9);
opacity: 1
}
95% {
bottom: 595px;
-o-transform: scale(.3);
opacity: 1
}
99% {
bottom: 600px;
-o-transform: scale(3);
opacity: 0
}
100% {
bottom: 110px;
-o-transform: scale(1);
opacity: 0
}
}
div#beaker {
width: 300px;
height: 700px;
margin: 0 auto;
position: relative
}
div#beaker span.glow {
width: 100%;
height: 100%;
background: ##222;
position: relative;
display: block;
border-radius: 200px;
animation: greenPulse 2s infinite;
-webkit-animation: greenPulse 2s infinite;
-moz-animation: greenPulse 2s infinite;
-o-animation: greenPulse 2s infinite;
}
div#beaker span.bubble {
background: #fff;
width: 80px;
height: 80px;
position: absolute;
display: block;
left: 110px;
bottom: 110px;
border-radius: 100px;
background: -moz-radial-gradient(center 45deg, circle closest-corner, rgba(75, 190, 200, 0), rgba(75, 190, 200, .1), rgba(75, 190, 200, .3), rgba(255, 255, 255, .7));
background: -webkit-gradient(radial, center center, 0, center center, 100, from(rgba(75, 190, 200, .2)), to(rgba(255, 255, 255, .7)));
background: gradient(center 45deg, circle closest-corner, rgba(75, 190, 200, 0), rgba(75, 190, 200, .1), rgba(75, 190, 200, .3), rgba(255, 255, 255, .7));
background: -ms-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgba(9, 133, 167, 0.1) 51%, rgba(9, 133, 167, 0.3) 71%, rgba(9, 133, 167, .7) 100%);
animation: bubbleUp 4s infinite ease-in-out;
-webkit-animation: bubbleUp 4s infinite ease-in-out;
-o-animation: bubbleUp 4s infinite ease-in-out;
-moz-animation: bubbleUp 4s infinite ease-in-out;
}
div#beaker span.bubble1 {
background: #fff;
width: 70px;
height: 70px;
position: absolute;
display: block;
left: 115px;
bottom: 110px;
border-radius: 80px;
background: -moz-radial-gradient(center 45deg, circle closest-corner, rgba(75, 190, 200, 0), rgba(75, 190, 200, .1), rgba(75, 190, 200, .3), rgba(255, 255, 255, .7));
background: -webkit-gradient(radial, center center, 0, center center, 100, from(rgba(75, 190, 200, .2)), to(rgba(255, 255, 255, .7)));
background: -ms-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgba(9, 133, 167, 0.1) 51%, rgba(9, 133, 167, 0.3) 71%, rgba(9, 133, 167, .7) 100%);
animation: bubbleUp 5s infinite;
-webkit-animation: bubbleUp1 5s infinite;
-o-animation: bubbleUp1 5s infinite;
-moz-animation: bubbleUp1 5s infinite;
}
div#beaker span.bubble2 {
background: #fff;
width: 30px;
height: 30px;
position: absolute;
display: block;
left: 110px;
bottom: 110px;
border-radius: 60px;
background: -moz-radial-gradient(center 45deg, circle closest-corner, rgba(75, 190, 200, 0), rgba(75, 190, 200, .1), rgba(75, 190, 200, .3), rgba(255, 255, 255, .7));
background: -webkit-gradient(radial, center center, 0, center center, 100, from(rgba(75, 190, 200, .2)), to(rgba(255, 255, 255, .7)));
background: -ms-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgba(9, 133, 167, 0.1) 51%, rgba(9, 133, 167, 0.3) 71%, rgba(9, 133, 167, .7) 100%);
animation: bubbleUp 7s infinite;
-webkit-animation: bubbleUp2 7s infinite;
-o-animation: bubbleUp2 7s infinite;
-moz-animation: bubbleUp2 7s infinite;
}
div#beaker span.bubble3 {
background: #fff;
width: 50px;
height: 50px;
position: absolute;
display: block;
left: 140px;
bottom: 95px;
border-radius: 100px;
background: -moz-radial-gradient(center 45deg, circle closest-corner, rgba(75, 190, 200, 0), rgba(75, 190, 200, .1), rgba(75, 190, 200, .3), rgba(255, 255, 255, .7));
background: -webkit-gradient(radial, center center, 0, center center, 100, from(rgba(75, 190, 200, .2)), to(rgba(255, 255, 255, .7)));
background: -ms-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgba(9, 133, 167, 0.1) 51%, rgba(9, 133, 167, 0.3) 71%, rgba(9, 133, 167, .7) 100%);
animation: bubbleUp 10s infinite;
-webkit-animation: bubbleUp3 10s infinite;
-o-animation: bubbleUp3 10s infinite;
-moz-animation: bubbleUp3 10s infinite;
}
div#beaker span.bubble4 {
background: #fff;
width: 40px;
height: 40px;
position: absolute;
display: block;
left: 155px;
bottom: 110px;
border-radius: 100px;
background: -moz-radial-gradient(center 45deg, circle closest-corner, rgba(75, 190, 200, 0), rgba(75, 190, 200, .1), rgba(75, 190, 200, .3), rgba(255, 255, 255, .7));
background: -webkit-gradient(radial, center center, 0, center center, 100, from(rgba(75, 190, 200, .2)), to(rgba(255, 255, 255, .7)));
background: -ms-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgba(9, 133, 167, 0.1) 51%, rgba(9, 133, 167, 0.3) 71%, rgba(9, 133, 167, .7) 100%);
animation: bubbleUp4 12s infinite;
-webkit-animation: bubbleUp4 12s infinite;
-o-animation: bubbleUp4 12s infinite;
-moz-animation: bubbleUp4 12s infinite;
}
<div id="lab">
<div id="beaker">
<span class="bubble"><span class="glow"></span></span>
<span class="bubble1"><span class="glow"></span></span>
<span class="bubble2"><span class="glow"></span></span>
<span class="bubble3"><span class="glow"></span></span>
<span class="bubble4"><span class="glow"></span></span>
</div>
</div>
My jsfiddle https://jsfiddle.net/pbged09z/
I have a html program with a css and js file, and i have a continuously looping spin animation on one of my elements, when i hover over it it changes its animation to a different animation, but when i hover it, it instantly moves back to 0deg causing a uncomfortable jump, is there a way for the animation to know where it is currently to start at that position?
here's my code, its all of it so its a bit long
body{
background: #808080;
}
.Glow{
transform: rotate(90deg);
background:blue;
position: absolute;
border-radius: 50%;
overflow: hidden;
}
.Glow:nth-child(1){
width: 300px;
height: 300px;
background: #ffffff;
-webkit-clip-path: polygon(00% 100%, 50% 50%, 100% 100%);
}
.Glow:nth-child(2){
width: 300px;
height: 300px;
background: #ffffff;
-webkit-clip-path: polygon(0% 0%, 50% 50%, 100% 0%);
}
.Glow:nth-child(3){
width: 270px;
height: 270px;
margin: 15px;
background: #808080;
}
.Glow:nth-child(4){
width: 300px;
height: 300px;
-webkit-clip-path: polygon(30% 100%, 45% 85%, 50% 50%, 55% 85%, 70% 100%);
background: #ffffff;
}
.Glow:nth-child(5){
width: 300px;
height: 300px;
-webkit-clip-path: polygon(30% 0%, 45% 15%, 50% 50%, 55% 15%, 70% 0%);
background: #ffffff;
}
.Glow:nth-child(6){
left: 45%;
top: 19%;
border-radius: 0%;
width: 3px;
height: 100px;
background: linear-gradient(#808080, #cccccc);
animation: null;
transform: rotate(0deg);
}
.Glow:nth-child(7){
left: 46.6%;
top: 19%;
border-radius: 0%;
width: 3px;
height: 100px;
background: linear-gradient(#808080, #cccccc);
animation: null;
transform: rotate(0deg);
}
.Glow:nth-child(8){
width: 150px;
height: 150px;
margin: 75px;
-webkit-clip-path: polygon(0% 0%, 0% 30%, 8% 39%, 8% 61%, 0% 70%, 0% 100%, 100% 100%, 100% 70%, 92% 61%, 92% 39%, 100% 30%, 100% 0%);
background: #ffffff;
}
.Glow:nth-child(9){
width: 150px;
height: 150px;
margin: 75px;
-webkit-clip-path: polygon(6% 41%, 6% 60%, 0% 66%, 0% 34%);
background: #ffffff;
}
.Glow:nth-child(10){
width: 150px;
height: 150px;
margin: 75px;
-webkit-clip-path: polygon(94% 41%, 94% 60%, 100% 66%, 100% 34%);
background: #ffffff;
}
.Glower:hover{
left: 37%;
top: 20%;
animation: spin1 2s linear 0s infinite;
}
.Glower{
transform: rotate(0deg);
position: absolute;
left: 37%;
top: 20%;
width: 300px;
height: 300px;
animation: spin 4s linear 0s infinite forwards;
}
#-webkit-keyframes spin{
100%{
-webkit-transform: rotate(450deg);
}
}
#-webkit-keyframes spinside{
100%{
-webkit-transform: rotate(270deg);
}
}
#-webkit-keyframes openCircle1{
100%{
top: 40%;
}
}
#-webkit-keyframes openCircle2{
100%{
top: 10%;
}
}
#-webkit-keyframes spin1{
0%{
-webkit-transform: scale(1) rotate(0deg);
}
25%{
-webkit-transform: scale(.9) rotate(120deg);
}
75%{
-webkit-transform: scale(1.1) rotate(240deg);
}
100%{
-webkit-transform: scale(1) rotate(360deg);
}
}
Edit: i use the spin1 and the spin animation btw
Edit 2: here's the codepen upload https://codepen.io/Inertiality/pen/mEBkvN
Edit 3: am i able to use transitions? cause i dont see how those could work with the animations
I'm creating a CSS3 loading icon effect instead of using GIF. I have created the loading icon effect but I'm unable to make it circle. It is revolving in square instead of circle. Border-radius not working with border-image property ?
HTML
<div id="progress">
<span class="spinner-icon"></span>
</div>
CSS
#progress {
pointer-events: none;
}
#progress .spinner-icon {
width: 30px;
height: 30px;
display:block;
border: solid 2px transparent;
border-radius:50%;
-webkit-animation: progress-spinner 600ms linear infinite;
animation: progress-spinner 600ms linear infinite;
-moz-border-image: -moz-linear-gradient(top, #3acfd5 0%, #3a4ed5 100%);
-webkit-border-image: -webkit-linear-gradient(top, #3acfd5 0%, #3a4ed5 100%);
border-image: linear-gradient(to bottom, #3acfd5 0%, #3a4ed5 100%);
border-image-slice: 1;
}
#progress {
position: absolute;
}
#-webkit-keyframes progress-spinner {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
#keyframes progress-spinner {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
http://jsfiddle.net/44athund/3/
This won't work with border-image. The radius is being applied to the object however the border-image with a gradient will not be respected.
Based on what you what, I've created a fiddle here https://jsfiddle.net/a9dpg582/1/ I think this is what you're after.
#progress {
pointer-events: none;
position: relative;
}
#progress .spinner-icon::after {
content: '';
border-radius: 50%;
background-color: #FFF;
width: 26px;
height: 26px;
position: absolute;
left: 2px;
top: 2px;
}
#progress .spinner-icon {
width: 30px;
height: 30px;
display: block;
background-image: -webkit-linear-gradient(top, #3acfd5 0%, #3a4ed5 100%);
border-radius: 50%;
-webkit-animation: progress-spinner 600ms linear infinite;
animation: progress-spinner 600ms linear infinite;
}
#progress {
position: absolute;
border-radius: 50%;
}
#-webkit-keyframes progress-spinner {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
#keyframes progress-spinner {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}