-
Notifications
You must be signed in to change notification settings - Fork 1
/
alto-timeline.html
157 lines (130 loc) · 5.04 KB
/
alto-timeline.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-icon/iron-icon.html">
<!--
@license
Copyright 2017 Aleksandar Toshovski
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<!--
`alto-timeline`
An element used to visualize the timeline
`alto-timeline` is an element which visualizes Timelines.
An element used to visualize the timeline.
'alto-timeline' contains the following parameters:
<ul>
<li> title: The title is shown on the left of the timeline
<li> icon: icon, shown inside the timeline circle
<li> status: progress and done
</ul>
Mixins to change the base
Custom property | Description | Default
----------------|-------------|----------
`--standard-timeline` | The color for standard status | #2196f3;
`--progress-timeline` | The color for progress status | #ff9800;
`--done-timeline` | The color for done status | #93383b;
`--timeline-time` | Mixin for the time part| {}
`--timeline-title` | Mixin for the title part| {}
`--timeline-text` | Mixin for the text part | {}
@demo demo/index.html
-->
<dom-module id="alto-timeline">
<template>
<style>
:host {
display: block;
--standard-timeline: #2196f3;
--progress-timeline: #ff9800;
--done-timeline: #93383b;
}
.standard {
background-color: var(--standard-timeline);
}
.done {
background-color: var(--done-timeline) !important;
}
.progress {
background-color: var(--progress-timeline) !important;
}
.row {
display: flex;
flex-flow: row;
align-items: stretch;
}
.circle {
width: 30px;
height: 30px;
background: var(--standard-timeline);;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
iron-icon {
--iron-icon-height: 16px;
--iron-icon-width: 16px;
}
.line {
margin-left: 13px;
padding: 2px;
background-color: var(--standard-timeline);
}
.time {
margin-right: 1rem;
height: 30px;
width: 15ch;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: large;
@apply(--timeline-time);
}
.title {
margin-left: 1rem;
text-transform: uppercase;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
font-size: medium;
@apply(--timeline-title);
}
.textContent {
margin-left: 2rem;
padding: 5px;
@apply(--timeline-text);
}
</style>
<div class="row">
<div class="time">[[time]]</div>
<div>
<div class="row">
<div class$="circle [[status]]">
<iron-icon class="icon" icon="[[icon]]" alt$="[[title]]" style="fill:white;"></iron-icon>
</div>
<div>
<div class="title">[[title]]</div>
</div>
</div>
<div class="row">
<div class$="line [[status]]"></div>
<div class="textContent">
<content></content>
</div>
</div>
</div>
<div>
</div>
</div>
<!--div id="text">[[text]]</div> -->
</template>
<script>
Polymer({
is: 'alto-timeline',
properties: {},
});
</script>
</dom-module>