12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
- <link rel="import" href="../../bower_components/paper-styles/paper-styles.html">
- <link rel="import" href="buddy-avatar.html">
- <link rel="import" href="personal-avatar.html">
- <dom-module id="buddy-finder">
- <template>
- <style>
- :host {
- background-color: transparent;
- @apply(--layout-fit);
- @apply(--layout-horizontal);
- @apply(--layout-center-center);
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- margin: 0;
- --paper-tooltip: {
- font-size: 14px;
- background-color: #4285f4;
- }
- }
-
- .buddies {
- z-index: 1;
- @apply(--layout-horizontal);
- @apply(--layout-center-center);
- @apply(--layout-wrap);
- }
-
- .buddy {
- cursor: pointer;
- }
-
- .explanation {
- @apply(--paper-font-headline);
- color: #4285f4;
- text-align: center;
- cursor: default;
- }
-
- .short {
- font-size: 14px;
- line-height: 20px;
- color: #727272;
- }
-
- .short a {
- color: #4285f4;
- text-decoration: none;
- }
-
- .explanation:hover a {
- transform: scale(1.1);
- }
-
- @media all and (max-width: 600px) {
- .explanation {
- width: 340px;
- }
- }
-
- </style>
- <div class="buddies">
- <template is="dom-repeat" items="{{buddies}}">
- <buddy-avatar on-file-selected="_fileSelected" only$="{{!buddies.1}}" contact="{{item}}" class="buddy"></buddy-avatar>
- </template>
- </div>
- <div hidden$="{{buddies.0}}" class="explanation">
- Open Snapdrop on other devices to send files.
- <div class="short">
- Short link: <a href="http://yg.gl" target="_blank">yg.gl</a>
- </div>
- </div>
- <personal-avatar class="me"></personal-avatar>
- </template>
- <script>
- 'use strict';
- Polymer({
- is: 'buddy-finder',
- properties: {
- buddies: {
- type: Array,
- notify: true
- },
- me: {
- type: String,
- },
- },
- _fileSelected: function(e) {
- var peerId = e.model.item.peerId;
- var file = e.detail;
- app.conn.sendFile(peerId, file);
- }
- });
- </script>
- </dom-module>
|