ホームページ  >  記事  >  ウェブフロントエンド  >  css3アニメーションにはどのような性質があるのでしょうか?

css3アニメーションにはどのような性質があるのでしょうか?

青灯夜游
青灯夜游オリジナル
2021-04-08 18:11:583085ブラウズ

css3 アニメーション属性には、「@keyframes」、アニメーション、アニメーション名、アニメーション期間、アニメーション遅延、アニメーション方向などが含まれます。

css3アニメーションにはどのような性質があるのでしょうか?

このチュートリアルの動作環境: Windows 7 システム、CSS3&&HTML5 バージョン、Dell G3 コンピューター。

css3 アニメーション プロパティ:

  • @keyframes はアニメーションを指定します。

  • animation anime-play-state プロパティを除く、すべてのアニメーション プロパティの短縮形プロパティ。

  • animation-name は、@keyframes アニメーションの名前を指定します。

  • animation-duration は、アニメーションが 1 サイクルを完了するのにかかる秒数またはミリ秒数を指定します。デフォルトは 0 です。

  • animation-timing-function はアニメーションの速度曲線を指定します。デフォルトは「簡単」です。

  • animation-delay は、アニメーションの開始時期を指定します。デフォルトは 0 です。

  • animation-iteration-count は、アニメーションが再生される回数を指定します。デフォルトは 1 です。

  • animation-direction は、次のサイクルでアニメーションを逆再生するかどうかを指定します。デフォルトは「通常」です。

  • animation-play-state は、アニメーションが実行中か一時停止中かを指定します。デフォルトは「実行中」です。

  • animation-fill-mode は、アニメーション時間外のオブジェクトの状態を指定します。

#例: css3 アニメーション プロパティを使用して単純なアニメーションを作成する

body {
  background-color: #fff;
  color: #555;
  font-size: 1.1em;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.container {
  margin: 50px auto;
  min-width: 320px;
  max-width: 500px;
}

.element {
  margin: 0 auto;
  width: 100px;
  height: 100px;
  background-color: #0099cc;
  border-radius: 50%;
  position: relative;
  top: 0;
  -webkit-animation: bounce 2s infinite;
  animation: bounce 2s infinite;
}

@-webkit-keyframes bounce {
  from {
    top: 100px;
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }
  25% {
    top: 50px;
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }
  50% {
    top: 150px;
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }
  75% {
    top: 75px;
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }
  to {
    top: 100px;
  }
}

@keyframes bounce {
  from {
    top: 100px;
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }
  25% {
    top: 50px;
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }
  50% {
    top: 150px;
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }
  75% {
    top: 75px;
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }
  to {
    top: 100px;
  }
}

3. ランニング効果

css3アニメーションにはどのような性質があるのでしょうか?

(学習ビデオ共有:

css ビデオ チュートリアル)

以上がcss3アニメーションにはどのような性質があるのでしょうか?の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。