【CSS】transformを使用してリンクホバー時にカーテンアニメーションを実装する方法のデモページ

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

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

DUMMEY TEXT

スポンサーリンク

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

CSS

.wrap a {
  position: relative;
  display: block;
  margin: 80px 0 0;
  padding: 150px 0;
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  background: #ec2020;
}
.wrap a:before {
  position: absolute;
  top: 0;
  left: 0;
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  transform: translateZ(0) scaleX(0);
  transform-origin: right top;
  transition: 0.8s transform cubic-bezier(0.65, 0.05, 0.35, 1);
  background: #fd2020;;
}

.wrap a:hover:before {
  transform: translateZ(0) scaleX(1);
  transform-origin: left top;
}

.text {
  position: relative;
  z-index: 1;
}