<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/textillate/0.4.0/jquery.textillate.min.js">
</script>
<script src="http://localhost:10072/wp-content/uploads/demos/_assets/jquery.lettering.js">
</script>
<style>@charset "utf-8";

/*========= スクロールダウンのためのCSS ===============*/

/*スクロールダウン全体の場所*/
.scrolldown {
  /*描画位置※位置は適宜調整してください*/
  position: absolute;
  bottom: 10px;
  right: 50%;
  /*マウスの動き1.6秒かけて動く永遠にループ*/
  animation: mousemove 1.6s ease-in-out infinite;
}

/*下からの距離が変化して上から下に動く*/
@keyframes mousemove {
  0% {
    bottom: 10px;
  }
  50% {
    bottom: 5px;
  }
  100% {
    bottom: 10px;
  }
}

/*Scrollテキストの描写*/
.scrolldown span {
  z-index: 10;
  /*描画位置*/
  position: absolute;
  left: -15px;
  bottom: 45px;
  /*テキストの形状*/
  color: #000;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/*マウスの中の線描写 */
.scrolldown span::after {
  z-index: 10;
  content: "";
  /*描画位置*/
  position: absolute;
  top: 10px;
  left: 17px;
  /*線の形状*/
  width: 1px;
  height: 15px;
  background: #000;
  /*線の動き1.4秒かけて動く。永遠にループ*/
  animation: mousepathmove 1.4s linear infinite;
  opacity: 0;
}

/*上からの距離・不透明度・高さが変化して上から下に流れる*/
@keyframes mousepathmove {
  0% {
    height: 0;
    top: 10px;
    opacity: 0;
  }
  50% {
    height: 15px;
    opacity: 1;
  }
  100% {
    height: 0;
    top: 30px;
    opacity: 0;
  }
}

/*マウスの描写 */
.scrolldown:before {
  z-index: 10;
  content: "";
  /*描画位置*/
  position: absolute;
  bottom: 0;
  left: -10px;
  /*マウスの形状*/
  width: 25px;
  height: 37px;
  border-radius: 10px;
  border: 1px solid #000;
}

/*マウスの中の丸の描写*/
.scrolldown:after {
  z-index: 10;
  content: "";
  /*描画位置*/
  position: absolute;
  bottom: 26px;
  left: 0;
  /*丸の形状*/
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid #000;
}

/*========= スクロールのためのCSS ===============*/
.space {
  padding: 100vh 0;
}

/*========= レイアウトのためのCSS ===============*/
body {
  background-image: linear-gradient(
    68.4deg,
    rgba(248, 182, 204, 1) 0.5%,
    rgba(192, 198, 230, 1) 60%,
    rgba(225, 246, 240, 1) 89.8%
  );
}

p {
  text-align: center;
  padding: 20px 0;
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  overflow: hidden; /*左右アニメーションで画面からはみ出る際に出る横スクロールバーを隠す*/
}

/*========= ランダムに出現するテキスト ===============*/

.randomAnime {
  visibility: hidden;
}</style>
</head>
<body>
<body>
<div class="scrolldown">
<span>Scroll</span>
</div>
<p class="randomAnime">ランダムに出現する</p>
<div class="space">
</div>
<p class="randomAnime">ランダムに出現する</p>
<script>var Obj = {
  loop: false,
  minDisplayTime: 2000, // アニメーションの間隔時間
  initialDelay: 500, // アニメーション開始までの遅延時間
  autoStart: true,
  in: {
    effect: "fadeInUp", //animate.css の中にある採用したい動きのクラス名
    delayScale: 1, // 遅延時間の指数
    delay: 100, // 文字ごとの遅延時間
    sync: false, // アニメーションをすべての文字に同時適用するかどうか
    shuffle: true // 文字表示がランダムな順に表示されるかどうか
  },
  out: {
    // 終了時のアニメーション設定をしたい場合はここに追記
  } };

var element;
//初期設定
function RandomInit() {
  element = $(".randomAnime");
  $(element[0]).textillate(Obj);
}

function RandomAnimeControl() {
  var elemPos = $(element[1]).offset().top - 50;
  var scroll = $(window).scrollTop();
  var windowHeight = $(window).height();

  if (scroll >= elemPos - windowHeight) {
    $(element[1]).textillate(Obj);
  }
}

// 画面をスクロールをしたら動かしたい場合の記述
$(window).scroll(function () {
  RandomAnimeControl(); /*アニメーション用の関数を呼ぶ*/
}); //ここまで画面をスクロールをしたら動かしたい場合の記述

// 画面が読み込まれたらすぐに動かしたい場合の記述
$(window).on("load", function () {
  RandomInit(); /*初期設定を読み込み*/
  RandomAnimeControl(); /*アニメーション用の関数を呼ぶ*/
}); //ここまで画面が読み込まれたらすぐに動かしたい場合の記述
//# sourceURL=pen.js</script>
</body>
</html>
/* 
   外部依存 CSS:
     - https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css
   外部依存 JS (このデモは下記の JS にも依存します):
     - https://code.jquery.com/jquery-3.4.1.min.js
     - https://cdnjs.cloudflare.com/jquery.textillate.min.js
     - http://localhost:10072/wp-content/uploads/demos/_assets/jquery.lettering.js
 */

@charset "utf-8";

/*========= スクロールダウンのためのCSS ===============*/

/*スクロールダウン全体の場所*/
.scrolldown {
  /*描画位置※位置は適宜調整してください*/
  position: absolute;
  bottom: 10px;
  right: 50%;
  /*マウスの動き1.6秒かけて動く永遠にループ*/
  animation: mousemove 1.6s ease-in-out infinite;
}

/*下からの距離が変化して上から下に動く*/
@keyframes mousemove {
  0% {
    bottom: 10px;
  }
  50% {
    bottom: 5px;
  }
  100% {
    bottom: 10px;
  }
}

/*Scrollテキストの描写*/
.scrolldown span {
  z-index: 10;
  /*描画位置*/
  position: absolute;
  left: -15px;
  bottom: 45px;
  /*テキストの形状*/
  color: #000;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/*マウスの中の線描写 */
.scrolldown span::after {
  z-index: 10;
  content: "";
  /*描画位置*/
  position: absolute;
  top: 10px;
  left: 17px;
  /*線の形状*/
  width: 1px;
  height: 15px;
  background: #000;
  /*線の動き1.4秒かけて動く。永遠にループ*/
  animation: mousepathmove 1.4s linear infinite;
  opacity: 0;
}

/*上からの距離・不透明度・高さが変化して上から下に流れる*/
@keyframes mousepathmove {
  0% {
    height: 0;
    top: 10px;
    opacity: 0;
  }
  50% {
    height: 15px;
    opacity: 1;
  }
  100% {
    height: 0;
    top: 30px;
    opacity: 0;
  }
}

/*マウスの描写 */
.scrolldown:before {
  z-index: 10;
  content: "";
  /*描画位置*/
  position: absolute;
  bottom: 0;
  left: -10px;
  /*マウスの形状*/
  width: 25px;
  height: 37px;
  border-radius: 10px;
  border: 1px solid #000;
}

/*マウスの中の丸の描写*/
.scrolldown:after {
  z-index: 10;
  content: "";
  /*描画位置*/
  position: absolute;
  bottom: 26px;
  left: 0;
  /*丸の形状*/
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid #000;
}

/*========= スクロールのためのCSS ===============*/
.space {
  padding: 100vh 0;
}

/*========= レイアウトのためのCSS ===============*/
body {
  background-image: linear-gradient(
    68.4deg,
    rgba(248, 182, 204, 1) 0.5%,
    rgba(192, 198, 230, 1) 60%,
    rgba(225, 246, 240, 1) 89.8%
  );
}

p {
  text-align: center;
  padding: 20px 0;
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  overflow: hidden; /*左右アニメーションで画面からはみ出る際に出る横スクロールバーを隠す*/
}

/*========= ランダムに出現するテキスト ===============*/

.randomAnime {
  visibility: hidden;
}
/* 
   外部依存 JS:
     - https://code.jquery.com/jquery-3.4.1.min.js
     - https://cdnjs.cloudflare.com/jquery.textillate.min.js
     - http://localhost:10072/wp-content/uploads/demos/_assets/jquery.lettering.js
   外部依存 CSS (このデモは下記の CSS にも依存します):
     - https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css
 */

var Obj = {
  loop: false,
  minDisplayTime: 2000, // アニメーションの間隔時間
  initialDelay: 500, // アニメーション開始までの遅延時間
  autoStart: true,
  in: {
    effect: "fadeInUp", //animate.css の中にある採用したい動きのクラス名
    delayScale: 1, // 遅延時間の指数
    delay: 100, // 文字ごとの遅延時間
    sync: false, // アニメーションをすべての文字に同時適用するかどうか
    shuffle: true // 文字表示がランダムな順に表示されるかどうか
  },
  out: {
    // 終了時のアニメーション設定をしたい場合はここに追記
  } };

var element;
//初期設定
function RandomInit() {
  element = $(".randomAnime");
  $(element[0]).textillate(Obj);
}

function RandomAnimeControl() {
  var elemPos = $(element[1]).offset().top - 50;
  var scroll = $(window).scrollTop();
  var windowHeight = $(window).height();

  if (scroll >= elemPos - windowHeight) {
    $(element[1]).textillate(Obj);
  }
}

// 画面をスクロールをしたら動かしたい場合の記述
$(window).scroll(function () {
  RandomAnimeControl(); /*アニメーション用の関数を呼ぶ*/
}); //ここまで画面をスクロールをしたら動かしたい場合の記述

// 画面が読み込まれたらすぐに動かしたい場合の記述
$(window).on("load", function () {
  RandomInit(); /*初期設定を読み込み*/
  RandomAnimeControl(); /*アニメーション用の関数を呼ぶ*/
}); //ここまで画面が読み込まれたらすぐに動かしたい場合の記述
//# sourceURL=pen.js