-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
103 lines (90 loc) · 3.73 KB
/
index.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
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Note master</title>
<!-- Bootstrap CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.1/vue.js'></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.3/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.title{
color : mediumspringgreen
}
.mybtn{
background-color: mediumspringgreen;
color: white;
border: transparent;
font-size: 18px;
font-weight: bold;
}
.mynote{
background: #f3f3f3;
border: 1px solid mediumspringgreen;
border-radius : 10px;
display: inline-block;
margin: 15px;
}
</style>
</head>
<body>
<div id="app" class="container">
<h2 class="text-center title">Note Master</h2>
<form action="" role="form">
<div class="form-group">
<label for="titlenote">Note Title</label>
<input v-model="title" type="text" class="form-control" id="titlenote" placeholder="title ...">
</div>
<div class="form-group">
<label for="textnote">Note Text</label>
<textarea v-model="text" id="textnote" class="form-control" rows="3" required="required"></textarea>
</div>
<div class="form-group text-center">
<button type="button" class="btn btn-default mybtn" @click="addnote">add Note</button>
</div>
</form>
<hr>
<div class="alert mynote " v-for="(item , index) in data">
<button type="button" class="close" @click="removenote(index)" >×</button>
<h3>{{item.title}}</h3>
<hr>
<p class="text-muted">{{item.time}}</p>
<p>{{item.text}}</p>
</div>
</div>
<script>
var app = new Vue({
el : "#app",
data : {
title : "",
text : "",
time : moment().format('MMMM Do YYYY, h:mm:ss a'),
data :[
]
},
methods : {
addnote(){
this.data.push({title:this.title,text:this.text,time:this.time});
this.title = ""
this.text = ""
},
removenote(index){
this.data.splice(index, 1);
}
}
});
</script>
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Bootstrap JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>