-
Notifications
You must be signed in to change notification settings - Fork 2
/
FloorAction.vue
75 lines (66 loc) · 1.48 KB
/
FloorAction.vue
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
<template>
<section class="floor-action">
<div class="timestamp">
<span>{{time}}</span>
</div>
<div class="action">
<span v-html="action.description"></span>
<ul class="sub-actions">
<li v-for="sa in action.sub_actions" :key="sa.timestamp" class="sub-action" v-html="sa.description"></li>
</ul>
</div>
</section>
</template>
<script>
import moment from 'moment-timezone'
export default {
name: 'FloorAction',
props: {
action: Object
},
computed: {
time () {
const validStr = this.action.timestamp.substr(0, this.action.timestamp.length - 6)
let d = new Date(validStr)
return moment(d.getTime()).format('h:mm a')
}
}
}
</script>
<style lang="scss" scoped>
@import "~assets/styles/colors";
.timestamp {
grid-area: time;
color: $black;
font-weight: bold;
}
.action {
grid-area: action;
}
.floor-action {
display: grid;
grid-template-columns: 80px auto;
grid-template-rows: auto;
grid-template-areas: "time action";
margin-bottom: 16px;
margin-left: -24px;
padding: 12px 8px;
background-color: $white;
color: $blue;
border-left: 24px solid $blue;
font-family: 'Merriweather';
box-shadow: 0 4px 8px -3px rgba(0, 0, 0, 0.4);
transition: all 0.2s ease-out;
&:hover {
box-shadow: 0 4px 12px -3px rgba(0, 0, 0, 0.8);
border-left: 28px solid $blue;
margin-left: -28px;
}
}
.sub-action {
padding: 4px 0;
font-size: 14px;
list-style-type: square;
color: $blue;
}
</style>