Warning: Undefined array key 0 in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 406

Warning: Attempt to read property "parent" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 407

Warning: Attempt to read property "term_id" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 413

Warning: Attempt to read property "cat_name" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 413

CSSでアニメーションを設定する


Warning: Undefined variable $pre in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 517

Warning: Undefined variable $pre in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 517
CSS

transitionsとanimations

CSSでのアニメーションにはTransitonsとAnimationsの2つのプロパティが用意されています。
transisionsは始点と終点を指定して単純なアニメーションを、animationsはキーフレームで経過を指定し、より細かいアニメーションを設定することができます。

transitionsによる変化

ボックスにマウスを乗せたときに色を変化させる処理をtransitionsで実現します。 最初は赤いボックスが、マウスオーバーさせると5秒かけて青に変化します。

transition{
  background-color:red;
  transition:background-color 5s linear;
}
.transition:hover{
  background-color:blue;
}
.sample01{ background-color:red; color:white; border:solid 1px #000; transition:background-color 3s linear; margin:12px 0; padding:4px 10px; } .sample01:hover{ background-color:blue; }

↓マウスを乗せてみてください

transition

animationsによる変化

ボックスにマウスを乗せたときに色を変化させる処理をanimationsで実現します。 最初は赤いボックスが、マウスオーバーさせると5秒かけて緑→橙→青と変化します。

keyframes ani{
  0%{}
  33%{background-color:green;}
  66%{background-color:orange;}
  100%{background-color:blue;}
}
.animation{
  color:white;
  background-color:red;
  border:solid 1px #000;
  margin-left:10px;
  padding:4px 10px;
}
.animation:hover{
  background-color:blue;
  animation-name:ani;
  animation-duration:5s;
  animation-timing-function:linear;
}
@keyframes ani{ 0%{} 33%{background-color:green;} 66%{background-color:orange;} 100%{background-color:blue;} } .sample02{ color:white; background-color:red; border:solid 1px #000; margin:12px 0; padding:4px 10px; } .sample02:hover{ background-color:blue; animation-name:ani; animation-duration:5s; animation-timing-function:linear; }

↓マウスを乗せてみてください

animations

Warning: Undefined variable $category in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/content.php on line 79

Warning: Attempt to read property "name" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/content.php on line 79

の記事

eyecatch

コンテンツモデルとコンテキスト

eyecatch

HTML文書の記述ルールと作法

eyecatch

WordPressのショートコードを使って投稿内でPHP処理を行う

eyecatch

リダイレクト-URLを変更したらリダイレクトで転送しよう

eyecatch

ファイルの作成方法

eyecatch

ウェブサイトの長さの単位一覧


Warning: Undefined variable $category in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/content.php on line 84

Warning: Attempt to read property "count" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/content.php on line 84
HOME