【CSS】脱jQueryで画像の上にカラーが重なった状態で、上方向に動くラインと下方向に動くラインがアニメーションした後にカラーをフェードアウトしてから画像を表示させる方法のデモページ

※デベロッパーツール等でソースコードをご確認ください(Please check using Developer tools)

このページの内容が難しいと感じた方はこちら

スポンサーリンク

Web制作会社LIGが運営するWebデザインスクール

CSS

.block {
  position: relative;
  width: 768px;
  line-height: 0;
  margin: 70px auto 0;
}

.list {
  display: flex;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-right: -50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #55310e;
  opacity: 1;
}

.list li {
  position: relative;
  width: 20%;
  height: 0;
  overflow: hidden;
  border-right: 1px solid #fff;
  transition: all 0.7s ease-out 1s;
}
.list li:nth-child(2n) {
  height: 100%;
  transform: translateY(100%);
}
.list li:last-child {
  border-right:none;
}

.list.active {
  opacity: 0;
  transition: all 0.7s ease-out 2.0s;
}

.list.active li {
  height: 100%;
}
.list.active li:nth-child(2n) {
  transform: translateY(0);
}

@media screen and (max-width:640px){
  .block {
    width: 100%;
  }
}
  

JavaScript

window.onload = function() {
  document.getElementById("list").classList.add("active")
};