コーディングテクニックの実装内容
画像の上で単色の要素を縦方向にスライドさせるカーテンアニメーションを紹介します。今回は縦方向に動くものをご紹介します。
実装所要時間:10分程度
CSS,JavaScriptの記述内容
.block {
position: relative;
display: block;
width: 768px;
margin: 50px auto 0;
}
.block img {
width: 100%;
}
.block:after {
content: "";
position: absolute;
right: 0;
bottom: 0;
z-index: 1;
display: block;
width: 100%;
height: 100%;
background: #55310e;
transition: height 1.0s cubic-bezier(1, 0, 0, 1);
}
.active.block:after {
height: 0;
}
@media screen and (max-width:640px){
.block {
width: 100%;
}
}
実装のポイント
現在制作中
おすすめ記事
- 【CSS】画像の上で光沢のある演出を交えて単色の要素がスライドするカーテンアニメーションの実装方法/Curtain animation in which a glossy single color element slides on the image
- 【CSS】カーテンが開くように背景色を左右にスライドさせて画像を表示するアニメーションの実装方法/ Animation to display images by sliding the background color left and right
- 【CSS】画像の上で台形の単色要素を移動させるカーテンアニメーション/CSS Curtain Sliding Background Color(Trapezoid)
- 【CSS】画像の上を2分割して単色の背景が相互に移動するカーテンアニメーション/CSS Curtain Sliding Background Color(2 split)
- 【CSS】画像の上で複数の単色要素をスライドさせるカーテンアニメーション/CSS Curtain Sliding Background Color(multiple)
- 【CSS】画像の上で背景色を斜めにスライドさせるカーテンアニメーション/CSS Curtain Sliding Background Color(skew)
- 【CSS】画像の上で単色の要素をスライドさせるカーテンアニメーション(横方向)/CSS Curtain Sliding Background Color(side)
スポンサーリンク