1<!doctype html> 2<!-- 3@license 4Copyright (c) 2015 The Polymer Project Authors. All rights reserved. 5This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 6The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 7The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 8Code distributed by Google as part of the polymer project is also 9subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 10--> 11<html lang="en"> 12<head> 13 <title>paper-card demo</title> 14 <meta charset="utf-8"> 15 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 16 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> 17 18 <script src="../../webcomponentsjs/webcomponents-lite.js"></script> 19 20 <link rel="import" href="../../iron-demo-helpers/demo-snippet.html"> 21 <link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html"> 22 23 <link rel="import" href="../../iron-collapse/iron-collapse.html"> 24 <link rel="import" href="../../iron-icons/iron-icons.html"> 25 <link rel="import" href="../../iron-icons/communication-icons.html"> 26 <link rel="import" href="../../iron-icons/hardware-icons.html"> 27 <link rel="import" href="../../iron-icons/social-icons.html"> 28 <link rel="import" href="../../iron-flex-layout/iron-flex-layout.html"> 29 <link rel="import" href="../../paper-button/paper-button.html"> 30 <link rel="import" href="../../paper-checkbox/paper-checkbox.html"> 31 <link rel="import" href="../../paper-icon-button/paper-icon-button.html"> 32 <link rel="import" href="../../paper-styles/color.html"> 33 <link rel="import" href="../../paper-styles/typography.html"> 34 <link rel="import" href="../paper-card.html"> 35 36 <style is="custom-style" include="demo-pages-shared-styles"> 37 demo-snippet { 38 --demo-snippet-demo: { 39 background: var(--paper-grey-200); 40 padding: 8px; 41 }; 42 --demo-snippet-code: { 43 max-height: 300px; 44 }; 45 } 46 47 paper-card { 48 width: 100%; 49 } 50 51 .horizontal { 52 @apply(--layout-horizontal); 53 } 54 55 .justified { 56 @apply(--layout-justified); 57 } 58 59 .amber { 60 background: var(--paper-amber-900); 61 } 62 63 .lime { 64 background: var(--paper-lime-500); 65 } 66 67 .cyan { 68 background: var(--paper-cyan-500); 69 } 70 71 .dark { 72 background: var(--paper-blue-grey-500); 73 } 74 paper-card.dark, paper-card.amber, paper-card.lime, paper-card.cyan { 75 color: white; 76 --paper-card-header-color: white; 77 } 78 79 paper-checkbox { 80 display: block; 81 margin-bottom: 4px; 82 --paper-checkbox-label-color: white; 83 --paper-checkbox-unchecked-color: white; 84 } 85 86 paper-icon-button { 87 color: var(--paper-grey-600); 88 } 89 90 paper-icon-button.white { 91 color: white !important; 92 } 93 </style> 94 95</head> 96<body unresolved> 97 <body unresolved> 98 <div class="vertical-section-container centered"> 99 <h3>A paper-card with a simple heading, header image, body content, and actions</h3> 100 <demo-snippet> 101 <template> 102 <paper-card heading="Emmental" image="http://placehold.it/350x150/FFC107/000000"> 103 <div class="card-content"> 104 Emmentaler or Emmental is a yellow, medium-hard cheese that originated in the area around Emmental, Switzerland. It is one of the cheeses of Switzerland, and is sometimes known as Swiss cheese. 105 </div> 106 <div class="card-actions"> 107 <paper-button>Share</paper-button> 108 <paper-button>Explore!</paper-button> 109 </div> 110 </paper-card> 111 </template> 112 </demo-snippet> 113 114 <h3>Paper-cards can contain advanced content</h3> 115 <demo-snippet> 116 <template> 117 <style is="custom-style"> 118 .cafe-header { @apply(--paper-font-headline); } 119 .cafe-light { color: var(--paper-grey-600); } 120 .cafe-location { 121 float: right; 122 font-size: 15px; 123 vertical-align: middle; 124 } 125 .cafe-reserve { color: var(--google-blue-500); } 126 iron-icon.star { 127 --iron-icon-width: 16px; 128 --iron-icon-height: 16px; 129 color: var(--paper-amber-500); 130 } 131 iron-icon.star:last-of-type { color: var(--paper-grey-500); } 132 </style> 133 <paper-card image="./donuts.png"> 134 <div class="card-content"> 135 <div class="cafe-header">Cafe Basilico 136 <div class="cafe-location cafe-light"> 137 <iron-icon icon="communication:location-on"></iron-icon> 138 <span>250ft</span> 139 </div> 140 </div> 141 <div class="cafe-rating"> 142 <iron-icon class="star" icon="star"></iron-icon> 143 <iron-icon class="star" icon="star"></iron-icon> 144 <iron-icon class="star" icon="star"></iron-icon> 145 <iron-icon class="star" icon="star"></iron-icon> 146 <iron-icon class="star" icon="star"></iron-icon> 147 </div> 148 <p>$・Italian, Cafe</p> 149 <p class="cafe-light">Small plates, salads & sandwiches in an intimate setting with 12 indoor seats plus patio seating.</p> 150 </div> 151 <div class="card-actions"> 152 <p>Tonight's availability</p> 153 <div class="horizontal justified"> 154 <paper-icon-button icon="icons:event"></paper-icon-button> 155 <paper-button>5:30PM</paper-button> 156 <paper-button>7:30PM</paper-button> 157 <paper-button>9:00PM</paper-button> 158 </div> 159 <paper-button class="cafe-reserve">Reserve</paper-button> 160 </div> 161 </paper-card> 162 </template> 163 </demo-snippet> 164 165 <h3>Paper-cards can have a horizontal image</h3> 166 <demo-snippet> 167 <template> 168 <style is="custom-style"> 169 paper-card.rate { @apply(--layout-horizontal); } 170 .rate-image { 171 width: 100px; 172 height: 170px; 173 background: url('./donuts.png'); 174 background-size: cover; 175 } 176 .rate-content { 177 @apply(--layout-flex); 178 float: left; 179 } 180 .rate-header { @apply(--paper-font-headline); } 181 .rate-name { color: var(--paper-grey-600); margin: 10px 0; } 182 paper-icon-button.rate-icon { 183 --iron-icon-fill-color: white; 184 --iron-icon-stroke-color: var(--paper-grey-600); 185 } 186 </style> 187 <paper-card class="rate"> 188 <div class="rate-content"> 189 <div class="card-content"> 190 <div class="rate-header">Rate this album</div> 191 <div class="rate-name">Mac Miller</div> 192 <div>Live from space</div> 193 </div> 194 <div class="card-actions"> 195 <paper-icon-button class="rate-icon" icon="star"></paper-icon-button> 196 <paper-icon-button class="rate-icon" icon="star"></paper-icon-button> 197 <paper-icon-button class="rate-icon" icon="star"></paper-icon-button> 198 <paper-icon-button class="rate-icon" icon="star"></paper-icon-button> 199 <paper-icon-button class="rate-icon" icon="star"></paper-icon-button> 200 </div> 201 </div> 202 <div class="rate-image"></div> 203 </paper-card> 204 </template> 205 </demo-snippet> 206 207 <h3>Paper-cards can have expanded supporting text</h3> 208 <demo-snippet> 209 <template> 210 <paper-card heading="Top western road trips" image="./trip.png" class="white"> 211 <div class="card-content">1,000 miles of wonder</div> 212 <div class="card-actions"> 213 <paper-button>Share</paper-button> 214 <paper-button>Explore</paper-button> 215 <paper-icon-button 216 icon="hardware:keyboard-arrow-up" 217 title="more info" 218 onclick="_toggle()" 219 style="float:right;"> 220 </paper-icon-button> 221 <iron-collapse id="more-info" style="width:100%;"> 222 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent enim ante, tempus eget volutpat ac, cursus ac ante. Nulla facilisi. Praesent sed lacinia ligula. Donec malesuada nisl eget quam iaculis, vel placerat justo cursus. 223 </iron-collapse> 224 <script> 225 function _toggle() { 226 var moreInfo = document.getElementById('more-info'); 227 var iconButton = Polymer.dom(event).localTarget; 228 iconButton.icon = moreInfo.opened ? 'hardware:keyboard-arrow-up' 229 : 'hardware:keyboard-arrow-down'; 230 moreInfo.toggle(); 231 } 232 </script> 233 </div> 234 </paper-card> 235 </template> 236 </demo-snippet> 237 238 <h3>Paper-cards can be organized in different collections</h3> 239 240 <h3>Same layout, different content</h3> 241 <demo-snippet> 242 <template> 243 <style is="custom-style"> 244 paper-card.white { 245 --paper-card-header-color: #fff; 246 } 247 </style> 248 <paper-card heading="Pre-fab homes" image="./house.png" class="white" style="margin-bottom:8px;"> 249 <div class="card-actions"> 250 <paper-icon-button icon="favorite"></paper-icon-button> 251 <paper-icon-button icon="bookmark"></paper-icon-button> 252 <paper-icon-button icon="social:share"></paper-icon-button> 253 </div> 254 </paper-card> 255 <div class="horizontal"> 256 <paper-card heading="Favorite trips" image="./trip.png" class="white" style="margin-right:4px;"> 257 <div class="card-actions horizontal justified"> 258 <paper-icon-button icon="favorite"></paper-icon-button> 259 <paper-icon-button icon="bookmark"></paper-icon-button> 260 <paper-icon-button icon="social:share"></paper-icon-button> 261 </div> 262 </paper-card> 263 <paper-card heading="Best airlines" image="./travel.png" class="white" style="margin-left:4px;"> 264 <div class="card-actions horizontal justified"> 265 <paper-icon-button icon="favorite"></paper-icon-button> 266 <paper-icon-button icon="bookmark"></paper-icon-button> 267 <paper-icon-button icon="social:share"></paper-icon-button> 268 </div> 269 </paper-card> 270 </div> 271 </template> 272 </demo-snippet> 273 274 <h3>Different layout and content</h3> 275 <demo-snippet> 276 <template> 277 <style is="custom-style"> 278 #notes { 279 @apply(--layout-vertical); 280 @apply(--layout-wrap); 281 height: 344px; 282 width: 384px; 283 } 284 285 #notes > paper-card { 286 box-sizing: border-box; 287 max-width: 184px; 288 margin: 4px; 289 flex: 0 0 auto; 290 } 291 </style> 292 <div id="notes"> 293 <paper-card heading="Call Jennifer" class="cyan"> 294 <div class="card-actions"> 295 <paper-icon-button icon="communication:call" style="color:white;"></paper-icon-button> 296 <span>March 19, 2017</span> 297 </div> 298 </paper-card> 299 <paper-card class="dark"> 300 <div class="card-content"> 301 <p>Groceries:</p> 302 <paper-checkbox>almond milk</paper-checkbox> 303 <paper-checkbox>coconut water</paper-checkbox> 304 <paper-checkbox>cheese</paper-checkbox> 305 <paper-checkbox>green apples</paper-checkbox> 306 </div> 307 <div class="card-actions"> 308 <paper-icon-button icon="communication:location-on" style="color:white"></paper-icon-button> 309 <span>Campbell</span> 310 </div> 311 </paper-card> 312 <paper-card heading="clean desk" class="lime"></paper-card> 313 <paper-card image="./donuts.png" class="amber"> 314 <div class="card-content">New cafe opened on Valencia St.</div> 315 </paper-card> 316 <paper-card heading="Yuna tickets on sale 6/24" class="cyan"> 317 </paper-card> 318 </div> 319 </template> 320 </demo-snippet> 321 </div> 322</body> 323</html> 324