123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Googo Website Traffic</title>
- <!-- Font Awesome -->
- <link
- href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
- rel="stylesheet"
- />
- <!-- Google Fonts -->
- <link
- href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
- rel="stylesheet"
- />
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
- integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
- <!-- MDB -->
- <link
- href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.css"
- rel="stylesheet"
- />
- <link rel="stylesheet" href="https://unpkg.com/js-datepicker/dist/datepicker.min.css">
- <link rel="stylesheet" type="text/css" href="reset.css">
- <link rel="stylesheet" type="text/css" href="main.css">
- <!-- MDB -->
- <script
- type="text/javascript"
- src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.js"
- ></script>
- <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
- <script src="echarts.min.js"></script>
- </head>
- <body class="color__grey">
- <!-- Navbar -->
- <nav class="navbar navbar-expand-lg navbar-light bg-white">
- <!-- Container wrapper -->
- <div class="container-fluid">
- <!-- Navbar brand -->
- <a class="navbar-brand" href="#">Googo Website Traffic</a>
-
- <!-- Toggle button -->
- <button class="navbar-toggler" type="button" data-mdb-toggle="collapse"
- data-mdb-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
- aria-label="Toggle navigation">
- <i class="fas fa-bars text-light"></i>
- </button>
-
- <!-- Collapsible wrapper -->
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
- <!-- Left links -->
- <ul class="navbar-nav me-auto d-flex flex-row mt-3 mt-lg-0">
- <li class="nav-item text-center mx-2 mx-lg-1">
- <a class="nav-link active" aria-current="page" href="index.html">
- <div>
- <i class="fas fa-home fa-lg mb-1"></i>
- </div>
- Home
- </a>
- </li>
- <li class="nav-item text-center mx-2 mx-lg-1">
- <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> -->
- </div>
- News
- </a>
- </li>
- <li class="nav-item text-center mx-2 mx-lg-1">
- <a class="nav-link" href="keywords.html">
- <div>
- <i class="fab fa-korvue fa-lg mb-1"></i>
- <!-- <span class="badge rounded-pill badge-notification bg-success">11</span> -->
- </div>
- Keywords
- </a>
- </li>
- </ul>
- <!-- Right links -->
- </div>
- <!-- Collapsible wrapper -->
- </div>
- <!-- Container wrapper -->
- </nav>
- <!-- Navbar -->
- <div class="container">
- <div class="row">
- <!-- <div class="col-1 col-lg-1"></div> -->
- <div class="col-12 col-12">
- <!-- Search 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>
- <h3 class="h3 text-center" id="sitename">Website Traffic</h3>
- <div class="card card__grback mb-4">
- <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="date__input mb-3">
- <label for="daterng">開始日期:</label><input type="text" name="daterng" id="daterng1">
- <label for="daterng">結束日期:</label><input type="text" name="daterng" id="daterng2">
- <button class='sub__date btn'>套用</button>
- </div>
- <div class="text-muted mb-2 border-bottom">RANKING</div>
- <div class="row g-5 mb-3">
- <div class="col-sm-4">
- <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>
- <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 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>
- <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 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>
- </div>
- </div>
- </div>
- </div>
- <div class="text-muted mt-5 mb-2">Global Website Traffic Rankings</div>
- <div class="row mb-4">
- <div class="col-12 col-12">
- <!--
- <button type="button" class="btn btn-primary btn-block mb-4 ripple-surface">Place order</button>
- -->
- <div class="card card__notHover">
- <div id="main" class="chart"></div>
- </div>
- </div>
- </div>
- <div class="text-muted mb-2 border-bottom">BENEFIT</div>
- <div class="btn-group group__btn" role="group" aria-label="date-buttons">
- <button class="btn__benefit active">搜尋流量</button>
- <button class="btn__benefit">有搜尋流量的網頁數</button>
- </div>
- <div class="row g-5 mb-3">
- <div class="col-sm-4">
- <div class="card p-3">
- <div class="card-body text-center">
- <h5 class="card-title card__rank__title mb-2">搜尋流量</h5>
- <p class="card-text" >
- </p>
- <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 p-3">
- <div class="card-body text-center">
- <h5 class="card-title card__rank__title mb-2">有搜尋流量的網頁數</h5>
- <p class="card-text">
- </p>
- <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 p-3">
- <div class="card-body text-center">
- <h5 class="card-title card__rank__title mb-2"><i class="fas fa-tags"></i>轉換訂單數</h5>
- <span href="#" class="rank__mark"><strong id="countryrank" class="rank_num">100</strong></span>
- </div>
- </div>
- </div>
- </div>
- <div class="row mb-4">
- <div class="col-12 col-12">
- <!--
- <button type="button" class="btn btn-primary btn-block mb-4 ripple-surface">Place order</button>
- -->
- <div class="card card__notHover">
- <div id="main" class="chart"></div>
- </div>
- </div>
- </div>
- <div class="text-muted mb-2 border-bottom">SEO</div>
- <div class="row mb-4">
- <div class="col-12 col-12">
- <!--
- <button type="button" class="btn btn-primary btn-block mb-4 ripple-surface">Place order</button>
- -->
- <div class="card card__notHover">
- <div id="bar" class="chart"></div>
- </div>
- </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
- src="https://code.jquery.com/jquery-3.6.0.min.js"
- integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
- crossorigin="anonymous"></script>
- <script src="https://unpkg.com/js-datepicker"></script>
- <script>
- const input = document.getElementById("search_query");
- const search__btn = document.getElementById("search__btn");
- const btn__benefit = document.querySelectorAll(".btn__benefit");
- const picker_str = datepicker('#daterng1', {
- id: 1
- });
- const picker_end = datepicker('#daterng2', {
- id: 1
- });
- $('.sub__date').click(function(e){
- e.preventDefault();
- console.log(picker_end.getRange());
- });
- 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) {
- check_form();
- event.preventDefault();
- // document.getElementById("myBtn").click();
- }
- });
- btn__benefit.forEach((item, i) => {
- item.addEventListener("click", function(){
- item.toggleClass('active');
- })
- });
- const myChart = echarts.init(document.getElementById('main'));
- let option;
- function check_form(){
- const qry = document.getElementById('search_query').value;
- axios.get('http://www.googo.org:8080/dm/' + qry)
- // 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);
- sitename.textContent =response.data.SiteName;
- descriptions.textContent=response.data.Description;
- globalrank.textContent=response.data.GlobalRank;
- sitetitle.textContent=response.data.Title;
- countryrank.textContent=response.data.CountryRank;
- 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
- // var bar = document.getElementById('bar');
- // var barChart = echarts.init(bar);
- });
- }
- </script>
- </body>
-
- </html>
|