|  | @@ -15,6 +15,8 @@
 | 
	
		
			
				|  |  |    href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.css"
 | 
	
		
			
				|  |  |    rel="stylesheet"
 | 
	
		
			
				|  |  |  />
 | 
	
		
			
				|  |  | +<link rel="stylesheet" type="text/css" href="reset.css">
 | 
	
		
			
				|  |  | +<link rel="stylesheet" type="text/css" href="main.css">
 | 
	
		
			
				|  |  |  <!-- MDB -->
 | 
	
		
			
				|  |  |  <script
 | 
	
		
			
				|  |  |    type="text/javascript"
 | 
	
	
		
			
				|  | @@ -23,10 +25,10 @@
 | 
	
		
			
				|  |  |  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
 | 
	
		
			
				|  |  |  <script src="echarts.min.js"></script>
 | 
	
		
			
				|  |  |  </head>
 | 
	
		
			
				|  |  | -<body>
 | 
	
		
			
				|  |  | +<body class="color__grey">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <!-- Navbar -->
 | 
	
		
			
				|  |  | -<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
 | 
	
		
			
				|  |  | +<nav class="navbar navbar-expand-lg navbar-light bg-white">
 | 
	
		
			
				|  |  |      <!-- Container wrapper -->
 | 
	
		
			
				|  |  |      <div class="container-fluid">
 | 
	
		
			
				|  |  |        <!-- Navbar brand -->
 | 
	
	
		
			
				|  | @@ -55,14 +57,13 @@
 | 
	
		
			
				|  |  |              <a class="nav-link" href="http://news.google.com">
 | 
	
		
			
				|  |  |                <div>
 | 
	
		
			
				|  |  |                  <i class="fas fa-globe-americas fa-lg mb-1"></i>
 | 
	
		
			
				|  |  | -                <span class="badge rounded-pill badge-notification bg-success">11</span>
 | 
	
		
			
				|  |  | +                <!-- <span class="badge rounded-pill badge-notification bg-success">11</span> -->
 | 
	
		
			
				|  |  |                </div>
 | 
	
		
			
				|  |  |                News
 | 
	
		
			
				|  |  |              </a>
 | 
	
		
			
				|  |  |            </li>
 | 
	
		
			
				|  |  |          </ul>
 | 
	
		
			
				|  |  |          <!-- Right links -->
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |        <!-- Collapsible wrapper -->
 | 
	
		
			
				|  |  |      </div>
 | 
	
	
		
			
				|  | @@ -70,124 +71,91 @@
 | 
	
		
			
				|  |  |    </nav>
 | 
	
		
			
				|  |  |    <!-- Navbar -->
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -</br>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  <div class="container">
 | 
	
		
			
				|  |  |    <div class="row">
 | 
	
		
			
				|  |  | -    <div class="col-1 col-lg-1"></div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    <div class="col-sm-11 col-lg-11">
 | 
	
		
			
				|  |  | +    <!-- <div class="col-1 col-lg-1"></div> -->
 | 
	
		
			
				|  |  | +    <div class="col-12 col-12">
 | 
	
		
			
				|  |  |          <!-- Search form  -->
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        <form id="searchform" class="d-flex input-group w-auto" >
 | 
	
		
			
				|  |  | -          <input type="search" class="form-control" placeholder="Search" aria-label="Domain Name" id="search_query"/>
 | 
	
		
			
				|  |  | -          <button class="btn btn-primary" type="button" data-mdb-ripple-color="dark" onclick="check_form();">
 | 
	
		
			
				|  |  | +      <form id="searchform" class="d-flex input-group search__form">
 | 
	
		
			
				|  |  | +        <input type="search" class="form-control search__bar" placeholder="Search" aria-label="Domain Name" id="search_query"/>
 | 
	
		
			
				|  |  | +        <button class="btn btn-primary search__btn" type="button" data-mdb-ripple-color="dark" id="search__btn">
 | 
	
		
			
				|  |  |              Search
 | 
	
		
			
				|  |  | -          </button>
 | 
	
		
			
				|  |  | -        </form>
 | 
	
		
			
				|  |  | -       
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        <div class="card text-center">
 | 
	
		
			
				|  |  | -          <div class="card-header" id="sitename">Website Traffic</div>
 | 
	
		
			
				|  |  | -          <div class="card-body">
 | 
	
		
			
				|  |  | -            <h5 class="card-title" id="sitetitle"></h5>
 | 
	
		
			
				|  |  | -            <p class="card-text" id="descriptions">
 | 
	
		
			
				|  |  | -            </p>
 | 
	
		
			
				|  |  | +        </button>
 | 
	
		
			
				|  |  | +      </form>
 | 
	
		
			
				|  |  | +        <h3 class="h3 text-center" id="sitename">Website Traffic</h3>
 | 
	
		
			
				|  |  | +          <div class="card card__grback mb-5">
 | 
	
		
			
				|  |  | +            <div class="card-body card__left">
 | 
	
		
			
				|  |  | +            <!-- 根據搜尋內容顯示網站標題及網站內容簡介 -->
 | 
	
		
			
				|  |  | +              <h5 class="card-title card__url" id="sitetitle"><i class="fas fa-chart-bar card__url__icon"></i>Example.com</h5>
 | 
	
		
			
				|  |  | +              <p class="card-text card__intro" id="descriptions">
 | 
	
		
			
				|  |  | +                Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut ipsa totam maxime pariatur iure 
 | 
	
		
			
				|  |  | +                suscipit nihil possimus deserunt esse blanditiis. Quidem aliquid, voluptas quae tenetur quaerat 
 | 
	
		
			
				|  |  | +                iure explicabo repellat ad.
 | 
	
		
			
				|  |  | +              </p>
 | 
	
		
			
				|  |  |  <!--            <a href="#" class="btn btn-primary" id="globalrank2"></a> -->
 | 
	
		
			
				|  |  | +            </div>
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -          <div class="row">
 | 
	
		
			
				|  |  | +          <div class="text-muted mb-2">TRAFFICS</div>
 | 
	
		
			
				|  |  | +          <div class="row g-5">
 | 
	
		
			
				|  |  |              <div class="col-sm-4">
 | 
	
		
			
				|  |  | -              <div class="card">
 | 
	
		
			
				|  |  | -                <div class="card-body">
 | 
	
		
			
				|  |  | -                  <h5 class="card-title">Global Ranks</h5>
 | 
	
		
			
				|  |  | +              <div class="card p-3">
 | 
	
		
			
				|  |  | +                <div class="card-body text-center">
 | 
	
		
			
				|  |  | +                  <h5 class="card-title card__rank__title mb-2">Global Ranks</h5>
 | 
	
		
			
				|  |  |                    <p class="card-text" >
 | 
	
		
			
				|  |  |                    </p>
 | 
	
		
			
				|  |  | -                  <a href="#" class="btn btn-primary" id="globalrank"></a>
 | 
	
		
			
				|  |  | +                  <span href="#" class="rank__mark"># <strong id="globalrank" class="rank_num">1000</strong></span>
 | 
	
		
			
				|  |  |                  </div>
 | 
	
		
			
				|  |  |                </div>
 | 
	
		
			
				|  |  |              </div>
 | 
	
		
			
				|  |  |              <div class="col-sm-4">
 | 
	
		
			
				|  |  | -              <div class="card">
 | 
	
		
			
				|  |  | -                <div class="card-body">
 | 
	
		
			
				|  |  | -                  <h5 class="card-title">Country Ranks</h5>
 | 
	
		
			
				|  |  | +              <div class="card p-3">
 | 
	
		
			
				|  |  | +                <div class="card-body text-center">
 | 
	
		
			
				|  |  | +                  <h5 class="card-title card__rank__title mb-2">Country Ranks</h5>
 | 
	
		
			
				|  |  |                    <p class="card-text">
 | 
	
		
			
				|  |  |                    </p>
 | 
	
		
			
				|  |  | -                  <a href="#" class="btn btn-primary" id="countryrank"></a>
 | 
	
		
			
				|  |  | +                  <span href="#" class="rank__mark"># <strong id="countryrank" class="rank_num">100</strong></span>
 | 
	
		
			
				|  |  |                  </div>
 | 
	
		
			
				|  |  |                </div>
 | 
	
		
			
				|  |  |              </div>
 | 
	
		
			
				|  |  |              <div class="col-sm-4">
 | 
	
		
			
				|  |  | -              <div class="card">
 | 
	
		
			
				|  |  | -                <div class="card-body">
 | 
	
		
			
				|  |  | -                  <h5 class="card-title">Category</h5>
 | 
	
		
			
				|  |  | -                  <p class="card-text" id="category">
 | 
	
		
			
				|  |  | +              <div class="card p-3">
 | 
	
		
			
				|  |  | +                <div class="card-body text-center">
 | 
	
		
			
				|  |  | +                  <h5 class="card-title card__rank__title mb-2"><i class="fas fa-tags"></i>Category</h5>
 | 
	
		
			
				|  |  | +                  <p class="card-text card__rank__cat" id="category">
 | 
	
		
			
				|  |  | +                    Lorem
 | 
	
		
			
				|  |  |                    </p>
 | 
	
		
			
				|  |  | -<!--                  <a href="#" class="btn btn-primary" ></a>-->
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                  </div>
 | 
	
		
			
				|  |  |                </div>
 | 
	
		
			
				|  |  |              </div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -          <div class="card-footer text-muted">Global Website Traffic Rankings</div>
 | 
	
		
			
				|  |  | -        </div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +          <div class="text-muted mt-5 mb-2">Global Website Traffic Rankings</div>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  </div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -<div class="container">
 | 
	
		
			
				|  |  | +<div class="container mb-5">
 | 
	
		
			
				|  |  |    <div class="row">
 | 
	
		
			
				|  |  | -    <div class="col-1 col-lg-1"></div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    <div class="col-sm-11 col-lg-11">
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +    <div class="col-12 col-12">
 | 
	
		
			
				|  |  |        <!--
 | 
	
		
			
				|  |  |        <button type="button" class="btn btn-primary btn-block mb-4 ripple-surface">Place order</button>
 | 
	
		
			
				|  |  | --->
 | 
	
		
			
				|  |  | -<div id="main" style="width: 600px;height:400px;"></div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +      -->
 | 
	
		
			
				|  |  | +      <div class="card card__notHover">
 | 
	
		
			
				|  |  | +        <div id="main" class="chart"></div>
 | 
	
		
			
				|  |  | +      </div>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  </div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +<footer class="footer text-center p-4 bg-white">
 | 
	
		
			
				|  |  | +  <div class="text-muted"> © 2021 Copyright: Googo Website Traffic</div>
 | 
	
		
			
				|  |  | +</footer>
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -var input = document.getElementById("search_query");
 | 
	
		
			
				|  |  | +const input = document.getElementById("search_query");
 | 
	
		
			
				|  |  | +const search__btn = document.getElementById("search__btn");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +search__btn.addEventListener("click", function(e) {
 | 
	
		
			
				|  |  | +  e.preventDefault();
 | 
	
		
			
				|  |  | +  check_form();
 | 
	
		
			
				|  |  | +})
 | 
	
		
			
				|  |  |  input.addEventListener("keyup", function(event) {
 | 
	
		
			
				|  |  |    // Number 13 is the "Enter" key on the keyboard
 | 
	
		
			
				|  |  |    if (event.keyCode === 13) {
 | 
	
	
		
			
				|  | @@ -197,67 +165,59 @@ input.addEventListener("keyup", function(event) {
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        var myChart = echarts.init(document.getElementById('main'));
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        var option;
 | 
	
		
			
				|  |  | +const myChart = echarts.init(document.getElementById('main'));
 | 
	
		
			
				|  |  | +let option;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  function check_form(){
 | 
	
		
			
				|  |  | -    var qry=document.getElementById('search_query').value;
 | 
	
		
			
				|  |  | -    axios.get('http://www.googo.org:8080/domain/'+qry)
 | 
	
		
			
				|  |  | -  .then((response) => {
 | 
	
		
			
				|  |  | -    var sitename = document.getElementById('sitename');
 | 
	
		
			
				|  |  | -    var sitetitle = document.getElementById('sitetitle');
 | 
	
		
			
				|  |  | -    var descriptions=document.getElementById('descriptions');
 | 
	
		
			
				|  |  | -    var globalrank=document.getElementById('globalrank');
 | 
	
		
			
				|  |  | -    var countryrank=document.getElementById('countryrank');    
 | 
	
		
			
				|  |  | -    var category=document.getElementById('category');    
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    console.log(response.data);
 | 
	
		
			
				|  |  | -//    alert(response.data.SiteName);
 | 
	
		
			
				|  |  | -//    var obj = JSON.parse(response.data);
 | 
	
		
			
				|  |  | -//    alert(obj);
 | 
	
		
			
				|  |  | -    sitename.innerHTML =response.data.SiteName;
 | 
	
		
			
				|  |  | -    descriptions.innerHTML=response.data.Description;
 | 
	
		
			
				|  |  | -    globalrank.innerHTML=response.data.GlobalRank.Rank;
 | 
	
		
			
				|  |  | -    sitetitle.innerHTML=response.data.Title;
 | 
	
		
			
				|  |  | -    countryrank.innerHTML=response.data.CountryRank.Rank;
 | 
	
		
			
				|  |  | -    category.innerHTML=response.data.Category;
 | 
	
		
			
				|  |  | - 
 | 
	
		
			
				|  |  | -    var key_ary=[];
 | 
	
		
			
				|  |  | -    var val_ary=[];
 | 
	
		
			
				|  |  | -    for (const [key, value] of Object.entries(response.data.EstimatedMonthlyVisits)) {
 | 
	
		
			
				|  |  | -      key_ary.push(key);
 | 
	
		
			
				|  |  | -      val_ary.push(value);
 | 
	
		
			
				|  |  | -}
 | 
	
		
			
				|  |  | -option = {
 | 
	
		
			
				|  |  | -    xAxis: {
 | 
	
		
			
				|  |  | -        type: 'category',
 | 
	
		
			
				|  |  | -        boundaryGap: false,
 | 
	
		
			
				|  |  | -        data: key_ary
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | -    yAxis: {
 | 
	
		
			
				|  |  | -        type: 'value'
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | -    series: [{
 | 
	
		
			
				|  |  | -        data: val_ary,
 | 
	
		
			
				|  |  | -        type: 'line',
 | 
	
		
			
				|  |  | -        areaStyle: {}
 | 
	
		
			
				|  |  | -    }]
 | 
	
		
			
				|  |  | -};
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        myChart.setOption(option);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    //    sitename.innerHTML =response.data
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    console.log(response.status);
 | 
	
		
			
				|  |  | -    console.log(response.statusText);
 | 
	
		
			
				|  |  | -    console.log(response.headers);
 | 
	
		
			
				|  |  | -    console.log(response.config);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -  });
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +    const qry = document.getElementById('search_query').value;
 | 
	
		
			
				|  |  | +    axios.get('http://www.googo.org:8080/domain/' + qry)
 | 
	
		
			
				|  |  | +    .then((response) => {
 | 
	
		
			
				|  |  | +      const sitename = document.getElementById('sitename');
 | 
	
		
			
				|  |  | +      const sitetitle = document.getElementById('sitetitle');
 | 
	
		
			
				|  |  | +      const descriptions = document.getElementById('descriptions');
 | 
	
		
			
				|  |  | +      const globalrank = document.getElementById('globalrank');
 | 
	
		
			
				|  |  | +      const countryrank = document.getElementById('countryrank');    
 | 
	
		
			
				|  |  | +      const category = document.getElementById('category');    
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      console.log(response.data); 
 | 
	
		
			
				|  |  | +      //    alert(response.data.SiteName);
 | 
	
		
			
				|  |  | +      //    var obj = JSON.parse(response.data);
 | 
	
		
			
				|  |  | +      //    alert(obj);
 | 
	
		
			
				|  |  | +      itename.textContent =response.data.SiteName;
 | 
	
		
			
				|  |  | +      descriptions.textContent=response.data.Description;
 | 
	
		
			
				|  |  | +      globalrank.textContent=response.data.GlobalRank.Rank;
 | 
	
		
			
				|  |  | +      sitetitle.textContent=response.data.Title;
 | 
	
		
			
				|  |  | +      countryrank.textContent=response.data.CountryRank.Rank;
 | 
	
		
			
				|  |  | +      category.textContent=response.data.Category;
 | 
	
		
			
				|  |  | +  
 | 
	
		
			
				|  |  | +      const key_ary=[];
 | 
	
		
			
				|  |  | +      const val_ary=[];
 | 
	
		
			
				|  |  | +      for (const [key, value] of Object.entries(response.data.EstimatedMonthlyVisits)) {
 | 
	
		
			
				|  |  | +        key_ary.push(key);
 | 
	
		
			
				|  |  | +        val_ary.push(value);
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      option = {
 | 
	
		
			
				|  |  | +          xAxis: {
 | 
	
		
			
				|  |  | +              type: 'category',
 | 
	
		
			
				|  |  | +              boundaryGap: false,
 | 
	
		
			
				|  |  | +              data: key_ary
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          yAxis: {
 | 
	
		
			
				|  |  | +              type: 'value'
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          series: [{
 | 
	
		
			
				|  |  | +              data: val_ary,
 | 
	
		
			
				|  |  | +              type: 'line',
 | 
	
		
			
				|  |  | +              areaStyle: {}
 | 
	
		
			
				|  |  | +          }]
 | 
	
		
			
				|  |  | +      };
 | 
	
		
			
				|  |  | +          myChart.setOption(option);
 | 
	
		
			
				|  |  | +      //    sitename.innerHTML =response.data
 | 
	
		
			
				|  |  | +      console.log(response.status);
 | 
	
		
			
				|  |  | +      console.log(response.statusText);
 | 
	
		
			
				|  |  | +      console.log(response.headers);
 | 
	
		
			
				|  |  | +      console.log(response.config);
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  
 |