diff options
| author | Mark Otto <[email protected]> | 2018-01-14 16:06:52 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-01-14 16:06:52 -0800 |
| commit | e946348eca928fa1c42dbb92c7a612543832dccc (patch) | |
| tree | 14a87eed8416197c156e9090d02f1de604e6cdab /docs/4.0/examples/dashboard | |
| parent | 4a64592dd8b9e97790533d79350d60291a7d8789 (diff) | |
| download | bootstrap-e946348eca928fa1c42dbb92c7a612543832dccc.tar.xz bootstrap-e946348eca928fa1c42dbb92c7a612543832dccc.zip | |
Examples updates (#24898)
* fix cover nav
* Improve signin visuals and alignment with that flexbox love
* rewrite cover example in flexbox
* lighten signin bg
* first pass at pricing example
* redo examples index with data file
* tighten up spacing a bit
* update navbar descriptions
* link pricing
* move that back
* property order
* Fix test errors.
* Compress pricing.png.
* add form validation example
* remove that
* rename that
* restyle and space out
* fix errors
* change order
* cleanup album css and styles
* tweak examples index
* make it a badge
* options
* improve sticky footer alignment
* redesign example index
* brand new blog layout
* start new screenshots
* new product example page a la apple
* add email field
* fix linter, remove unused blog css
* hook up feather icons to start
* redo dashboard
* fix linting
* add floating labels example
* formatting
* formatting
* lint
* fix values on select
* optional input, plus input group
* new dashboard image
* start to reboot the offcanvas example
* updated images
* new offcanvas mostly implemented
* linting
* edit description
* more description changes
* - Add vertical margin to album hero buttons for when they're stacked
- Adjust font-size and padding for pricing header and hero
- Fix checkout's stacked column margins, plus update their check/radio
markup
- Update product's utilities to be responsive
- Made blog cards somewhat responsive (needs a bit more work tbh)
* drop leading zero
* more linting
* swap empty images for holder, fix border
* dist the docs
* navbars have no margin-bottom to begin
* add css var, tweak padding for mobile
* comment headers
* nix commented out code
* nix the navbar structure for a custom one, stack it on mobile
* tweak heading button group for mobile
* Removed narrow jumbotron and justified nav examples as these are easily accomplished with new components in v4
* improve card sizing on pricing
* update and compress
Diffstat (limited to 'docs/4.0/examples/dashboard')
| -rw-r--r-- | docs/4.0/examples/dashboard/dashboard.css | 95 | ||||
| -rw-r--r-- | docs/4.0/examples/dashboard/index.html | 231 |
2 files changed, 198 insertions, 128 deletions
diff --git a/docs/4.0/examples/dashboard/dashboard.css b/docs/4.0/examples/dashboard/dashboard.css index ca7135b08..ef40fe78f 100644 --- a/docs/4.0/examples/dashboard/dashboard.css +++ b/docs/4.0/examples/dashboard/dashboard.css @@ -1,20 +1,11 @@ -/* - * Base structure - */ - -/* Move down content because we have a fixed navbar that is 3.5rem tall */ body { - padding-top: 3.5rem; + font-size: .875rem; } -/* - * Typography - */ - -h1 { - padding-bottom: 9px; - margin-bottom: 20px; - border-bottom: 1px solid #eee; +.feather { + width: 16px; + height: 16px; + vertical-align: text-bottom; } /* @@ -23,42 +14,80 @@ h1 { .sidebar { position: fixed; - top: 51px; + top: 0; bottom: 0; left: 0; - z-index: 1000; - padding: 20px 0; + z-index: 100; /* Behind the navbar */ + padding: 0; + box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1); +} + +.sidebar-sticky { + position: -webkit-sticky; + position: sticky; + top: 48px; /* Height of navbar */ + height: calc(100vh - 48px); + padding-top: .5rem; overflow-x: hidden; overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ - border-right: 1px solid #eee; } -.sidebar .nav { - margin-bottom: 20px; +.sidebar .nav-link { + font-weight: 500; + color: #333; } -.sidebar .nav-item { - width: 100%; +.sidebar .nav-link .feather { + margin-right: 4px; + color: #999; } -.sidebar .nav-item + .nav-item { - margin-left: 0; +.sidebar .nav-link.active { + color: #007bff; } -.sidebar .nav-link { - border-radius: 0; +.sidebar .nav-link:hover .feather, +.sidebar .nav-link.active .feather { + color: inherit; +} + +.sidebar-heading { + font-size: .75rem; + text-transform: uppercase; } /* - * Dashboard + * Navbar */ -/* Placeholders */ -.placeholders { - padding-bottom: 3rem; +.navbar-brand { + padding-top: .75rem; + padding-bottom: .75rem; + font-size: 1rem; + background-color: rgba(0, 0, 0, .25); + box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25); +} + +.navbar .form-control { + padding: .75rem 1rem; + border-width: 0; + border-radius: 0; } -.placeholder img { - padding-top: 1.5rem; - padding-bottom: 1.5rem; +.form-control-dark { + color: #fff; + background-color: rgba(255, 255, 255, .1); + border-color: rgba(255, 255, 255, .1); } + +.form-control-dark:focus { + border-color: transparent; + box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); +} + +/* + * Utilities + */ + +.border-top { border-top: 1px solid #e5e5e5; } +.border-bottom { border-bottom: 1px solid #e5e5e5; } diff --git a/docs/4.0/examples/dashboard/index.html b/docs/4.0/examples/dashboard/index.html index c74760a37..12088d450 100644 --- a/docs/4.0/examples/dashboard/index.html +++ b/docs/4.0/examples/dashboard/index.html @@ -17,111 +17,114 @@ </head> <body> - <header> - <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> - <a class="navbar-brand" href="#">Dashboard</a> - <button class="navbar-toggler d-lg-none" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation"> - <span class="navbar-toggler-icon"></span> - </button> - - <div class="collapse navbar-collapse" id="navbarsExampleDefault"> - <ul class="navbar-nav mr-auto"> - <li class="nav-item active"> - <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">Settings</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">Profile</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">Help</a> - </li> - </ul> - <form class="form-inline mt-2 mt-md-0"> - <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search"> - <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button> - </form> - </div> - </nav> - </header> + <nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0"> + <a class="navbar-brand col-sm-3 col-md-2 mr-0" href="#">Company name</a> + <input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search"> + <ul class="navbar-nav px-3"> + <li class="nav-item text-nowrap"> + <a class="nav-link" href="#">Sign out</a> + </li> + </ul> + </nav> <div class="container-fluid"> <div class="row"> - <nav class="col-sm-3 col-md-2 d-none d-sm-block bg-light sidebar"> - <ul class="nav nav-pills flex-column"> - <li class="nav-item"> - <a class="nav-link active" href="#">Overview <span class="sr-only">(current)</span></a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">Reports</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">Analytics</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">Export</a> - </li> - </ul> - - <ul class="nav nav-pills flex-column"> - <li class="nav-item"> - <a class="nav-link" href="#">Nav item</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">Nav item again</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">One more nav</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">Another nav item</a> - </li> - </ul> + <nav class="col-md-2 d-none d-md-block bg-light sidebar"> + <div class="sidebar-sticky"> + <ul class="nav flex-column"> + <li class="nav-item"> + <a class="nav-link active" href="#"> + <span data-feather="home"></span> + Dashboard <span class="sr-only">(current)</span> + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#"> + <span data-feather="file"></span> + Orders + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#"> + <span data-feather="shopping-cart"></span> + Products + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#"> + <span data-feather="users"></span> + Customers + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#"> + <span data-feather="bar-chart-2"></span> + Reports + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#"> + <span data-feather="layers"></span> + Integrations + </a> + </li> + </ul> - <ul class="nav nav-pills flex-column"> - <li class="nav-item"> - <a class="nav-link" href="#">Nav item again</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">One more nav</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">Another nav item</a> - </li> - </ul> + <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted"> + <span>Saved reports</span> + <a class="d-flex align-items-center text-muted" href="#"> + <span data-feather="plus-circle"></span> + </a> + </h6> + <ul class="nav flex-column mb-2"> + <li class="nav-item"> + <a class="nav-link" href="#"> + <span data-feather="file-text"></span> + Current month + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#"> + <span data-feather="file-text"></span> + Last quarter + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#"> + <span data-feather="file-text"></span> + Social engagement + </a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#"> + <span data-feather="file-text"></span> + Year-end sale + </a> + </li> + </ul> + </div> </nav> - <main role="main" class="col-sm-9 ml-sm-auto col-md-10 pt-3"> - <h1>Dashboard</h1> - - <section class="row text-center placeholders"> - <div class="col-6 col-sm-3 placeholder"> - <img src="data:image/gif;base64,R0lGODlhAQABAIABAAJ12AAAACwAAAAAAQABAAACAkQBADs=" width="200" height="200" class="img-fluid rounded-circle" alt="Generic placeholder thumbnail"> - <h4>Label</h4> - <div class="text-muted">Something else</div> - </div> - <div class="col-6 col-sm-3 placeholder"> - <img src="data:image/gif;base64,R0lGODlhAQABAIABAADcgwAAACwAAAAAAQABAAACAkQBADs=" width="200" height="200" class="img-fluid rounded-circle" alt="Generic placeholder thumbnail"> - <h4>Label</h4> - <span class="text-muted">Something else</span> - </div> - <div class="col-6 col-sm-3 placeholder"> - <img src="data:image/gif;base64,R0lGODlhAQABAIABAAJ12AAAACwAAAAAAQABAAACAkQBADs=" width="200" height="200" class="img-fluid rounded-circle" alt="Generic placeholder thumbnail"> - <h4>Label</h4> - <span class="text-muted">Something else</span> + <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4"> + <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom"> + <h1 class="h2">Dashboard</h1> + <div class="btn-toolbar mb-2 mb-md-0"> + <div class="btn-group mr-2"> + <button class="btn btn-sm btn-outline-secondary">Share</button> + <button class="btn btn-sm btn-outline-secondary">Export</button> + </div> + <button class="btn btn-sm btn-outline-secondary dropdown-toggle"> + <span data-feather="calendar"></span> + This week + </button> </div> - <div class="col-6 col-sm-3 placeholder"> - <img src="data:image/gif;base64,R0lGODlhAQABAIABAADcgwAAACwAAAAAAQABAAACAkQBADs=" width="200" height="200" class="img-fluid rounded-circle" alt="Generic placeholder thumbnail"> - <h4>Label</h4> - <span class="text-muted">Something else</span> - </div> - </section> + </div> + + <canvas class="my-4" id="myChart" width="900" height="380"></canvas> <h2>Section title</h2> <div class="table-responsive"> - <table class="table table-striped"> + <table class="table table-striped table-sm"> <thead> <tr> <th>#</th> @@ -258,5 +261,43 @@ <script>window.jQuery || document.write('<script src="../../../../assets/js/vendor/jquery-slim.min.js"><\/script>')</script> <script src="../../../../assets/js/vendor/popper.min.js"></script> <script src="../../../../dist/js/bootstrap.min.js"></script> + + <!-- Icons --> + <script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script> + <script> + feather.replace() + </script> + + <!-- Graphs --> + <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script> + <script> + var ctx = document.getElementById("myChart"); + var myChart = new Chart(ctx, { + type: 'line', + data: { + labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + datasets: [{ + data: [15339, 21345, 18483, 24003, 23489, 24092, 12034], + lineTension: 0, + backgroundColor: 'transparent', + borderColor: '#007bff', + borderWidth: 4, + pointBackgroundColor: '#007bff' + }] + }, + options: { + scales: { + yAxes: [{ + ticks: { + beginAtZero: false + } + }] + }, + legend: { + display: false, + } + } + }); + </script> </body> </html> |
