Css-animation-flip-out-x

提供:Dev Guides
移動先:案内検索

CSS-X軸効果の反転

説明

エレメントは、突然の素早い動きで裏返したり、裏返しになったりすることがあります。

構文

@keyframes flipOutX {
   0% {
      transform: perspective(400px) rotateX(0deg);
      opacity: 1;
   }
   100% {
      transform: perspective(400px) rotateX(90deg);
      opacity: 0;
   }
}

パラメーター

  • 変換-変換は、要素への2Dおよび3D変換に適用されます。
  • Opacity -不透明度は要素に適用され、半透明になります。

<html>
   <head>
      <style>
         .animated {
            background-image: url(/css/images/logo.png);
            background-repeat: no-repeat;
            background-position: left top;
            padding-top:95px;
            margin-bottom:60px;
            -webkit-animation-duration: 1s;
            animation-duration: 1s;
            -webkit-animation-fill-mode: both;
            animation-fill-mode: both;
         }

         @-webkit-keyframes flipOutX {
            0% {
               -webkit-transform: perspective(400px) rotateX(0deg);
               opacity: 1;
            }
            100% {
               -webkit-transform: perspective(400px) rotateX(90deg);
               opacity: 0;
            }
         }

         @keyframes flipOutX {
            0% {
               transform: perspective(400px) rotateX(0deg);
               opacity: 1;
            }
            100% {
               transform: perspective(400px) rotateX(90deg);
               opacity: 0;
            }
         }

         .flipOutX {
            -webkit-animation-name: flipOutX;
            -webkit-backface-visibility: visible !important;
            animation-name: flipOutX;
            backface-visibility: visible !important;
         }
      </style>
   </head>

   <body>

      <div id = "animated-example" class = "animated flipOutX"></div>
      <button onclick = "myFunction()">Reload page</button>

      <script>
         function myFunction() {
            location.reload();
         }
      </script>

   </body>
</html>

それは次の結果を生成します-