-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
182 lines (161 loc) · 7.1 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
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
<!DOCTYPE html>
<html lang="bn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- External Styles -->
<link rel="stylesheet" href="/css/index.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://kit.fontawesome.com/94b68a0c09.js" crossorigin="anonymous"></script>
<!-- Google Font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto+Serif+Bengali:wght@300;400;500;600;700&display=swap">
<title>নিরাপত্তা বলয়</title>
<style>
* {
font-family: 'Noto Serif Bengali', serif;
font-weight: 700;
}
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}
.modal {
background: white;
padding: 30px;
border-radius: 10px;
width: 90%;
max-width: 500px;
}
.hidden {
display: none !important;
}
</style>
</head>
<body>
<!-- First-time Setup Overlay -->
<div id="setupOverlay" class="overlay hidden">
<div class="modal">
<h2 class="mb-4">প্রাথমিক সেটআপ</h2>
<form id="userInfoForm">
<div class="mb-3">
<label for="userName" class="form-label">আপনার নাম</label>
<input type="text" class="form-control" id="userName" required>
</div>
<div id="contactsContainer">
<div class="mb-3">
<label class="form-label">জরুরি যোগাযোগের নম্বর #1</label>
<div class="input-group">
<input type="text" class="form-control" placeholder="নাম" required>
<input type="tel" class="form-control" placeholder="ফোন নম্বর" required>
</div>
</div>
</div>
<button type="button" class="btn btn-secondary mb-3" id="addMoreContacts">আরও নম্বর যোগ করুন</button>
<div class="mb-3">
<button type="button" class="btn btn-primary w-100" id="requestLocationBtn">
অবস্থান অনুমতি দিন
</button>
<div id="locationStatus" class="mt-2 text-muted"></div>
</div>
<button type="submit" class="btn btn-success w-100 mt-3">সেভ করুন</button>
</form>
</div>
</div>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg bg-light">
<div class="container-fluid">
<p class="navbar-brand h1 mb-0">নিরাপত্তা বলয়</p>
<div>
<button class="btn btn-primary me-2" id="editContactsBtn"><i class="fa-solid fa-address-book pe-2"></i>জরুরি নম্বর</button>
<button class="btn btn-danger" onclick="location.href='https://himeeeelll.netlify.app';">
<i class="fa-solid fa-circle-info pe-2"></i>বিস্তারিত
</button>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="p-3 mx-auto" style="max-width: 400px;">
<h1 class="fs-1 text-center mb-4">আপনি কোন বিষয়ে সহায়তা চান?</h1>
<div class="container">
<div class="row g-3">
<div class="col-6">
<button class="btn btn-danger w-100 h-100 emergency-btn" data-emergency-type="নির্যাতন প্রতিরোধ">
<i class="fa-3x fa-solid fa-bell"></i> <br> নির্যাতন প্রতিরোধ
</button>
</div>
<div class="col-6">
<button class="btn btn-warning w-100 h-100 emergency-btn" data-emergency-type="সড়ক দুর্ঘটনা">
<i class="fa-3x fa-solid fa-car-burst"></i> <br> সড়ক দুর্ঘটনা
</button>
</div>
<div class="col-8">
<button class="btn btn-primary w-100 h-100 emergency-btn" data-emergency-type="জরুরি অ্যাম্বুলেন্স সেবা">
<i class="fa-3x fa-solid fa-truck-medical"></i> <br> জরুরি অ্যাম্বুলেন্স সেবা
</button>
</div>
<div class="col-4">
<button class="btn btn-danger w-100 h-100 emergency-btn" data-emergency-type="অগ্নিকাণ্ড">
<i class="fa-3x fa-solid fa-fire-extinguisher"></i>
</button>
</div>
</div>
</div>
</main>
<!-- Alert Modal -->
<div id="alertModal" class="overlay hidden">
<div class="modal text-center">
<h2 class="mb-4" id="alertTitle">সতর্কতা!</h2>
<p id="alertMessage">আপনার অবস্থান এবং জরুরি তথ্য প্রেরণ করা হয়েছে।</p>
<button class="btn btn-primary mt-3" id="alertCloseBtn">বন্ধ করুন</button>
</div>
</div>
<!-- JavaScript -->
<script>
document.addEventListener('DOMContentLoaded', function() {
if (!localStorage.getItem('userInfo')) {
document.getElementById('setupOverlay').classList.remove('hidden');
}
document.getElementById('addMoreContacts').addEventListener('click', function() {
const contactsContainer = document.getElementById('contactsContainer');
const contactCount = contactsContainer.children.length + 1;
const contactDiv = document.createElement('div');
contactDiv.className = 'mb-3';
contactDiv.innerHTML = `
<label class="form-label">জরুরি যোগাযোগের নম্বর #${contactCount}</label>
<div class="input-group">
<input type="text" class="form-control" placeholder="নাম" required>
<input type="tel" class="form-control" placeholder="ফোন নম্বর" required>
</div>
`;
contactsContainer.appendChild(contactDiv);
});
document.getElementById('requestLocationBtn').addEventListener('click', function() {
const locationStatus = document.getElementById('locationStatus');
locationStatus.textContent = "অনুমতি অনুরোধ করা হচ্ছে...";
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
function() {
locationStatus.textContent = "অবস্থান অনুমতি গৃহীত হয়েছে";
locationStatus.classList.add('text-success');
},
function() {
locationStatus.textContent = "অবস্থান অনুমতি প্রত্যাখ্যান করা হয়েছে";
locationStatus.classList.add('text-danger');
}
);
} else {
locationStatus.textContent = "আপনার ব্রাউজার জিওলোকেশন সমর্থন করে না";
}
});
});
</script>
</body>
</html>