2015-12-23 13:57:13 +01:00
|
|
|
<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
|
|
|
|
<link rel="import" href="../../bower_components/paper-styles/paper-styles.html">
|
2015-12-30 23:59:11 +01:00
|
|
|
<link rel="import" href="buddy-avatar.html">
|
2015-12-23 13:57:13 +01:00
|
|
|
<link rel="import" href="personal-avatar.html">
|
2015-12-18 17:43:46 +01:00
|
|
|
<dom-module id="buddy-finder">
|
|
|
|
<template>
|
|
|
|
<style>
|
|
|
|
:host {
|
2015-12-23 13:57:13 +01:00
|
|
|
background-color: transparent;
|
2015-12-18 17:43:46 +01:00
|
|
|
@apply(--layout-fit);
|
2015-12-19 01:18:02 +01:00
|
|
|
@apply(--layout-horizontal);
|
2015-12-18 17:43:46 +01:00
|
|
|
@apply(--layout-center-center);
|
2015-12-23 13:57:13 +01:00
|
|
|
-webkit-user-select: none;
|
|
|
|
-moz-user-select: none;
|
|
|
|
-ms-user-select: none;
|
|
|
|
user-select: none;
|
|
|
|
margin: 0;
|
2015-12-30 22:07:18 +01:00
|
|
|
--paper-tooltip: {
|
|
|
|
font-size: 14px;
|
|
|
|
background-color: #4285f4;
|
|
|
|
}
|
2015-12-18 17:43:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.buddies {
|
|
|
|
z-index: 1;
|
2015-12-19 01:18:02 +01:00
|
|
|
@apply(--layout-horizontal);
|
2015-12-23 13:57:13 +01:00
|
|
|
@apply(--layout-center-center);
|
|
|
|
@apply(--layout-wrap);
|
2015-12-18 17:43:46 +01:00
|
|
|
}
|
|
|
|
|
2015-12-23 13:57:13 +01:00
|
|
|
.explanation {
|
|
|
|
@apply(--paper-font-headline);
|
2015-12-30 22:07:18 +01:00
|
|
|
color: #4285f4;
|
2015-12-23 13:57:13 +01:00
|
|
|
text-align: center;
|
2016-01-01 18:06:27 +01:00
|
|
|
cursor: default;
|
2015-12-18 17:43:46 +01:00
|
|
|
}
|
2015-12-30 18:07:37 +01:00
|
|
|
|
|
|
|
.short {
|
2015-12-31 18:31:03 +01:00
|
|
|
font-size: 14px;
|
2016-01-01 18:06:27 +01:00
|
|
|
line-height: 20px;
|
2016-01-01 21:52:41 +01:00
|
|
|
color: #727272;
|
2015-12-31 18:31:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.short a {
|
|
|
|
color: #4285f4;
|
|
|
|
text-decoration: none;
|
2015-12-30 18:07:37 +01:00
|
|
|
}
|
|
|
|
|
2015-12-31 18:31:03 +01:00
|
|
|
.explanation:hover a {
|
|
|
|
transform: scale(1.1);
|
|
|
|
}
|
|
|
|
|
|
|
|
@media all and (max-width: 600px) {
|
|
|
|
.explanation {
|
|
|
|
width: 340px;
|
|
|
|
}
|
|
|
|
}
|
2016-01-01 18:06:27 +01:00
|
|
|
|
2016-01-02 14:23:51 +01:00
|
|
|
@media all and (max-height: 440px) {
|
|
|
|
.buddies {
|
|
|
|
padding-top: 48px;
|
|
|
|
@apply(--layout-self-start);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.explanation2 {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media all and (min-height: 640px) {
|
|
|
|
.explanation2 {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
top: 128px;
|
|
|
|
width: 296px;
|
|
|
|
margin-left: -148px;
|
|
|
|
left: 50%;
|
|
|
|
@apply(--paper-font-title);
|
|
|
|
color: #7baaf7;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
}
|
2015-12-18 17:43:46 +01:00
|
|
|
</style>
|
2016-01-02 14:23:51 +01:00
|
|
|
<div class="explanation2" hidden$="{{!buddies.0}}">
|
|
|
|
Tap to send File.<br>Long Press to send Text.
|
|
|
|
</div>
|
2015-12-18 17:43:46 +01:00
|
|
|
<div class="buddies">
|
|
|
|
<template is="dom-repeat" items="{{buddies}}">
|
2016-01-02 14:23:51 +01:00
|
|
|
<buddy-avatar on-file-selected="_fileSelected" only$="{{!buddies.1}}" contact="{{item}}"></buddy-avatar>
|
2015-12-18 17:43:46 +01:00
|
|
|
</template>
|
|
|
|
</div>
|
2015-12-26 13:33:16 +01:00
|
|
|
<div hidden$="{{buddies.0}}" class="explanation">
|
2015-12-31 18:31:03 +01:00
|
|
|
Open Snapdrop on other devices to send files.
|
|
|
|
<div class="short">
|
|
|
|
Short link: <a href="http://yg.gl" target="_blank">yg.gl</a>
|
|
|
|
</div>
|
2015-12-23 13:57:13 +01:00
|
|
|
</div>
|
|
|
|
<personal-avatar class="me"></personal-avatar>
|
2015-12-18 17:43:46 +01:00
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
'use strict';
|
|
|
|
Polymer({
|
|
|
|
is: 'buddy-finder',
|
|
|
|
properties: {
|
2015-12-23 13:57:13 +01:00
|
|
|
buddies: {
|
|
|
|
type: Array,
|
2015-12-26 13:33:16 +01:00
|
|
|
notify: true
|
2015-12-23 13:57:13 +01:00
|
|
|
},
|
2015-12-18 17:43:46 +01:00
|
|
|
me: {
|
|
|
|
type: String,
|
2015-12-26 13:33:16 +01:00
|
|
|
},
|
2015-12-19 01:18:02 +01:00
|
|
|
},
|
2015-12-23 13:57:13 +01:00
|
|
|
_fileSelected: function(e) {
|
2015-12-19 01:18:02 +01:00
|
|
|
var peerId = e.model.item.peerId;
|
|
|
|
var file = e.detail;
|
2015-12-31 02:23:39 +01:00
|
|
|
app.conn.sendFile(peerId, file);
|
2015-12-18 17:43:46 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</dom-module>
|