【CSS】transformを使用してテキストの各文字を同時に右からスライドインさせるアニメーションの実装方法のデモページ

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

マイナビAGENT

Dummytext01

スポンサーリンク

マイナビAGENT

HTML

<div class="wrap">
  <p class="text">Dummytext01</p>
</div>

JavaScript

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

CSS

.wrap {
  width: 768px;
  margin: 0 auto;
}
.text {
  opacity: 0;
  margin: 200px 0 0;
  text-align: center;
  font-size: 50px;
}

.text-move {
  display: inline-block;
  overflow: hidden;
}

.text-move span {
  display: inline-block;
  transition: all 0.5s 0.1s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  transform: translateX(100%);
  font-size: 50px;
}

.text.active {
  opacity: 1;
}

.text.active .text-move span {
  transform: translateX(0);
}

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