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
| <!-- Todo Header -->
| <template id="todo-header">
| <div class="todo-header">
| <div class="overlay"></div>
| <time class="clearfix">
| <span class="day">{{ date }}</span>
| <span class="dayofweek">{{ weekDay }}</span>
| <span class="month">{{ month }}, {{ year }}</span>
| </time>
| <div class="add-circle" @click="add">
| <i class="fa fa-plus"></i>
| </div>
| </div>
| </template>
|
| <script>
| // Array of Month
| const month = [
| "January",
| "February",
| "Mach",
| "April",
| "May",
| "June",
| "July",
| "August",
| "September",
| "October",
| "November",
| "September"
| ];
| const weekday = [
| "Sunday",
| "Monday",
| "Tuesday",
| "Wednesday",
| "Thursday",
| "Friday",
| "Saturday"
| ];
|
| export default {
| name: "Header",
| props: {
| name: String
| },
| data: function() {
| return {
| date: "",
| weekDay: "",
| month: "",
| year: ""
| };
| },
| created: function() {
| const d = new Date();
| this.date = d.getDate();
| this.weekDay = weekday[d.getDay()];
| this.month = month[d.getMonth()];
| this.year = d.getFullYear();
| }
| };
| </script>
|
| <!-- Add "scoped" attribute to limit CSS to this component only -->
| <style scoped lang="scss">
| // https://github.com/tatthien/vue-todo/blob/master/src/sass/style.scss
| @import "../scss/custom.scss";
| // .clearfix {
| // overflow: auto;
| // zoom: 1;
| // }
| .todo-header {
| border-radius: 6px 6px 0 0;
| background: url($header_image) no-repeat;
| background-size: cover;
| padding: 55px 20px;
| position: relative;
| .overlay {
| position: absolute;
| top: 0;
| left: 0;
| right: 0;
| bottom: 0;
| background: rgba(0,0,0,0.2); /* fallback for old browsers */
| //background: -webkit-linear-gradient(to left, rgba(85,98,112,0.5) , rgba(255,107,107,0.5)); /* Chrome 10-25, Safari 5.1-6 */
| //background: linear-gradient(to left, rgba(85,98,112,0.5) , rgba(255,107,107,0.5)); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
| border-radius: 6px 6px 0 0;
| }
| time {
| color: white;
| display: block;
| position: relative;
| .day {
| font-size: 4em;
| float: left;
| margin-right: 10px;
| }
| .dayofweek {
| display: block;
| margin-top: 13px;
| font-size: 1.4em;
| font-weight: 700;
| }
| }
| }
| </style>
|
|