-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitbox-ui.html
124 lines (103 loc) · 2.38 KB
/
gitbox-ui.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
<link rel="import" href="../polymer/polymer-element.html">
<link rel="import" href="../iron-icons/iron-icons.html">
<dom-module id="gitbox-ui">
<template>
<style>
.box {
padding: 10px;
position: relative;
}
.roundBox {
border: 1px solid;
border-color: #d1d5da !important;
border-radius: 10px;
padding: 20px;
width: 300px;
height: 100px;
}
.textBold {
font-weight: 600 !important;
color: #0366d6;
}
.descText {
font-size: 12px !important;
color: #586069 !important;
}
.bottomLeftLayout {
position: absolute;
bottom: 20px;
left: 30px;
font-size: 12px;
color: #586069;
text-align: center;
}
.bottomRightLayout {
position: absolute;
bottom: 20px;
right: 30px;
font-size: 12px;
color: #586069;
text-align: center;
}
.starIcon {
fill: rgba(0,0,0,0);
stroke: black;
width: 14px;
height: 14px;
padding-bottom: 3px;
}
.copyIcon {
width: 16px;
height: 16px;
padding-bottom: 3px;
}
</style>
<div class="box">
<div class="roundBox">
<a href="[[htmlurl]]" class="textBold">[[name]]</a>
<p class=descText>[[desc]]</p>
<p class="bottomLeftLayout">
<span style="margin-right:10px;"> [[language]]</span> <iron-icon class="starIcon" icon="star"></iron-icon> <span>[[starcount]]</span>
</p>
<p class="bottomRightLayout">
<iron-icon id="copy" class="copyIcon" on-click="copy" icon="content-copy"></iron-icon>
</p>
</div>
</div>
</template>
<script>
class GitBoxUi extends Polymer.GestureEventListeners(Polymer.Element) {
constructor() {
super();
//Polymer.Gestures.addListener(this.copy, 'tap', () => this.copy());
}
copy(event) {
window.prompt("Ctrl + C", this.cloneurl);
}
static get is() { return 'gitbox-ui'; }
static get properties() {
return {
desc: {
type: String,
},
name: {
type: String
},
language: {
type: String
},
htmlurl: {
type: String
},
cloneurl: {
type: String
},
starcount: {
type: String
}
};
}
}
window.customElements.define(GitBoxUi.is, GitBoxUi);
</script>
</dom-module>