-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaccount.html
164 lines (142 loc) · 4.52 KB
/
account.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html lang="en">
<head>
<title>TouchBase</title>
<script type="text/javascript" src="js/code.js"></script>
<link href="css/styles.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>
<body>
<div id="particles-js"></div>
<style>
.circular-button {
position: absolute;
display:inline-block;
width: 60px;
height: 60px;
border-radius: 50%;
overflow: hidden;
border: none;
padding: 1%;
margin: 0;
z-index: 10;
}
.circular-button img {
width: 100%;
height: 100%;
object-fit: cover;
z-index: 10;
}
.circular-button:focus {
outline: black;
}
</style>
<div id="loggedInDiv">
<div class="message">
<h1 id="userName"></h1>
</div>
<div class="image-container-login"></div>
<a href="index.html" class="circular-button">
<img src="./images/TB.png" alt="centerimage">
</a>
</div>
<div class="searchbox">
<a href="#" class="search-icon">
<i class="fas fa-search"></i>
</a>
<input type="text" id="searchText" placeholder="Who would you like to TouchBase with?">
</div>
<div class="logOut">
<button class="logoutButton" type="button" id="logoutButton" onclick="doLogout();">
<i class="fas fa-sign-out-alt"></i>
</button>
<span></span>
</div>
<button class="addcontactButton" type="button" id="addcontactButton" onclick="showForm();">
<i class="fas fa-user-plus"></i>
</button>
<div id="contactForm" style="display: none;"> <!-- Initial state is hidden -->
<h2 class="formtitle">New Connection</h2>
<input type="text" id="first-Name" placeholder="First Name" required>
<input type="text" id="last-Name" placeholder="Last Name" required>
<input type="text" id="emailAddress" placeholder="Email Address" required>
<input type="text" id="phoneNumber" placeholder="Phone Number"
onfocus="togglePhoneNumberRequirements(true)"
onblur="togglePhoneNumberRequirements(false)"
oninput="validatePhoneNumber()" />
<div id="buttonDiv">
<button type="button" onclick="onclickAdd()">
<i class="fas fa-check" id="checkbtn"></i>
</button>
<button type="button" onclick="hideForm()">
<i class="fa-solid fa-xmark" id="cancelbtn"></i>
</button>
</div>
<div id="phoneDiv">
<ul id="phoneNumberRequirements" style="display: none;">
<li id="digitsLength" data-text="At least 10 digits" class="invalid">
<i class="fa-solid fa-xmark"></i> At least 10 digits
</li>
<li id="hasDigits" data-text="Only digits are allowed" class="invalid">
<i class="fa-solid fa-xmark"></i> Only digits are allowed
</li>
</ul>
</div>
<!-- <div id="contactAddResult"></div> -->
</div>
<!--
<div id="accessUIDiv">
</div>
-->
<!-- Table to Display Contacts -->
<div></div>
<div class="table-container">
<table>
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Phone</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="contactTableBody">
<!-- New contacts will be dynamically added here -->
</tbody>
</table>
</div>
<!-- Delete Confirmation Modal -->
<div id="deleteConfirmationModal" class="modal" style="display:none;">
<div class="modal-content">
<p>Are you sure you want to delete the contact?</p>
<button id="confirmDelete" onclick="confirmDeleteContact();">Yes</button>
<button id="cancelDelete" onclick="cancelDeleteContact();">No</button>
</div>
</div>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function(){
readCookie();
loadContacts();
}, false);
// Add the scroll trap script to stop the page from moving when reaching the top or bottom of the table
document.querySelector('tbody').addEventListener('wheel', function(event) {
var element = this;
var scrollTop = element.scrollTop;
var scrollHeight = element.scrollHeight;
var offsetHeight = element.offsetHeight;
var deltaY = event.deltaY;
if (
(scrollTop === 0 && deltaY < 0) ||
(scrollTop + offsetHeight >= scrollHeight && deltaY > 0)
) {
event.preventDefault();
}
});
</script>
<script src="js/particles.js"></script>
<script src="js/app.js"></script>
</body>
</html>