-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
93 lines (89 loc) · 3.15 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
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Emails Input</title>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Open Sans', sans-serif;
height: 100%;
font-size: 14px;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}
h1 {
font-weight: 400;
font-size: 1.4em;
margin-bottom: 1em;
}
.form {
margin: 0 auto;
width: 39em;
background: #F8F8F7;
box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.2);
border-radius: 8px;
overflow: hidden;
}
.top {
padding: 2em 3.5em;
}
.emails {
width: 100%;
height: 7em;
background: #eee;
}
.buttons {
background: #fff;
padding: 2em 3.5em;
}
.buttons button {
font-size: inherit;
border: none;
background: #4262FF;
border-radius: 6px;
padding: 0.7em 1em;
color: #fff;
}
.buttons button:first-child {
margin-right: 1em;
}
</style>
</head>
<body>
<div class="form">
<div class="top">
<h1>Share <strong>Board name</strong> with others</h1>
<div class="emails">
<div id="emails-input" class="EmailsInput-themed"></div>
</div>
</div>
<div class="buttons">
<button id="add" class="button">Add email</button>
<button id="get-count" class="button">Get emails count</button>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Initialize input
var inputContainerNode = document.querySelector('#emails-input');
var emailsInput = EmailsInput(inputContainerNode);
// Add button
var addButtonNode = document.querySelector('#add');
addButtonNode.addEventListener('click', function() {
var randomName = Math.random().toString(36).substring(7);
emailsInput.addValue(randomName + '@gmail.com');
});
// Count button
var getCountNode = document.querySelector('#get-count');
getCountNode.addEventListener('click', function() {
var validValues = emailsInput.getValidValues();
alert('Number of valid values: ' + validValues.length);
});
});
</script>
</body>
</html>