-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
57 lines (53 loc) · 1.95 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
<html>
<head>
<title>jQUery Toaster</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="toaster.js"></script>
</head>
<body>
<br>
<div class="container">
<div class="row">
<div class="col-md-2">
<input type="text" class="form-control" id="text-content" placeholder="text">
</div>
<div class="col-md-2">
<b>Color:</b>
<input type="color" id="color" placeholder="color">
</div>
<div class="col-md-2">
<b>Background:</b>
<input type="color" id="background" placeholder="background">
</div>
<div class="col-md-2">
<input type="text" class="form-control" id="horizontal" placeholder="Horizontal position">
</div>
<div class="col-md-2">
<input type="text" class="form-control" id="vertical" placeholder="Vertical position">
</div>
</div>
<br>
<button onclick="toast()" class="btn btn-primary">Toast it</button>
</div>
<div id="id"></div>
<script>
function toast() {
var text = $("#text-content").val();
var color = $("#color").val();
var background = $("#background").val();
var horizontal = $("#horizontal").val();
var vertical = $("#vertical").val();
var toaster = new Toaster({
'text': text,
'color': color,
'background': background,
'verticalPosition': vertical,
'horizontalPosition': horizontal,
'container': '#id'
});
toaster.publish();
}
</script>
</body>
</html>