-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtc.html
140 lines (139 loc) · 5.08 KB
/
tc.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Trusted Contacts</title>
<link rel="stylesheet" href="css/tc.css"><script src="https://kit.fontawesome.com/95346ea11f.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="navbar">
<div class="dropdown">
<button class="dropbtn">
<i class="fa-sharp fa-solid fa-bars"></i>
</button>
<div class="dropdown-content">
<a href="home.html">HOME</a>
<a href="pre-sos.html">PRE-SOS</a>
<a href="tc.html">CONTACT</a>
</div>
</div>
</div>
<div class="contact">
<div class="main">
<i class="fa-solid fa-address-book"></i><a>Emergency contact</a><button class="but" id="show-login">Add</button>
</div>
<br>
<div class="out">
<h1>Your Contacts</h1>
<br>
<table class="tab">
<tr>
<th>
Name
</th>
<th>
Contacts
</th>
</tr>
<tr>
<td id="n1"></td>
<td id="p1"></td>
</tr>
<tr>
<td id="n2"></td>
<td id="p2"></td>
</tr>
<tr>
<td id="n3"></td>
<td id="p3"></td>
</tr>
</table>
</div>
<div class="popup">
<div class="close-btn">×</div>
<div class="form">
<h1>Add to Contacts</h1>
<div class="form-element">
<label for="Name">Name</label>
<input type="text" id="nn" placeholder="Name" required>
</div>
<div class="form-element">
<label for="Phone number">Phone number:</label>
<input type="tel" id="pp" placeholder="+91 6374628655" required>
</div>
<div class="form-element">
<a type="submit" id="btn1" value="Click Me" onclick="input()">Submit</a>
</div>
</div>
</div>
<div class="foot">
<center>
<ul>
<li class="min"><a onclick=" pg(0)" href="pre-sos.html"><i class="fa-solid fa-triangle-exclamation" style="color: black;"></i></a></li>
<li class="min"><a onclick=" pg(1)"><i class="fa-solid fa-location-dot" style="color: black;"></i></a></li>
<li class="min"><a onclick=" pg(2)" href="home.html"><i class="fa-solid fa-house" style="color: black"></i></a></li>
<li class="min"><a onclick=" pg(4)" href="news.html"><i class="fa-solid fa-circle-info" style="color: black;"></i></a></li>
<li class="min"><a onclick=" pg(3)" href="user.html"><i class="fa-solid fa-gear" style="color: black;"></i></a></li>
</ul>
</center>
</div>
<script>
function takevalue(){
var name = document.getElementById("name").value;
document.write("Name : " + name);
}
var n1 = " ";
var n2 = " ";
var n3 = " ";
var p1 = " ";
var p2 = " ";
var p3 = " ";
function change(){
var nn1 = document.getElementById('n1');
var nn2 = document.getElementById('n2');
var nn3 = document.getElementById('n3');
var pp2 = document.getElementById('p1');
var pp2 = document.getElementById('p2');
var pp3 = document.getElementById('p3');
nn1.innerHTML = n1;
nn2.innerHTML = n2;
nn3.innerHTML = n3;
pp1.innerHTML = p1;
pp2.innerHTML = p2;
pp3.innerHTML = p3;
document.querySelector(".popup").classList.remove("active");
}
function input(){
var a = document.getElementById('nn').value;
var b = document.getElementById('pp').value;
if(n1 == ""){
n1 = a;
p1 = b;
change();
console.log(a,b);
}
else{
if(n2 != ""){
n1 = a;
p1 = b;
change();
}
else{
n1 = a;
p1 = b;
change();
}
}
}
</script>
<script>
document.querySelector("#show-login").addEventListener("click",function(){
document.querySelector(".popup").classList.add("active")
});
document.querySelector(".popup .close-btn").addEventListener("click",function(){
document.querySelector(".popup").classList.remove("active")
});
</script>
</body>
</html>