| 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: demo4</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-color: var(--paper-deep-orange-500, #ff5722); |
| 47 }; |
| 48 } |
| 49 |
| 50 paper-toolbar.tall { |
| 51 background-color: transparent; |
| 52 } |
| 53 |
| 54 paper-toolbar.tall .title { |
| 55 font-size: 40px; |
| 56 margin-left: 60px; |
| 57 |
| 58 -webkit-transform-origin: left center; |
| 59 transform-origin: left center; |
| 60 |
| 61 /* Issue #15 */ |
| 62 isolation: isolate; |
| 63 } |
| 64 |
| 65 paper-toolbar.tall iron-icon { |
| 66 margin: 0 8px; |
| 67 } |
| 68 |
| 69 .content { |
| 70 padding: 8px; |
| 71 } |
| 72 |
| 73 </style> |
| 74 |
| 75 </head> |
| 76 <body unresolved> |
| 77 |
| 78 <paper-scroll-header-panel condenses> |
| 79 |
| 80 <paper-toolbar class="tall"> |
| 81 |
| 82 <paper-icon-button icon="arrow-back"></paper-icon-button> |
| 83 <div class="flex"></div> |
| 84 <paper-icon-button icon="search"></paper-icon-button> |
| 85 <paper-icon-button icon="more-vert"></paper-icon-button> |
| 86 <div class="bottom title">Title</div> |
| 87 |
| 88 </paper-toolbar> |
| 89 |
| 90 <div class="content"> |
| 91 |
| 92 <sample-content size="100"></sample-content> |
| 93 |
| 94 </div> |
| 95 |
| 96 </paper-scroll-header-panel> |
| 97 |
| 98 <script> |
| 99 |
| 100 // custom transformation: scale header's title |
| 101 var title = document.querySelector('.title'); |
| 102 addEventListener('paper-header-transform', function(e) { |
| 103 var d = e.detail; |
| 104 var m = d.height - d.condensedHeight; |
| 105 var scale = Math.max(0.75, (m - d.y) / (m / 0.25) + 0.75); |
| 106 |
| 107 Polymer.Base.transform('scale(' + scale + ') translateZ(0)', title); |
| 108 }); |
| 109 |
| 110 </script> |
| 111 |
| 112 </body> |
| 113 </html> |
| OLD | NEW |