~didrocks/+junk/face-detection-15.04

« back to all changes in this revision

Viewing changes to facedetection/www/bower_components/paper-scroll-header-panel/demo/index.html

  • Committer: Didier Roche
  • Date: 2016-05-10 23:09:11 UTC
  • Revision ID: didier.roche@canonical.com-20160510230911-c7xr490zrj3yrzxd
New version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.github.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/CONTRIBUTORS.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/PATENTS.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="../../paper-styles/color.html">
 
26
  <link rel="import" href="../../iron-flex-layout/iron-flex-layout.html">
 
27
  <link rel="import" href="sample-content.html">
 
28
 
 
29
  <link rel="stylesheet" href="../../paper-styles/demo.css">
 
30
 
 
31
  <style is="custom-style">
 
32
 
 
33
    paper-scroll-header-panel {
 
34
      position: absolute;
 
35
      top: 0;
 
36
      right: 0;
 
37
      bottom: 0;
 
38
      left: 0;
 
39
      background-color: var(--paper-grey-200, #eee);
 
40
 
 
41
      /* background for toolbar when it is at its full size */
 
42
      --paper-scroll-header-panel-full-header: {
 
43
        background-image: url(images/bg1.jpg);
 
44
        background-position: left center;
 
45
      };
 
46
 
 
47
      /* background for toolbar when it is condensed */
 
48
      --paper-scroll-header-panel-condensed-header: {
 
49
        background-color: var(--paper-deep-purple-500);
 
50
      };
 
51
    }
 
52
 
 
53
    paper-icon-button {
 
54
      --paper-icon-button-ink-color: white;
 
55
    }
 
56
 
 
57
    paper-toolbar.tall {
 
58
      background-color: transparent;
 
59
    }
 
60
 
 
61
    paper-toolbar.tall .title {
 
62
      font-size: 40px;
 
63
      margin-left: 60px;
 
64
 
 
65
      -webkit-transform-origin: left center;
 
66
      transform-origin: left center;
 
67
    }
 
68
 
 
69
    .content {
 
70
      padding: 8px;
 
71
    }
 
72
 
 
73
    .spacer {
 
74
      @apply(--layout-flex);
 
75
    }
 
76
 
 
77
  </style>
 
78
 
 
79
</head>
 
80
<body unresolved>
 
81
 
 
82
  <paper-scroll-header-panel condenses>
 
83
 
 
84
    <paper-toolbar class="tall">
 
85
      <paper-icon-button icon="arrow-back"></paper-icon-button>
 
86
      <div class="spacer"></div>
 
87
      <paper-icon-button icon="search"></paper-icon-button>
 
88
      <paper-icon-button icon="more-vert"></paper-icon-button>
 
89
      <div class="bottom title">Title</div>
 
90
    </paper-toolbar>
 
91
 
 
92
    <div class="content">
 
93
 
 
94
      <sample-content size="100"></sample-content>
 
95
 
 
96
    </div>
 
97
 
 
98
  </paper-scroll-header-panel>
 
99
 
 
100
  <script>
 
101
 
 
102
    // custom transformation: scale header's title
 
103
    var title = document.querySelector('.title');
 
104
    addEventListener('paper-header-transform', function(e) {
 
105
      var d = e.detail;
 
106
      var m = d.height - d.condensedHeight;
 
107
      var scale = Math.max(0.75, (m - d.y) / (m / 0.25)  + 0.75);
 
108
 
 
109
      Polymer.Base.transform('scale(' + scale + ') translateZ(0)', title);
 
110
    });
 
111
 
 
112
  </script>
 
113
 
 
114
</body>
 
115
</html>