-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContactDisplay.html
More file actions
194 lines (168 loc) · 4.68 KB
/
ContactDisplay.html
File metadata and controls
194 lines (168 loc) · 4.68 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html lang = "en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Contact List</title>
<style>
body{font family: Ariel, Times New Roman, sans-serif;}
/* input fields */
input[type=text], input[type-password]
{
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
/* button styling */
button
{
background-color: #641e16;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 50%;
}
button:hover
{
opacity: 0.8;
}
/* Extra styles for the cancel button */
.cancelbtn
{
width: auto;
padding: 10px 18px;
background-color: #f44336;
}
.container
{
padding: 5px;
position: absolute;
top: 10%;
left: 74%;
transform: translate(-50%, -50%);
height: 40px;
border-radius: 40px;
}
/* The Close Button (x) */
.close
{
position: absolute;
right: 15px;
top: -20px;
color: #000;
font-size: 35px;
font-weight: bold;
}
/* Add Zoom Animation */
.animate
{
-webkit-animation: animatezoom 0.8s;
animation: animatezoom 0.8s
}
@-webkit-keyframes animatezoom
{
from {-webkit-transform: scale(0)}
to {-webkit-transform: scale(1)}
}
@keyframes animatezoom
{
from {transform: scale(0)}
to {transform: scale(1)}
}
.search-box{
position: absolute;
top: 10%;
left: 81%;
transform: translate(-50%, -50%);
height: 40px;
border-radius: 40px;
padding: 10px;
}
.search-box:hover> . search-txt{
width: 240px;
padding: 0 6px;
}
.search-box:hover> . search-btn{
background: white;
}
.search-btn{
float: right;
width: 40px;
height: 40px;
border-radius:50%;
display: flex;
transform: translate(80%,-122%);
justify-content: center;
align-items: center;
transition: 0.4s;
}
.search-txt{
border:none;
background: none;
outline: none;
float: left;
padding:0;
color: white;
font-size: 16px;
transition: 0.4s;
line-height: 40px;
width: 0px;
}
</style>
</head>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<script defer src="https://kit.fontawesome.com/42162c53d9.js"></script>
<title>Awesome Search Box </title>
</head>
<body style="background-image: url('http://sfwallpaper.com/images/zen-stones-wallpaper-11.jpg'); background-repeat: no-repeat; background-position: center; background-size: cover; margin:0; padding-top: 850px;">
<div class="search-box">
<input class="search-text" type="text" name= "" placeholder="Type to search">
<a class= "search-btn" href="#">
<i class="fas fa-search"></i>
</a>
</div>
<div class="container">
<button onclick="myFunction()">Add</button>
<button onclick="myFunction()">Edit</button>
<button onclick="myFunction()">Delete</button>
</div>
<script>
var contacts=[];
function myFunction() {
var x = document.createElement("INPUT");
x.setAttribute("type", "text");
document.body.appendChild(x);
}
function add(){
var Username= document.getElementById("Username or email").value;
var Password= document.getElementById("Password").value;
var newContact= {
newUsername: Username,
newPassword: Password
}
contacts.push(newContact);
updateDiv();
document.getElementById("Username").value="";
document.getElementById("Password").value="";
}
function updateDiv(){
var tempContent="";
for(var i = 0, i < contacts.length; i++)
{
tempContent += "<p>Name : " + contacts[i].newName+
"<br>Password:" + contacts[i].newPassword + "<br><span onclick='del("+ i +")'>[del]</span></p>";
}
document.getElementById("contacts").innerHTML= tempContent;
}
function del(i){
contacts.splice(i,1);
}
</script>
</body>
</html>