|
| 1 | +<!DOCTYPE html> |
| 2 | +<!-- |
| 3 | + Copyright 2018 Google Inc. |
| 4 | +
|
| 5 | + Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | + of this software and associated documentation files (the "Software"), to deal |
| 7 | + in the Software without restriction, including without limitation the rights |
| 8 | + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 9 | + copies of the Software, and to permit persons to whom the Software is |
| 10 | + furnished to do so, subject to the following conditions: |
| 11 | +
|
| 12 | + The above copyright notice and this permission notice shall be included in |
| 13 | + all copies or substantial portions of the Software. |
| 14 | +
|
| 15 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 21 | + THE SOFTWARE. |
| 22 | +--> |
| 23 | +<html> |
| 24 | + <head> |
| 25 | + <meta charset="utf-8"> |
| 26 | + <title>Dismissible Drawer - Material Components Catalog</title> |
| 27 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 28 | + <link rel="icon" type="image/png" href="/images/logo_components_color_2x_web_48dp.png"> |
| 29 | + <link rel="stylesheet" href="/assets/drawer/drawer.css"> |
| 30 | + <link rel="stylesheet" href="/assets/radio.css"> |
| 31 | + <script src="/ready.js"></script> |
| 32 | + <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono"> |
| 33 | + <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"> |
| 34 | + <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> |
| 35 | + </head> |
| 36 | + <body class="mdc-typography demo-body"> |
| 37 | + <aside id="demo-drawer" class="mdc-drawer mdc-drawer--dismissible mdc-drawer--open demo-drawer"> |
| 38 | + <div class="mdc-drawer__header"> |
| 39 | + <h3 class="mdc-drawer__title">Mail</h3> |
| 40 | + <h6 class="mdc-drawer__subtitle">email@material.io</h6> |
| 41 | + </div> |
| 42 | + <div class="mdc-drawer__content"> |
| 43 | + <nav class="mdc-list"> |
| 44 | + <a class="mdc-list-item mdc-list-item--activated" href="#" aria-selected="true" tabindex="0"> |
| 45 | + <i class="material-icons mdc-list-item__graphic" aria-hidden="true">inbox</i> |
| 46 | + Inbox |
| 47 | + </a> |
| 48 | + <a class="mdc-list-item" href="#"> |
| 49 | + <i class="material-icons mdc-list-item__graphic" aria-hidden="true">star</i> |
| 50 | + Star |
| 51 | + </a> |
| 52 | + <a class="mdc-list-item" href="#"> |
| 53 | + <i class="material-icons mdc-list-item__graphic" aria-hidden="true">send</i> |
| 54 | + Sent Mail |
| 55 | + </a> |
| 56 | + <a class="mdc-list-item" href="#"> |
| 57 | + <i class="material-icons mdc-list-item__graphic" aria-hidden="true">drafts</i> |
| 58 | + Drafts |
| 59 | + </a> |
| 60 | + |
| 61 | + <hr class="mdc-list-divider"> |
| 62 | + <h6 class="mdc-list-group__subheader">Labels</h6> |
| 63 | + <a class="mdc-list-item" href="#"> |
| 64 | + <i class="material-icons mdc-list-item__graphic" aria-hidden="true">bookmark</i> |
| 65 | + Family |
| 66 | + </a> |
| 67 | + <a class="mdc-list-item" href="#"> |
| 68 | + <i class="material-icons mdc-list-item__graphic" aria-hidden="true">bookmark</i> |
| 69 | + Friends |
| 70 | + </a> |
| 71 | + <a class="mdc-list-item" href="#"> |
| 72 | + <i class="material-icons mdc-list-item__graphic" aria-hidden="true">bookmark</i> |
| 73 | + Work |
| 74 | + </a> |
| 75 | + |
| 76 | + <hr class="mdc-list-divider"> |
| 77 | + <a class="mdc-list-item" href="#"> |
| 78 | + <i class="material-icons mdc-list-item__graphic" aria-hidden="true">settings</i> |
| 79 | + Settings |
| 80 | + </a> |
| 81 | + <a class="mdc-list-item" href="#"> |
| 82 | + <i class="material-icons mdc-list-item__graphic" aria-hidden="true">announcement</i> |
| 83 | + Help & feedback |
| 84 | + </a> |
| 85 | + </nav> |
| 86 | + </div> |
| 87 | + </aside> |
| 88 | + <div class="demo-content mdc-drawer-app-content" id="demo-content"> |
| 89 | + <header class="mdc-top-app-bar demo-top-app-bar" id="app-bar"> |
| 90 | + <div class="mdc-top-app-bar__row"> |
| 91 | + <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start"> |
| 92 | + <a href="#" class="demo-menu material-icons mdc-top-app-bar__navigation-icon">menu</a> |
| 93 | + <span class="mdc-top-app-bar__title">Dismissible Drawer</span> |
| 94 | + </section> |
| 95 | + <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" role="toolbar"> |
| 96 | + <a href="#" class="material-icons mdc-top-app-bar__action-item" aria-label="Download" alt="Download">file_download</a> |
| 97 | + </section> |
| 98 | + </div> |
| 99 | + </header> |
| 100 | + |
| 101 | + <main class="demo-main" id="demo-main"> |
| 102 | + <div class="mdc-top-app-bar--fixed-adjust"></div> |
| 103 | + <h1 class="mdc-typography--headline4">Dismissible Drawer</h1> |
| 104 | + <p class="mdc-typography--body1">It sits to the left of this content. Currently active destination: <strong class="demo-selected-destination">Inbox</strong></p> |
| 105 | + |
| 106 | + <div id="demo-radio-buttons"> |
| 107 | + <div class="mdc-form-field"> |
| 108 | + <div class="mdc-radio"> |
| 109 | + <input class="mdc-radio__native-control" type="radio" id="theme-radio-default" name="theme" checked> |
| 110 | + <div class="mdc-radio__background"> |
| 111 | + <div class="mdc-radio__outer-circle"></div> |
| 112 | + <div class="mdc-radio__inner-circle"></div> |
| 113 | + </div> |
| 114 | + </div> |
| 115 | + <label for="theme-radio-default">Default</label> |
| 116 | + </div> |
| 117 | + <div class="mdc-form-field"> |
| 118 | + <div class="mdc-radio"> |
| 119 | + <input class="mdc-radio__native-control" type="radio" id="theme-radio-custom" name="theme"> |
| 120 | + <div class="mdc-radio__background"> |
| 121 | + <div class="mdc-radio__outer-circle"></div> |
| 122 | + <div class="mdc-radio__inner-circle"></div> |
| 123 | + </div> |
| 124 | + </div> |
| 125 | + <label for="theme-radio-custom">Custom Theme</label> |
| 126 | + </div> |
| 127 | + <div class="mdc-form-field"> |
| 128 | + <div class="mdc-radio"> |
| 129 | + <input class="mdc-radio__native-control" type="radio" id="theme-radio-accessible" name="theme"> |
| 130 | + <div class="mdc-radio__background"> |
| 131 | + <div class="mdc-radio__outer-circle"></div> |
| 132 | + <div class="mdc-radio__inner-circle"></div> |
| 133 | + </div> |
| 134 | + </div> |
| 135 | + <label for="theme-radio-accessible">Accessible Theme</label> |
| 136 | + </div> |
| 137 | + </div> |
| 138 | + |
| 139 | + <div class="extra-content-wrapper"> |
| 140 | + <button type="button" class="mdc-button mdc-button--outlined mdc-button--dense demo-toolbar-example-heading__rtl-toggle-button">Toggle RTL</button> |
| 141 | + </div> |
| 142 | + <div class="extra-content-wrapper"> |
| 143 | + <button id="toggle-wide" class="mdc-button mdc-button--outlined mdc-button--dense">Toggle extra-wide content</button> |
| 144 | + <div id="extra-wide-content" class="mdc-elevation--z2"> </div> |
| 145 | + </div> |
| 146 | + <div class="extra-content-wrapper"> |
| 147 | + <button id="toggle-tall" class="mdc-button mdc-button--outlined mdc-button--dense">Toggle extra-tall content</button> |
| 148 | + <div id="extra-tall-content" class="mdc-elevation--z2"> </div> |
| 149 | + </div> |
| 150 | + </main> |
| 151 | + </div> |
| 152 | + |
| 153 | + <script src="/assets/material-components-web.js" async></script> |
| 154 | + <script> |
| 155 | + demoReady(function() { |
| 156 | + var extraWide = document.querySelector('#extra-wide-content'); |
| 157 | + extraWide.style.display = 'none'; |
| 158 | + document.querySelector('#toggle-wide').addEventListener('click', function() { |
| 159 | + extraWide.style.display = extraWide.style.display ? '' : 'none'; |
| 160 | + }); |
| 161 | + var extraTall = document.querySelector('#extra-tall-content'); |
| 162 | + extraTall.style.display = 'none'; |
| 163 | + document.querySelector('#toggle-tall').addEventListener('click', function() { |
| 164 | + extraTall.style.display = extraTall.style.display ? '' : 'none'; |
| 165 | + }); |
| 166 | + |
| 167 | + var drawerEl = document.getElementById('demo-drawer'); |
| 168 | + var drawer = new mdc.drawer.MDCDrawer(drawerEl); |
| 169 | + var radioEl = document.querySelector('#demo-radio-buttons'); |
| 170 | + radioEl.addEventListener('change', function(e) { |
| 171 | + drawerEl.classList.remove('demo-drawer--custom'); |
| 172 | + drawerEl.classList.remove('demo-drawer--accessible'); |
| 173 | + |
| 174 | + if(e.target.id === 'theme-radio-custom') { |
| 175 | + drawerEl.classList.add('demo-drawer--custom'); |
| 176 | + } else if(e.target.id === 'theme-radio-accessible') { |
| 177 | + drawerEl.classList.add('demo-drawer--accessible'); |
| 178 | + } |
| 179 | + }); |
| 180 | + |
| 181 | + var rtlToggleBtn = document.querySelector('.demo-toolbar-example-heading__rtl-toggle-button'); |
| 182 | + rtlToggleBtn.addEventListener('click', function(event) { |
| 183 | + document.body.setAttribute('dir', document.body.getAttribute('dir') === 'rtl' ? 'ltr' : 'rtl'); |
| 184 | + }); |
| 185 | + |
| 186 | + var topAppBarEl = document.getElementById('app-bar'); |
| 187 | + var topAppBar = new mdc.topAppBar.MDCTopAppBar(topAppBarEl); |
| 188 | + var mainEl = document.getElementById('demo-main'); |
| 189 | + topAppBar.setScrollTarget(mainEl); |
| 190 | + topAppBar.listen('MDCTopAppBar:nav', function() { |
| 191 | + drawer.open = !drawer.open; |
| 192 | + }); |
| 193 | + |
| 194 | + var listEl = drawerEl.querySelector('.mdc-list'); |
| 195 | + var selectedDestinationEl = document.querySelector('.demo-selected-destination'); |
| 196 | + var mainEl = document.querySelector('.demo-main'); |
| 197 | + listEl.addEventListener('click', function(event) { |
| 198 | + selectedDestinationEl.textContent = event.target.lastChild.textContent; |
| 199 | + mainEl.querySelector('input').focus(); |
| 200 | + }); |
| 201 | + document.body.addEventListener('MDCDrawer:closed', function() { |
| 202 | + mainEl.querySelector('input').focus(); |
| 203 | + }); |
| 204 | + }); |
| 205 | + </script> |
| 206 | + </body> |
| 207 | +</html> |
0 commit comments