-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhospital locator.html
More file actions
102 lines (92 loc) · 2.68 KB
/
hospital locator.html
File metadata and controls
102 lines (92 loc) · 2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Hospital Locator - Heal Connect</title>
<link rel="stylesheet" href="style.css" />
<style>
/* Base styles for full height layout */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
/* Wrapper takes full height and controls layout */
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}
main {
flex: 1;
}
.location-button {
text-align: center;
margin-top: 20px;
}
.location-button button {
padding: 10px 20px;
background-color: #3b776b;
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
cursor: pointer;
}
.location-button button:hover {
background-color: #2f5d54;
}
</style>
</head>
<body>
<header>
<h1>Heal Connect</h1>
<p>Your Trusted Health Friend</p>
<nav>
<a href="index.html">Home</a>
<a href="remedies.html">Natural Remedies</a>
<a href="fitness.html">Fitness</a>
<a href="hospital locator.html">Hospital Locator</a>
<a href="diet plans.html">Diet Plans</a>
<a href="schemes.html">Medical Schemes</a>
<a href="women care.html">Women Care</a>
<a href="emergency tips.html">Emergency Tips</a>
<a href="skin care.html">Skincare Tips</a>
<a href="games.html">Games</a>
<a href="record.html">Health Record</a>
</nav>
</header>
<main>
<section class="intro">
<h2>Find Nearby Hospitals</h2>
<p>Click the button below to detect your location and view nearby hospitals directly in Google Maps.</p>
</section>
<div class="location-button">
<button onclick="redirectToGoogleMaps()">Show Hospitals Near Me</button>
</div>
</main>
<footer>
© 2025 Heal Connect. All Rights Reserved.
</footer>
<script>
function redirectToGoogleMaps() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
function (position) {
const lat = position.coords.latitude;
const lng = position.coords.longitude;
const mapsURL = `https://www.google.com/maps/search/hospitals/@${lat},${lng},15z`;
window.open(mapsURL, '_blank');
},
function () {
alert("Unable to access location. Please allow location access.");
}
);
} else {
alert("Geolocation is not supported by this browser.");
}
}
</script>
</body>
</html>