-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtile-box.html
51 lines (50 loc) · 2 KB
/
tile-box.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
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<polymer-element name="tile-box" attributes="color width height borderColor image titleText titleColor titleBoxColor">
<template>
<style>
:host {
display: block;
}
</style>
<div vertical layout
style="background-color:{{color}};margin:5px;width:{{width}}px;height:{{height}}px;border: 3px solid {{borderColor}};">
<div flex auto relative vertical layout>
<div flex three auto relative>
<div fit>
<div relative style="height: 100%">
<img src="{{image}}"
style="max-width: 100%;max-height: 100%;display: block;margin:0 auto">
</div>
</div>
</div>
<div flex horizontal layout center style="background:{{titleBoxColor}}">
<div flex style="text-align: center">
<span style="color: {{titleColor}}">{{titleText}}</span>
</div>
<core-icon-button icon="forward" style="display: block" on-click={{onClick}}"></core-icon-button>
</div>
</div>
</div>
</template>
<script>
Polymer( {
ready: function() {
console.log("ready");
},
color: "white",
width: 400,
height: 200,
borderColor: "#444444",
image: "",
titleText: "",
titleColor: "black",
titleBoxColor: "#4e9ee7",
onClick: function(event, detail, sender) {
this.fire('open', {event: event, detail: detail, sender: sender});
}
});
</script>
</polymer-element>