-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparking.html
More file actions
203 lines (187 loc) · 7.42 KB
/
Copy pathparking.html
File metadata and controls
203 lines (187 loc) · 7.42 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
195
196
197
198
199
200
201
202
203
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Find Parking - AI Parking System</title>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
#map {
height: 400px;
width: 100%;
margin-top: 20px;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.leaflet-popup-content {
text-align: center;
}
.parking-info {
display: flex;
justify-content: space-between;
margin-top: 10px;
}
.parking-availability {
font-weight: bold;
color: #4CAF50;
}
.parking-details {
background-color: #f0f0f0;
padding: 10px;
border-radius: 5px;
margin-top: 10px;
}
</style>
</head>
<body>
<header>
<h1>🚓 Tamil Nadu Police Smart Parking System</h1>
<nav>
<ul>
<li><a href="./index.html">Home</a></li>
<li><a href="./parking.html">Find Parking</a></li>
<li><a href="./police.html">Police Dashboard</a></li>
<li><a href="./about.html">About</a></li>
<li><a href="./contact.html">Contact</a></li>
<li><a href="https://trafficpolice-x4hfuhhvzyypxm3jqbsnsg.streamlit.app/">Weather Prediction</a></li>
</ul>
</nav>
</header>
<section class="parking-search">
<h2>Find Parking Near Your Destination</h2>
<p>Enter your destination to check parking availability.</p>
<form action="/find_parking" method="post" id="parkingForm">
<label for="destination">Enter Destination :</label>
<input type="string" id="destination" name="destination" required>
<label for="hour">Enter Time (Hour):</label>
<input type="number" id="hour" name="hour" required min="0" max="24">
<div class="parking-info">
<span>Estimated Parking Time:</span>
<span id="estimatedTime">-</span>
</div>
<a href="https://parkmap-jbkmt3nbdakdv96kgr77nf.streamlit.app/" type="submit" class="btn">Find Parking</a>
</form>
<div class="result">
<h3>Parking Availability: 50</h3>
<p>Suggested Alternative Parking Locations:</p>
<li>🅿 Parking Lot 2 - Available</li>
<li>🅿 Parking Lot 3 - Available</li>
</div>
</section>
<section class="map-section">
<h3>🗺 Parking Locations Map</h3>
<div id="map"></div>
<div class="parking-details">
<h4>Parking Location Details</h4>
<div id="parkingDetails">Select a parking spot on the map for more information</div>
</div>
</section>
<section class="transport-options">
<h3>🚍 How to Reach Your Destination</h3>
<p>If your parking spot is far, you can use:</p>
<ul>
<li>🚌 Public Transport (Bus, Metro)</li>
<li>🚕 Auto-rickshaw</li>
<li>🚶 Walking Routes</li>
</ul>
</section>
<footer>
<p>© 2025 Tamil Nadu Police Smart Parking System. All Rights Reserved.</p>
</footer>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script>
// Map initialization
var map = L.map('map').setView([13.0827, 80.2707], 13);
// Load OpenStreetMap tiles
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map);
// Enhanced parking locations with more details
var parkingSpots = [
{
name: "Parking Lot 1",
lat: 13.0827,
lon: 80.2707,
totalSpots: 100,
availableSpots: 50,
type: "Multi-level Parking",
rates: {
hourly: "₹20",
daily: "₹200"
}
},
{
name: "Parking Lot 2",
lat: 13.0700,
lon: 80.2500,
totalSpots: 75,
availableSpots: 30,
type: "Street Parking",
rates: {
hourly: "₹15",
daily: "₹150"
}
},
{
name: "Parking Lot 3",
lat: 13.0600,
lon: 80.2400,
totalSpots: 50,
availableSpots: 20,
type: "Underground Parking",
rates: {
hourly: "₹25",
daily: "₹250"
}
}
];
// Custom parking icon
var parkingIcon = L.divIcon({
className: 'custom-div-icon',
html: "<div style='background-color:#4CAF50;' class='marker-pin'></div><i class='fas fa-parking awesome'>",
iconSize: [30, 42],
iconAnchor: [15, 42]
});
// Add markers with enhanced popups
parkingSpots.forEach(function(spot) {
var marker = L.marker([spot.lat, spot.lon], {icon: parkingIcon})
.addTo(map)
.bindPopup(`
<b>${spot.name}</b><br>
Total Spots: ${spot.totalSpots}<br>
Available: ${spot.availableSpots}<br>
Type: ${spot.type}<br>
Hourly Rate: ${spot.rates.hourly}<br>
Daily Rate: ${spot.rates.daily}
`)
.on('click', function() {
document.getElementById('parkingDetails').innerHTML = `
<h5>${spot.name} Details</h5>
<p><strong>Total Spots:</strong> ${spot.totalSpots}</p>
<p><strong>Available Spots:</strong> ${spot.availableSpots}</p>
<p><strong>Parking Type:</strong> ${spot.type}</p>
<div class="parking-rates">
<p><strong>Rates:</strong></p>
<p>Hourly: ${spot.rates.hourly}</p>
<p>Daily: ${spot.rates.daily}</p>
</div>
`;
});
});
// Form interaction for estimated parking time
document.getElementById('parkingForm').addEventListener('input', function() {
var hours = document.getElementById('hour').value;
var estimatedTimeElem = document.getElementById('estimatedTime');
if (hours) {
var currentTime = new Date();
currentTime.setHours(currentTime.getHours() + parseInt(hours));
estimatedTimeElem.textContent = currentTime.toLocaleTimeString();
} else {
estimatedTimeElem.textContent = '-';
}
});
</script>
</body>
</html>