Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!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>三豪控制台</title>
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"
    integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
    integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
  <link rel="shortcut icon" href="/img/leaf.png">
  <link rel="stylesheet" href="/all.css">


</head>

<body>
  <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
    <a class="navbar-brand" href="#">三豪控制台</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
      aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav mr-auto">
        <li class="nav-item active">
          <a class="nav-link" href="#">首頁<span class="sr-only">(current)</span></a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">列表</a>
        </li>
      </ul>
    </div>
  </nav>
  <!-- ---------main start----------------- -->
  <div class="container-fluid mt-3 main">
    <div class="row mb-4">
      <div class="col-lg-3 col-6">
        <div class="card rounded-0 h-100">
          <div class="card-body d-flex align-items-center">
            <div><i class="fas fa-money-bill-alt fa-3x text-secondary d-none d-sm-block"></i></div>
            <div class="text-center w-100">
              <div class="h5">今日營收</div>
              <div class="h3">156785</div>
            </div>
          </div>
        </div>
      </div>
      <div class="col-lg-3 col-6">
        <div class="card rounded-0  h-100">
          <div class="card-body d-flex align-items-center">
            <div><i class="fas fa-users fa-3x text-secondary d-none d-sm-block"></i></div>
            <div class="text-center w-100">
              <div class="h5">會員增加</div>
              <div class="display-3">155</div>
            </div>
          </div>
        </div>
      </div>
      <div class="col-lg-3 col-6">
        <div class="card rounded-0 h-100">
          <div class="card-body d-flex align-items-center">
            <div><i class="fas fa-money-bill-alt fa-3x text-secondary d-none d-sm-block"></i></div>
            <div class="text-center w-100">
              <div class="h5">訂單數</div>
              <div class="display-3">145</div>
            </div>
          </div>
        </div>
      </div>
      <div class="col-lg-3 col-6">
        <div class="card rounded-0  h-100">
          <div class="card-body d-flex align-items-center">
            <div><i class="fas fa-users fa-3x text-secondary d-none d-sm-block"></i></div>
            <div class="text-center w-100">
              <div class="h5">待出貨數</div>
              <div class="display-3">72</div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="row mb-4">
      <div class="col-sm-4">
        <div class="card rounded-0 h-100">
          <div class="card-body d-flex align-items-center">
            <div class="text-center w-100">
              <div class="h5">目前線上人數</div>
              <div class="display-1">80</div>
              <div class="progress">
                <div class="progress-bar" role="progressbar" style="width: 30%" aria-valuenow="15" aria-valuemin="0"
                  aria-valuemax="100">PC</div>
                <div class="progress-bar bg-success" role="progressbar" style="width: 70%" aria-valuenow="30"
                  aria-valuemin="0" aria-valuemax="100">Mobile</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="col-sm-8">
        <div class="card">
          <div class="card-header">新進訂單</div>
          <div class="card-body">
            <div class="text-right mb-3"><a href="#" class="btn btn-outline-secondary ">訂單管理</a></div>
            <table class="table">
              <thead>
                <tr>
                  <th scope="col">訂單單號</th>
                  <th scope="col">客戶名稱</th>
                  <th scope="col">貨物品名</th>
                  <th scope="col">單量/價格</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <th scope="row">1</th>
                  <td>Mark</td>
                  <td>Otto</td>
                  <td>1/520</td>
                </tr>
                <tr>
                  <th scope="row">2</th>
                  <td>Jacob</td>
                  <td>Thornton</td>
                  <td>33/880</td>
                </tr>
                <tr>
                  <th scope="row">3</th>
                  <td>Larry</td>
                  <td>the Bird</td>
                  <td>4/900</td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
    <!-- -----chart------ -->
    <div class="row">
      <div class="col-lg-8">
        <div class="card rounded-0">
          <div class="card-header">用戶來源</div>
          <div class="card-body">
            <div class="row">
              <div class="col-lg-8">
                <canvas id="barCanvas"></canvas>
              </div>
              <div class="col-lg-4">
                <h3>Details</h3>
                <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Obcaecati aut, accusamus exercitationem
                  delectus pariatur facere, quidem iste, eos itaque fugit in atque quisquam libero dolor ullam
                  repudiandae eius. Eaque, quos?</p>
                <div class="progress mt-5">
                  <div class="progress-bar" role="progressbar" style="width:20%; height: 15px;" aria-valuenow="15"
                    aria-valuemin="0" aria-valuemax="100">PC</div>
                </div>
                <br>
                <div class="progress">
                  <div class="progress-bar" role="progressbar" style="width: 50%; height: 15px;" aria-valuenow="15"
                    aria-valuemin="0" aria-valuemax="100">PC</div>
                </div>
                <br>
                <div class="progress">
                  <div class="progress-bar" role="progressbar" style="width: 80%; height: 15px;" aria-valuenow="15"
                    aria-valuemin="0" aria-valuemax="100">PC</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="col-lg-4">
        <div class="card rounded-0  h-100">
          <div class="card-header">瀏覽器</div>
          <div class="card-body d-flex align-items-center">
            <canvas class="chart-item"></canvas>
          </div>
        </div>
      </div>
    </div>

    <!-- -----chart end------ -->
    <section class="mt-3">
      <div class="card">
        <div class="card-header">月營運狀態</div>
        <div class="card-body">
          <div class="d-flex">
            <div class="form-group">
              <label for="month" class="sr-only">月份</label>
              <select name="" id="month" class="form-control form-control-sm">
                <option>1月</option>
                <option>2月</option>
                <option>3月</option>
                <option>4月</option>
                <option>5月</option>
              </select>
            </div>
            <div class="ml-auto">
              <a href="#" class="btn btn-sm btn-outline-secondary">下載報表</a>
              <a href="#" class="btn btn-sm btn-outline-secondary">訂單管理</a>
            </div>
          </div>
         <div class="table-responsive">
           <table class="table mb-0">
            <thead>
              <tr>
                <th scope="col">日期</th>
                <th scope="col">訂單數</th>
                <th scope="col">出貨數量</th>
                <th scope="col">退貨數</th>
                <th scope="col" class="text-right">營業額</th>
                <th scope="col" class="text-right">淨利</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <th scope="row">5/2</th>
                <td>Mark</td>
                <td>Otto</td>
                <td>@mdo</td>
                <td class="text-right">Otto</td>
                <td class="text-right">@mdo</td>
              </tr>
              <tr>
                <th scope="row">5/3</th>
                <td>Jacob</td>
                <td>Thornton</td>
                <td>@fat</td>
                <td class="text-right">Otto</td>
                <td class="text-right">@mdo</td>
              </tr>
              <tr>
                <th scope="row">5/4</th>
                <td>Larry</td>
                <td>the Bird</td>
                <td>@twitter</td>
                <td class="text-right">Otto</td>
                <td class="text-right">@mdo</td>
              </tr>
              <tr>
                <th scope="row">5/5</th>
                <td>Larry</td>
                <td>the Bird</td>
                <td>@twitter</td>
                <td class="text-right">Otto</td>
                <td class="text-right">@mdo</td>
              </tr>
              <tr>
                <th scope="row">5/6</th>
                <td>Larry</td>
                <td>the Bird</td>
                <td>@twitter</td>
                <td class="text-right">Otto</td>
                <td class="text-right">@mdo</td>
              </tr>
              <tr>
                <th scope="row" colspan="5" class="text-right">月總營收</th>
                <td class="text-right">@mdo</td>
              </tr>
              <tr>
                <th scope="row" colspan="5" class="text-right">月總淨利</th>                
                <td class="text-right">@mdo</td>
              </tr>
            </tbody>
          </table>
         </div>         
        </div>
      </div>
    </section>
   
    <footer class="bg-light text-secondary text-center mt-5 py-3">三豪昌後台管理系統</footer>



  <!-- Optional JavaScript -->
  <!-- jQuery first, then Popper.js, then Bootstrap JS -->
  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
    integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
    crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"
    integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut"
    crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"
    integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k"
    crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0/dist/Chart.min.js"></script>

  <script>
    window.chartColors = {
      red: 'rgb(255, 99, 132)',
      orange: 'rgb(255, 159, 64)',
      yellow: 'rgb(255, 205, 86)',
      green: 'rgb(75, 192, 192)',
      blue: 'rgb(54, 162, 235)',
      purple: 'rgb(153, 102, 255)',
      grey: 'rgb(201, 203, 207)'
    };

    var randomScalingFactor = function () {
      return Math.round(Math.random() * 100);
    };

    var config = {
      type: 'pie',
      data: {
        datasets: [{
          data: [
            randomScalingFactor(),
            randomScalingFactor(),
            randomScalingFactor(),
            randomScalingFactor(),
            randomScalingFactor(),
          ],
          backgroundColor: [
            window.chartColors.red,
            window.chartColors.orange,
            window.chartColors.yellow,
            window.chartColors.green,
            window.chartColors.blue,
          ],
          label: 'Dataset 1'
        }],
        labels: [
          "Red",
          "Orange",
          "Yellow",
          "Green",
          "Blue"
        ]
      },
      options: {
        responsive: true
      }
    };


    // bar
    var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
    var colors = Chart.helpers.color;
    var barChartData = {
      labels: ["January", "February", "March", "April", "May", "June", "July"],
      datasets: [{
        label: 'Dataset 1',
        backgroundColor: colors(window.chartColors.red).alpha(0.5).rgbString(),
        borderColor: window.chartColors.red,
        borderWidth: 1,
        data: [
          randomScalingFactor(),
          randomScalingFactor(),
          randomScalingFactor(),
          randomScalingFactor(),
          randomScalingFactor(),
          randomScalingFactor(),
          randomScalingFactor()
        ]
      }, {
        label: 'Dataset 2',
        backgroundColor: colors(window.chartColors.blue).alpha(0.5).rgbString(),
        borderColor: window.chartColors.blue,
        borderWidth: 1,
        data: [
          randomScalingFactor(),
          randomScalingFactor(),
          randomScalingFactor(),
          randomScalingFactor(),
          randomScalingFactor(),
          randomScalingFactor(),
          randomScalingFactor()
        ]
      }]

    };

    window.onload = function () {
      // pie
      document.querySelectorAll('.chart-item').forEach(function (item) {
        config.data.datasets.forEach(function (dataset) {
          dataset.data = dataset.data.map(function () {
            return randomScalingFactor();
          });
        });
        var ctx = item.getContext("2d");
        window.myPie = new Chart(ctx, config);
      })


      // bar
      var barCtx = document.getElementById("barCanvas").getContext("2d");
      window.myBar = new Chart(barCtx, {
        type: 'bar',
        data: barChartData,
        options: {
          responsive: true,
          legend: {
            position: 'top',
          },
          title: {
            display: true,
            text: 'Chart.js Bar Chart'
          }
        }
      });

    };
  </script>
</body>

</html>
              
            
!

CSS

              
                html{
    font-size: 14px;
}
.main{
    min-height: calc(100vh - (49px + 49px + 42px + 14px))
}
              
            
!

JS

              
                
              
            
!
999px

Console