| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <!-- |
| 3 @license |
| 4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 8 Code distributed by Google as part of the polymer project is also |
| 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 <title>paper-scroll-header-panel: demo6</title> |
| 14 |
| 15 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-
scale=1.0, user-scalable=yes"> |
| 16 <meta name="mobile-web-app-capable" content="yes"> |
| 17 <meta name="apple-mobile-web-app-capable" content="yes"> |
| 18 |
| 19 <script src="../../webcomponentsjs/webcomponents-lite.js"></script> |
| 20 |
| 21 <link rel="import" href="../paper-scroll-header-panel.html"> |
| 22 <link rel="import" href="../../paper-toolbar/paper-toolbar.html"> |
| 23 <link rel="import" href="../../iron-icons/iron-icons.html"> |
| 24 <link rel="import" href="../../paper-icon-button/paper-icon-button.html"> |
| 25 <link rel="import" href="sample-content.html"> |
| 26 |
| 27 <link rel="stylesheet" href="../../paper-styles/demo.css"> |
| 28 |
| 29 <style is="custom-style"> |
| 30 |
| 31 paper-scroll-header-panel { |
| 32 position: absolute; |
| 33 top: 0; |
| 34 right: 0; |
| 35 bottom: 0; |
| 36 left: 0; |
| 37 background-color: var(--paper-grey-200, #eee); |
| 38 |
| 39 /* background for toolbar when it is at its full size */ |
| 40 --paper-scroll-header-panel-full-header: { |
| 41 background-image: url(images/bg6.jpg); |
| 42 }; |
| 43 |
| 44 /* background for toolbar when it is condensed */ |
| 45 --paper-scroll-header-panel-condensed-header: { |
| 46 background-image: url(images/bg2.jpg); |
| 47 }; |
| 48 } |
| 49 |
| 50 paper-toolbar.tall { |
| 51 /* custom toolbar height */ |
| 52 height: 256px; |
| 53 background-color: transparent; |
| 54 } |
| 55 |
| 56 paper-toolbar.tall .title { |
| 57 font-size: 40px; |
| 58 margin-left: 60px; |
| 59 |
| 60 -webkit-transform-origin: left center; |
| 61 transform-origin: left center; |
| 62 |
| 63 /* Issue #15 */ |
| 64 isolation: isolate; |
| 65 } |
| 66 |
| 67 paper-toolbar.tall iron-icon { |
| 68 margin: 0 8px; |
| 69 } |
| 70 |
| 71 .content { |
| 72 padding: 8px; |
| 73 } |
| 74 |
| 75 </style> |
| 76 |
| 77 </head> |
| 78 <body> |
| 79 |
| 80 <!-- By default condensedHeaderHeight is 1/3 of the header's height. Here |
| 81 we want to set the condensed header's height to be 64px. --> |
| 82 <paper-scroll-header-panel condenses header-height="256" condensed-header-heig
ht="64"> |
| 83 |
| 84 <paper-toolbar class="tall"> |
| 85 |
| 86 <paper-icon-button icon="arrow-back"></paper-icon-button> |
| 87 <div class="flex"></div> |
| 88 <paper-icon-button icon="search"></paper-icon-button> |
| 89 <paper-icon-button icon="more-vert"></paper-icon-button> |
| 90 <div class="bottom title">Title</div> |
| 91 |
| 92 </paper-toolbar> |
| 93 |
| 94 <div class="content"> |
| 95 |
| 96 <sample-content size="100"></sample-content> |
| 97 |
| 98 </div> |
| 99 |
| 100 </paper-scroll-header-panel> |
| 101 |
| 102 <script> |
| 103 |
| 104 // custom transformation: scale header's title |
| 105 var title = document.querySelector('.title'); |
| 106 addEventListener('paper-header-transform', function(e) { |
| 107 var d = e.detail; |
| 108 var m = d.height - d.condensedHeight; |
| 109 var scale = Math.max(0.75, (m - d.y) / (m / 0.25) + 0.75); |
| 110 |
| 111 Polymer.Base.transform('scale(' + scale + ') translateZ(0)', title); |
| 112 }); |
| 113 |
| 114 </script> |
| 115 |
| 116 </body> |
| 117 </html> |
| OLD | NEW |