【jQuery】テキストを一文字ずつ下から半回転して登場させる方法のデモページ

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

マイナビAGENT

DummyText

スポンサーリンク

マイナビAGENT

JavaScript

$(function(){
  $('.text').children().addBack().contents().each(function() {
      $(this).replaceWith($(this).text().replace(/(\S)/g, '<span class="text-move">$&</span>'));
  });
   setTimeout(function(){
      $(".text").addClass("active");
  },100);
});

CSS

.wrap {
  width: 768px;
  margin: 0 auto;
}

.text {
  overflow: hidden;
  margin: 50px 0 0;
  text-align: center;
  font-size: 80px;
}

.text-move {
  display: inline-block;
  opacity: 0;
  transform: translateY(1.1em) translateX(0.55em) rotateZ(180deg);
  transition-property: all;
  transition-duration: 0.4s;
  transition-timing-function: ease;
  will-change: transform;
}

.text-move:nth-child(1) {
  transition-delay: 0s;
}
.text-move:nth-child(2) {
  transition-delay: 0.1s;
}
.text-move:nth-child(3) {
  transition-delay: 0.2s;
}
.text-move:nth-child(4) {
  transition-delay: 0.3s;
}
.text-move:nth-child(5) {
  transition-delay: 0.4s;
}
.text-move:nth-child(6) {
  transition-delay: 0.5s;
}
.text-move:nth-child(7) {
  transition-delay: 0.6s;
}
.text-move:nth-child(8) {
  transition-delay: 0.7s;
}
.text-move:nth-child(9) {
  transition-delay: 0.8s;
}
.text-move:nth-child(10) {
  transition-delay: 0.9s;
}

.text.active .text-move {
  opacity: 1;
  transform: translateY(0em) translateX(0em) rotateZ(0deg);
}

@media screen and (max-width:640px){
  .wrap {
    width: 100%;
  }
  .text-move {
    font-size: 8vw;
  }
}