-
Notifications
You must be signed in to change notification settings - Fork 0
/
hour_picker.vue
87 lines (83 loc) · 1.64 KB
/
hour_picker.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
76
77
78
79
80
81
82
83
84
85
86
87
<template>
<div class="container">
<vue-timepicker
:minute-interval="15"
v-model="model[0]"
></vue-timepicker>
<vue-timepicker
:minute-interval="15"
v-model="model[1]"
></vue-timepicker>
<button @click="allday">
<img class="icon" src="../assets/allday.png" />
</button>
</div>
</template>
<script>
import VueTimepicker from "vue2-timepicker";
import "vue2-timepicker/dist/VueTimepicker.css";
export default {
name: "HourPicker",
components: {
VueTimepicker,
},
props: {
model: {
type: Array,
required: true,
},
},
methods: {
allday: function() {
this.model[0] = "00:00";
this.model[1] = "00:00";
this.$forceUpdate();
},
},
};
</script>
<style lang="scss" scoped>
.container {
@extend .shadow_box;
margin: 10px;
padding: 5px;
align-self: baseline;
display: flex;
align-items: center;
background-color: white;
}
button {
background-image: linear-gradient(135deg, nth($greens, 1), nth($greens, 2));
border-radius: 25px;
border: none;
margin-left: 5px;
padding: 10px 15px;
&:active img {
animation: scale 0.1s;
animation-iteration-count: infinite;
}
img {
width: 30px;
height: 30px;
}
}
</style>
<style lang="scss">
.vue__time-picker input.display-time {
border-radius: 20px;
border-width: 0;
padding: 0;
font-weight: 900;
margin-left: 15px;
background-color: transparent;
}
.vue__time-picker .dropdown {
border-radius: 20px;
top: calc(2.2em + 25px);
}
.vue__time-picker .dropdown ul li:not([disabled]).active,
.vue__time-picker .dropdown ul li:not([disabled]).active:focus,
.vue__time-picker .dropdown ul li:not([disabled]).active:hover {
background-color: nth($greens, 1);
}
</style>