<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<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/jquery.inview/1.1.2/jquery.inview.min.js">
</script>
<style>@charset "utf-8";

/*========= レイアウトのためのCSS ===============*/

body {
  vertical-align: middle;
  text-align: center;
  z-index: 1;
  width: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-image: linear-gradient(
    76.5deg,
    rgba(129, 252, 255, 1) 0.4%,
    rgba(255, 175, 207, 1) 49.8%,
    rgba(255, 208, 153, 1) 98.6%
  );
  object-fit: cover;
}

h1,
h2 {
  text-align: center;
  text-transform: uppercase;
  font-size: 2rem;
  padding-top: 30px;
  color: #666;
}

.lead {
  padding: 20px;
  text-align: center;
}

a {
  color: #666;
  font-weight: bold;
}

.box {
  max-width: 500px;
  width: 100%;
  margin: 10vh auto;
  padding: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 10px 10px 5px -2px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 10px;
}

.box p,
p {
  color: #666;
  margin: 50px auto;
}

.count-size {
  font-size: 3rem;
  font-weight: bold;
  color: #ff7c00;
  background: -webkit-linear-gradient(
    top,
    #ffb76b 0%,
    #ffa73d 50%,
    #ff7c00 51%,
    #ff7f04 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}</style>
</head>
<body>
<body>
<h1>WEB先案内について</h1>
<p class="lead">使用したライブラリ:<br>・カウントアップダウン<br>
<a href="https://github.com/LadyBiosphere/animated-counter" target="_blank">https://github.com/LadyBiosphere/animated-counter</a>
<br>・画面に入ったらカウントアップ・ダウンをスタートするきっかけ<br>
<a href="https://github.com/protonet/jquery.inview" target="_blank">https://github.com/protonet/jquery.inview</a>
</p>
<div id="box1" class="box">
<h2>習慣</h2>
<p>妄想<br>
<span class="count-up count-size">9999</span>回</p>
<p>ジム<br>週<span class="count-up count-size">5</span>回</p>
<p>コーヒー<br>
<span class="count-up count-size">2</span>回/日</p>
<h2>実績</h2>
<p>WordPress修復実績<br>
<span class="count-up count-size">300</span>サイト</p>
<p>ココナラ実績<br>
<span class="count-up count-size">378</span>件</p>
<!--/box-->
</div>
<div id="box2" class="box">
<h2>ココナラ検索</h2>
<p>検索ワード『<a href="https://coconala.com/search?keyword=WordPress%E3%80%80%E4%B8%8D%E5%85%B7%E5%90%88" target="_blank" rel="noopener noreferrer">WordPress 不具合</a>』<br>〜おすすめ順〜<br>
<span class="count-down count-size">1</span>位<br>だったことがあります</p>
<!--/box-->
</div>
<div id="box3" class="box">
<h2>スキル</h2>
<p>1級電気施工管理技士<br>
<span class="count-up count-size">10</span>年</p>
<p>WordPress<br>
<span class="count-up count-size">4</span>年</p>
<p>WEBエンジニア<br>
<span class="count-up count-size">4</span>年</p>
<!--/box-->
</div>
<div id="box4" class="box">
<h2>触ったことがある<br>言語・フレームワーク</h2>
<p>HTML<br>
<span class="count-up count-size">15</span>年</p>
<p>CSS<br>
<span class="count-up count-size">15</span>年</p>
<p>Bootstrap<br>
<span class="count-up count-size">4</span>年</p>
<p>jQuery<br>
<span class="count-up count-size">4</span>年</p>
<p>PHP<br>
<span class="count-up count-size">4</span>年</p>
<p>C#<br>
<span class="count-up count-size">2</span>年</p>
<p>Sass<br>
<span class="count-up count-size">1</span>年未満</p>
<p>Vue.js<br>
<span class="count-up count-size">1</span>年未満</p>
<p>Nuxt.js<br>
<span class="count-up count-size">1</span>年未満</p>
<p>Ruby, Ruby on Rails<br>
<span class="count-up count-size">1</span>年未満</p>
<!--/box-->
</div>
<script>// https://github.com/LadyBiosphere/animated-counterの改変
$("#box1").on("inview", function (event, isInView) {
  if (isInView) {
    //要素が見えたときに実行する処理
    $("#box1 .count-up").each(function () {
      $(this).
      prop("Counter", 0).
      animate(
      {
        //0からカウントアップ
        Counter: $(this).text() },

      {
        // スピードやアニメーションの設定
        duration: 2000, //数字が大きいほど変化のスピードが遅くなる。2000=2秒
        easing: "swing", //動きの種類。他にもlinearなど設定可能
        step: function (now) {
          $(this).text(Math.ceil(now));
        } });


    });
  }
});

$("#box2").on("inview", function (event, isInView) {
  if (isInView) {
    //要素が見えたときに実行する処理
    $("#box2 .count-down").each(function () {
      $(this).
      prop("Counter", 100).
      animate(
      {
        //10からカウントダウン
        Counter: $(this).text() },

      {
        // スピードやアニメーションの設定
        duration: 2000, //数字が大きいほど変化のスピードが遅くなる。2000=2秒
        easing: "swing", //動きの種類。他にもlinearなど設定可能
        step: function (now) {
          $(this).text(Math.ceil(now));
        } });


    });
  }
});

$("#box3").on("inview", function (event, isInView) {
  if (isInView) {
    //要素が見えたときに実行する処理
    $("#box3 .count-up").each(function () {
      $(this).
      prop("Counter", 0).
      animate(
      {
        //0からカウントアップ
        Counter: $(this).text() },

      {
        // スピードやアニメーションの設定
        duration: 200, //数字が大きいほど変化のスピードが遅くなる。2000=2秒
        easing: "swing", //動きの種類。他にもlinearなど設定可能
        step: function (now) {
          $(this).text(Math.ceil(now));
        } });


    });
  }
});

$("#box4").on("inview", function (event, isInView) {
  if (isInView) {
    //要素が見えたときに実行する処理
    $("#box4 .count-up").each(function () {
      $(this).
      prop("Counter", 0).
      animate(
      {
        //0からカウントアップ
        Counter: $(this).text() },

      {
        // スピードやアニメーションの設定
        duration: 5000, //数字が大きいほど変化のスピードが遅くなる。5000=5秒
        easing: "swing", //動きの種類。他にもlinearなど設定可能
        step: function (now) {
          $(this).text(Math.ceil(now));
        } });


    });
  }
});
//# 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.inview.min.js
 */

@charset "utf-8";

/*========= レイアウトのためのCSS ===============*/

body {
  vertical-align: middle;
  text-align: center;
  z-index: 1;
  width: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-image: linear-gradient(
    76.5deg,
    rgba(129, 252, 255, 1) 0.4%,
    rgba(255, 175, 207, 1) 49.8%,
    rgba(255, 208, 153, 1) 98.6%
  );
  object-fit: cover;
}

h1,
h2 {
  text-align: center;
  text-transform: uppercase;
  font-size: 2rem;
  padding-top: 30px;
  color: #666;
}

.lead {
  padding: 20px;
  text-align: center;
}

a {
  color: #666;
  font-weight: bold;
}

.box {
  max-width: 500px;
  width: 100%;
  margin: 10vh auto;
  padding: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 10px 10px 5px -2px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 10px;
}

.box p,
p {
  color: #666;
  margin: 50px auto;
}

.count-size {
  font-size: 3rem;
  font-weight: bold;
  color: #ff7c00;
  background: -webkit-linear-gradient(
    top,
    #ffb76b 0%,
    #ffa73d 50%,
    #ff7c00 51%,
    #ff7f04 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* 
   外部依存 JS:
     - https://code.jquery.com/jquery-3.4.1.min.js
     - https://cdnjs.cloudflare.com/jquery.inview.min.js
   外部依存 CSS (このデモは下記の CSS にも依存します):
     - https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css
 */

// https://github.com/LadyBiosphere/animated-counterの改変
$("#box1").on("inview", function (event, isInView) {
  if (isInView) {
    //要素が見えたときに実行する処理
    $("#box1 .count-up").each(function () {
      $(this).
      prop("Counter", 0).
      animate(
      {
        //0からカウントアップ
        Counter: $(this).text() },

      {
        // スピードやアニメーションの設定
        duration: 2000, //数字が大きいほど変化のスピードが遅くなる。2000=2秒
        easing: "swing", //動きの種類。他にもlinearなど設定可能
        step: function (now) {
          $(this).text(Math.ceil(now));
        } });


    });
  }
});

$("#box2").on("inview", function (event, isInView) {
  if (isInView) {
    //要素が見えたときに実行する処理
    $("#box2 .count-down").each(function () {
      $(this).
      prop("Counter", 100).
      animate(
      {
        //10からカウントダウン
        Counter: $(this).text() },

      {
        // スピードやアニメーションの設定
        duration: 2000, //数字が大きいほど変化のスピードが遅くなる。2000=2秒
        easing: "swing", //動きの種類。他にもlinearなど設定可能
        step: function (now) {
          $(this).text(Math.ceil(now));
        } });


    });
  }
});

$("#box3").on("inview", function (event, isInView) {
  if (isInView) {
    //要素が見えたときに実行する処理
    $("#box3 .count-up").each(function () {
      $(this).
      prop("Counter", 0).
      animate(
      {
        //0からカウントアップ
        Counter: $(this).text() },

      {
        // スピードやアニメーションの設定
        duration: 200, //数字が大きいほど変化のスピードが遅くなる。2000=2秒
        easing: "swing", //動きの種類。他にもlinearなど設定可能
        step: function (now) {
          $(this).text(Math.ceil(now));
        } });


    });
  }
});

$("#box4").on("inview", function (event, isInView) {
  if (isInView) {
    //要素が見えたときに実行する処理
    $("#box4 .count-up").each(function () {
      $(this).
      prop("Counter", 0).
      animate(
      {
        //0からカウントアップ
        Counter: $(this).text() },

      {
        // スピードやアニメーションの設定
        duration: 5000, //数字が大きいほど変化のスピードが遅くなる。5000=5秒
        easing: "swing", //動きの種類。他にもlinearなど設定可能
        step: function (now) {
          $(this).text(Math.ceil(now));
        } });


    });
  }
});
//# sourceURL=pen.js