-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdemo.html
182 lines (179 loc) · 6.18 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!doctype html>
<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<html>
<head>
<title>app-widgets</title>
<script src="bower_components/platform/platform.js"></script>
<meta name="viewport" content="width=device-width, user-scalable=yes, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0">
<meta name="mobile-web-app-capable" content="yes">
<link rel="import" href="app-widgets.html">
<link rel="import" href="bower_components/font-roboto/roboto.html">
<link rel="import" href="bower_components/core-toolbar/core-toolbar.html">
<link rel="import" href="bower_components/core-icon-button/core-icon-button.html">
<link rel="import" href="bower_components/core-icons/core-icons.html">
<link rel="import" href="bower_components/paper-item/paper-item.html">
<link rel="import" href="bower_components/paper-button/paper-button.html">
<link rel="import" href="bower_components/core-menu/core-menu.html">
<link rel="import" href="bower_components/paper-menu-button/paper-menu-button.html">
<link rel="import" href="bower_components/core-icons/iconsets/communication-icons.html">
<script src="data.js"></script>
<style>
body {
-webkit-user-select: none;
font-family: "RobotoDraft",Helvetica,Arial,sans-serif;
font-weight: 300;
line-height: 24px;
}
</style>
</head>
<body class="polymer-ui-body-text" unresolved>
<polymer-element name="app-demo">
<template>
<style>
#messages {
background-color: darkgrey;
}
.padding-wrapper {
padding: 60px 0;
flex-shrink: 0;
}
.item {
box-sizing: border-box;
overflow: hidden;
background-color: white;
}
.conversation {
height: 80px; /* Make sure this value lines up with app-list.height */
display: flex;
border-bottom: 1px solid lightgray;
}
.avatar {
display: flex;
flex-shrink: 0;
color: white;
align-items: center;
justify-content: center;
font-size: 40px;
width: 50px;
height: 50px;
margin: 10px;
background-color: lightblue;
}
.summary {
flex: 1;
flex-shrink: 0;
display: flex;
flex-direction: column;
padding: 10px 10px 10px 0px;
}
.topline {
display: flex;
flex-shrink: 0;
}
.participants {
flex: 1;
flex-shrink: 0;
font-weight: bold;
}
.time {
flex-shrink: 0;
font-size: 12px;
color: #444;
}
.bottomline {
flex-shrink: 0;
display: flex;
}
.preview {
flex: 1;
flex-shrink: 0;
font-size: 12px;
height: 2em;
text-overflow: ellipsis;
}
.subject {
font-weight: bold;
}
.snippet {
color: #444;
}
.trinkets {
flex-shrink: 0;
font-size: 20px;
}
.polymer-ui-dark-theme core-icon-button {
fill: #C2C2C2;
}
</style>
<app-frame>
<core-toolbar>
<paper-button icon="menu" on-tap="{{ toggleMenu }}"></paper-button>
<div flex>Demo app</div>
<paper-button icon="refresh"></paper-button>
<paper-menu-button icon="add" valign="bottom" halign="right">
<paper-item icon="dialog" label="Ojan"></paper-item>
<paper-item icon="dialog" label="Elliott"></paper-item>
<paper-item icon="dialog" label="Chris"></paper-item>
<paper-item icon="settings" label="Settings"></paper-item>
</paper-menu-button>
</core-toolbar>
<app-column>
<app-list id="messages">
<app-dismissable-list class="padding-wrapper" on-dismiss-items="{{ dismissItem }}">
<template repeat>
<app-dismissable-item class="item conversation" id="{{ id }}">
<div class="avatar" style="background-color: {{ avatarColor }}">{{ avatarLetter }}</div>
<div class="summary">
<div class="topline">
<div class="participants">{{ participants }}</div>
<div class="time">{{ time }}</div>
</div>
<div class="bottomline">
<div class="preview"><span class="subject">{{ subject }}</span> —
<span class="snippet">{{ snippet }}</span></div>
<div class="trinkets">☆</div>
</div>
</div>
</app-dismissable-item>
</template>
</app-dismissable-list>
</app-list>
<app-scrollarea-toolbar for="messages">
<core-toolbar>
<paper-button icon="add" flex></paper-button>
<paper-button icon="sort" flex></paper-button>
<paper-button icon="google-plus" flex></paper-button>
</core-toolbar>
</app-scrollarea-toolbar>
<app-drawer id="nav-drawer">
<core-menu selected="0" active="false">
<template repeat="{{ item in menuItems }}">
<paper-item icon="{{ item.icon }}" label="{{ item.label }}"></paper-item>
</template>
</core-menu>
</app-drawer>
</app-column>
</app-frame>
</template>
<script>
Polymer('app-demo', {
menuItems: fakeDrawerData,
toggleMenu: function() {
// Ideally, we'd delay inflating the model for the drawer until now.
// this.menuItems = fakeDrawerData;
this.$['nav-drawer'].toggle();
},
dismissItem: function(event) {
var dataProvider = event.target.parentElement.data;
dataProvider.deleteItemByIds(event.detail.items.map(function(item) { return item.id; }));
},
});
</script>
</polymer-element>
<app-demo></app-demo>
</body>
</html>