json

by s_kuma

HTML

<!DOCTYPE html>
<html lang="jp">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <style>
    #ajson {
      background: #f4f3f3;
      border-radius: 100%;
      font-size: .5em;
      padding:4px;
      color: #36b779;
      margin-left: .5em;
    }
    .load {
      opacity: 1 !important;
      display: block !important;
    }
    .md {
      display: none;
      opacity: 0;
      transition:all 3s!important;
    }
    .bg {
      background: rgba(50,50,50,.5);
      position: fixed;
      top:0;
      left:0;
      height: 100vh;
      width: 100vw;
      z-index: 100;
    }
    .md-bg  {
      background: #fff;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50% , -50%);
      width: 300px;
      height: auto;
      text-align: cneter;
      padding: 20px;
    }
    .clbtn {
      position: absolute;
      right: 0;
      top: 0;
      width: 40px;
      height: 40px;
      line-height: 50px;
      text-align: center;
      cursor: pointer;
    }
    .clbtn i {
      font-size: 20px;
      color: #333;
    }
</style>
</head>
<body>
<p id="cc">Json<a href="javascript:void(0);" class=" fa fas fa-info fa-fw" id ="ajson"></a>
を使ってこのような感じを再現してみたいと思います</p>
<p>   ↑</p>
<p> Let's click</p>
<section class="md">
<div class="bg">
  <div class="md-bg">
  <div class="clbtn">
    <i class=" fa fas fa-times fa-fw"></i>
  </div>
    <h3>Jsonとは</h3>
    <p>
      Jsonのルールで書かれたテキストファイルだよ。
    </p>
    
    <div class="batu">
  
  </div>
  </div>
</div>
</section>
<script>
  $("#ajson").on("click",function(){
  	$(".md").addClass("load");
  });
  $(".bg ,.clbtn").on("click",function(){
  	$(".md").removeClass("load");
  });
</script>
</body>
</html>