css3动画/animation/简单的闪烁效果/烟花效果

css3动画/animation/简单的闪烁效果/烟花效果_第1张图片

HTML代码

<template>
  <div>
        <div id="deviceready" class="blink">
            <p class="event received">Life Needs A Little Sunshinep>
        div>
        <div class="radius">
            <span class="animate-radius">span>
        div>
        <div class="firework size05 pos1 ">
          <div class="drops-grp">
              <span class="drop drop-1">span>
              <span class="drop drop-2">span>
              <span class="drop drop-3">span>
              <span class="drop drop-4">span>
          div>
          <div class="drops-grp drops-grp2">
              <span class="drop drop-1">span>
              <span class="drop drop-2">span>
              <span class="drop drop-3">span>
              <span class="drop drop-4">span>
          div>
          <div class="firework size05 pos1 ">
            <div class="drops-grp">
                <span class="drop drop-1">span>
                <span class="drop drop-2">span>
                <span class="drop drop-3">span>
                <span class="drop drop-4">span>
            div>
            <div class="drops-grp drops-grp2">
                <span class="drop drop-1">span>
                <span class="drop drop-2">span>
                <span class="drop drop-3">span>
                <span class="drop drop-4">span>
            div>	
          div>
        div>
    div>
template> 
// 烟花
.firework-grp {
     
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    color: white;
    color: #535396;
}
.firework-grp2{
     
    transform: rotate(180deg);
    color: #2C1C44;
    z-index: 6;
}
.firework {
     
    font-size: 10px;
    display: block;
    width: 8.5em;
    height: 8.5em;
    position: absolute;
}
.size05 {
     
    transform: scale(0.8);
}
.pos1 {
     
    left: 50%;
    top: 54%;
}
.drop {
     
    display: block;
    width: 1em;
    height: 2em;
    overflow: hidden;
    position: absolute;
    opacity: 0;
}
.drop:before {
     
    content: "";
    display: block;
    width: 1em;
    height: 1em;
    background: currentColor;
    border-radius: 50%;
}
.drop:after {
     
    content: "";
    display: block;
    position: relative;
    top: -0.4em;
    width: 0;
    height: 0;
    border-top: 1.4em solid currentColor;
    border-left: 0.5em solid transparent;
    border-right: 0.5em solid transparent;
}.drop:before {
     
    content: "";
    display: block;
    width: 1em;
    height: 1em;
    background: currentColor;
    border-radius: 50%;
}
.drop:before {
     
    content: "";
    display: block;
    width: 1em;
    height: 1em;
    background: #00a679;
    border-radius: 50%;
}
.drop:after {
     
    content: "";
    display: block;
    position: relative;
    top: -0.4em;
    width: 0;
    height: 0;
    border-top: 1.4em solid #00a679;
    border-left: 0.5em solid transparent;
    border-right: 0.5em solid transparent;
}
.drop-1 {
     
    left:3.75em;
    top: 0;
    animation: drop1anim 1s ease-in-out infinite;
}
.drop-2 {
     
    top: 3.25em;
    right: 0;
    animation: drop2anim 1s ease-in-out infinite;
}
.drop-3 {
     
    left:3.75em;
    bottom: 0;
    animation: drop3anim 1s ease-in-out infinite;
}
.drop-4 {
     
    top: 3.25em;
    left: 0;
    animation: drop4anim 1s ease-in-out infinite;
}
.drops-grp {
     
    display: block;
    width: 8.5em;
    height: 8.5em;
    position: absolute;
}
.drops-grp2 {
     
    display: block;
    width: 8.5em;
    height: 8.5em;
    position: absolute;
    transform: rotate(45deg);
}
@keyframes drop1anim {
     
    0% {
     
        top:3.25em;
        opacity: 0;
        transform: scale(0.3);
    }
    25% {
     
        opacity: 0;
    }
    50% {
     
        opacity: 1;
        transform: scale(1);
    }
    100% {
     
        top: -0.75em;
        opacity: 0;
        transform: scale(0.3);
    }
}
@keyframes drop2anim {
     
    0% {
     
        right:3.75em;
        opacity: 0;
        transform: scale(0.3) rotate(90deg);
    }
    25% {
     
        opacity: 0;
    }
    50% {
     
        opacity: 1;
        transform: scale(1) rotate(90deg);
    }
    100% {
     
        right: -0.25em;
        opacity: 0;
        transform: scale(0.3) rotate(90deg);
    }
}
@keyframes drop3anim {
     
    0% {
     
        bottom:3.25em;
        opacity: 0;
        transform: scale(0.3) rotate(180deg);
    }
    25% {
     
        opacity: 0;
    }
    50% {
     
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
    100% {
     
        bottom: -0.75em;
        opacity: 0;
        transform: scale(0.3) rotate(180deg);
    }
}
@keyframes drop4anim {
     
    0% {
     
        left:3.75em;
        opacity: 0;
        transform: scale(0.3) rotate(-90deg);
    }
    25% {
     
        opacity: 0;
    }
    50% {
     
        opacity: 1;
        transform: scale(1) rotate(-90deg);
		}
		100% {
     
        left: -0.25em;
        opacity: 0;
        transform: scale(0.3) rotate(-90deg);
    }
}
// 太阳
.radius{
     
    width: 60px;
    height: 60px;
    margin: 25px auto;
    border-radius: 50%;
    text-align: center;
    color: #fff;
    background-color: #fccc86;
    position: relative;
}
.animate-radius{
     
    width: 60px;
    height: 60px;
    position: absolute;
    left: 0;
    border-radius: 50%;
    background-color: #ffc672;
    animation:radius 1.5s ease-out infinite forwards;
    -webkit-animation: radius 1.5s ease-out infinite forwards;
    -moz-animation:radius 1.5s ease-out infinite forwards;
    -ms-animation:radius 1.5s ease-out infinite forwards;
}
@keyframes radius {
     
    0%{
       transform: scale(1,1);
        -webkit-transform:scale(1,1) ;
        -moz-transform:scale(1,1) ;
        -ms-transform:scale(1,1) ;
        opacity: 0.6;
        }
    50%{
     
        transform: scale(1.4,1.4);
        -webkit-transform:scale(1.4,1.4) ;
        -moz-transform:scale(1.4,1.4) ;
        -ms-transform:scale(1.4,1.4) ;
        opacity: 0;
    }
}
 // 标题闪烁
.event {
     
    border-radius:4px;
    -webkit-border-radius:4px;
    color:#FFFFFF;
    font-size:12px;
    margin:0px 30px;
    padding:2px 0px;
}
.event.received {
     
  background-color:#cca4e3;
}
 
@keyframes fade {
     
    from {
      opacity: 1.0; }
    50% {
      opacity: 0.4; }
    to {
      opacity: 1.0; }
}
 
@-webkit-keyframes fade {
     
    from {
      opacity: 1.0; }
    50% {
      opacity: 0.4; }
    to {
      opacity: 1.0; }
}
 
.blink {
     
    animation:fade 3000ms infinite;
    -webkit-animation:fade 3000ms infinite;
    padding: 10px;
    height: 100px;
    text-align: center;

}

你可能感兴趣的:(css3,css3,动画,animation,烟花)