-
Notifications
You must be signed in to change notification settings - Fork 0
/
x-person.html
45 lines (44 loc) · 1.04 KB
/
x-person.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
<link rel="import" href="bower_components/polymer/polymer.html">
<polymer-element name="x-person" attributes="name image date_of_birth">
<template>
<style>
.photo-container {
height: 100px;
width: 100px;
overflow: hidden;
border-radius: 100%;
display: block;
margin: auto;
}
.photo {
width: 100px;
}
.info {
flex: 1;
margin: auto 10px;
}
.content {
display: flex;
height: 100px;
}
</style>
<div class="content">
<div class="photo-container">
<img class="photo" src="{{image}}" />
</div>
<div class="info">
<h2>{{name}}</h2>
<div>{{date_of_birth}}</div>
</div>
</div>
</template>
<script>
Polymer({
imageChanged: function(oldValue, newValue) {
if (newValue === "") {
this.image = "https://lh3.googleusercontent.com/-MsNtvUT1r64/AAAAAAAAAAI/AAAAAAAAAAA/uDXDAEKafXI/photo.jpg";
}
}
});
</script>
</polymer-element>