1、圈无线向外扩散,难点是要补充最里层的圈,让其透明度为0时回到最初位置,再显现出来,达到视觉上的无缝链接
@keyframes rotate1 {
0%{
transform: scale(1);
opacity: 1;
}
16.7%{
transform: scale(1.4);
opacity: 0.8;
}
33.3%{
transform: scale(1.8);
opacity: 0.6;
}
50%{
transform: scale(2.2);
opacity: 0.4;
}
66.7%{
transform: scale(2.6);
opacity: 0.2;
}
83.3%{
transform: scale(3.0);
opacity: 0;
}
99.9%{
transform: scale(1);
opacity: 0;
}
100%{
transform: scale(1);
opacity: 1;
}
}
@keyframes rotate2 {
// from {
// transform: scale(1);
// opacity: 1;
// }
// to {
// transform: scale(1.6);
// opacity: 0.8;
// }
0%{
transform: scale(1.4);
opacity: 0.8;
}
16.7%{
transform: scale(1.8);
opacity: 0.6;
}
33.3%{
transform: scale(2.2);
opacity: 0.4;
}
50%{
transform: scale(2.6);
opacity: 0.2;
}
66.7%{
transform: scale(3.0);
opacity: 0;
}
83.2%{
transform: scale(1);
opacity: 0;
}
83.3%{
transform: scale(1);
opacity: 1;
}
100%{
transform: scale(1.4);
opacity: 0.8;
}
}
@keyframes rotate3 {
0%{
transform: scale(1.8);
opacity: 0.6;
}
16.7%{
transform: scale(2.2);
opacity: 0.4;
}
33.3%{
transform: scale(2.6);
opacity: 0.2;
}
50%{
transform: scale(3.0);
opacity: 0;
}
66.6%{
transform: scale(1);
opacity: 0;
}
66.7%{
transform: scale(1);
opacity: 1;
}
83.3%{
transform: scale(1.4);
opacity: 0.8;
}
100%{
transform: scale(1.8);
opacity: 0.6;
}
}
@keyframes rotate4 {
// from {
// transform: scale(1);
// opacity: 1;
// }
// to {
// transform: scale(2.2);
// opacity: 0.4;
// }
0%{
transform: scale(2.2);
opacity: 0.4;
}
16.7%{
transform: scale(2.6);
opacity: 0.2;
}
33.3%{
transform: scale(3.0);
opacity: 0;
}
50%{
transform: scale(1);
opacity: 0;
}
50.1%{
transform: scale(1);
opacity: 1;
}
66.7%{
transform: scale(1.4);
opacity: 0.8;
}
83.3%{
transform: scale(1.8);
opacity: 0.6;
}
100%{
transform: scale(2.2);
opacity: 0.4;
}
}
@keyframes rotate5 {
// from {
// transform: scale(1);
// opacity: 1;
// }
// to {
// transform: scale(2.5);
// opacity: 0.2;
// }
0%{
transform: scale(2.6);
opacity: 0.2;
}
16.7%{
transform: scale(3.0);
opacity: 0;
}
33.3%{
transform: scale(1);
opacity: 0;
}
33.4%{
transform: scale(1);
opacity: 1;
}
50%{
transform: scale(1.4);
opacity: 0.8;
}
66.7%{
transform: scale(1.8);
opacity: 0.6;
}
83.3%{
transform: scale(2.2);
opacity: 0.4;
}
100%{
transform: scale(2.6);
opacity: 0.2;
}
}
@keyframes rotate6 {
// from {
// transform: scale(1);
// opacity: 1;
// }
// to {
// transform: scale(2.8);
// opacity: 0;
// }
0%{
transform: scale(3.0);
opacity: 0;
}
16.6%{
transform: scale(1);
opacity: 0;
}
16.7%{
transform: scale(1);
opacity: 1;
}
33.3%{
transform: scale(1.4);
opacity: 0.8;
}
50%{
transform: scale(1.8);
opacity: 0.6;
}
66.7%{
transform: scale(2.2);
opacity: 0.4;
}
83.3%{
transform: scale(2.6);
opacity: 0.2;
}
100%{
transform: scale(3.0);
opacity: 0;
}
}
2、3D旋转效果,并隐藏其中一个值
matrix3d 主要用到的几个值代表:rotate、translate
其中转到前面时字体要提前变色,可以promise实现
timeout(time) {
let that = this;
return new Promise(function (resolve, reject) {
that.isYellow2 = false;
that.isYellow1 = true;
setTimeout(resolve, time);
})
},
that.timeout(500).then(function () {
that.timer = setInterval(()=>{
if (that.isYellow2 === true) {
that.isYellow1 = true;
that.isYellow2 = false;
} else if (that.isYellow1 === true) {
that.isYellow4 = true;
that.isYellow1 = false;
} else if (that.isYellow4 === true) {
that.isYellow3 = true;
that.isYellow4 = false;
} else {
that.isYellow2 = true;
that.isYellow3 = false;
}
},2000);
})
@keyframes rotate1 {
0% {
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 250, 70, 0, 1);
z-index: 99;
}
25% {
transform: matrix3d(1.4, 0, 0, 0, 0, 1.4, 0, 0, 0, 0, 1, 0, 100, 110, 0, 1);
z-index: 100;
}
50% {
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -50, 70, 0, 1);
z-index: 99;
opacity: 1;
}
75% {
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 30, 0, 1);
z-index: 100;
opacity: 0;
}
100%{
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 250, 70, 0, 1);
z-index: 99;
opacity: 1;
}
}
@keyframes rotate2 {
0% {
transform: matrix3d(1.4, 0, 0, 0, 0, 1.4, 0, 0, 0, 0, 1, 0, 100, 60, 0, 1);
z-index: 100;
}
25% {
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -50, 20, 0, 1);
z-index: 99;
opacity: 1;
}
50% {
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, -30, 0, 1);
z-index: 100;
opacity: 0;
}
75%{
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 250, 20, 0, 1);
z-index: 99;
opacity: 1;
}
100%{
transform: matrix3d(1.4, 0, 0, 0, 0, 1.4, 0, 0, 0, 0, 1, 0, 100, 60, 0, 1);
z-index: 100;
}
}
@keyframes rotate3 {
0% {
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -50, -40, 0, 1);
z-index: 99;
opacity: 1;
}
25% {
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, -80, 0, 1);
z-index: 100;
opacity: 0;
}
50%{
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 250, -40, 0, 1);
z-index: 99;
opacity: 1;
}
75% {
transform: matrix3d(1.4, 0, 0, 0, 0, 1.4, 0, 0, 0, 0, 1, 0, 100, 10, 0, 1);
z-index: 100;
}
100%{
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -50, -40, 0, 1);
z-index: 99;
}
}
@keyframes rotate4 {
0% {
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, -140, 0, 1);
z-index: 100;
opacity: 0;
}
25%{
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 250, -90, 0, 1);
z-index: 99;
opacity: 1;
}
50% {
transform: matrix3d(1.4, 0, 0, 0, 0, 1.4, 0, 0, 0, 0, 1, 0, 100, -50, 0, 1);
z-index: 100;
}
75%{
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -50, -90, 0, 1);
z-index: 99;
opacity: 1;
}
100% {
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, -140, 0, 1);
z-index: 100;
opacity: 0;
}
}
3、图片从底部开始加载,即效果图中的竖线,分次加载可以用settimeout实现
@keyframes scaleCol {
0% {
transform: scaleY(0);
transform-origin: 0 bottom;
}
100%{
transform: scaleY(1);
transform-origin: 0 bottom;
}
}