jake2004 commited on
Commit
f7c28d8
·
verified ·
1 Parent(s): 8de71e4

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +144 -24
index.html CHANGED
@@ -1,41 +1,161 @@
1
  <!DOCTYPE html>
2
- <html>
3
  <head>
4
- <title>Store Placement Analysis Tool</title>
5
- <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
6
- integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obscp+WJc="
7
- crossorigin=""/>
8
- <link rel="stylesheet" href="style.css">
9
  <style>
10
- #map {
11
- height: 500px;
12
- width: 100%;
 
 
 
 
13
  }
14
- #drop-area {
15
- border: 2px dashed #ccc;
16
- padding: 20px;
 
 
 
17
  text-align: center;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  cursor: pointer;
19
- margin-bottom: 20px;
20
  }
21
- #drop-area.highlight {
22
- border-color: green;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
24
  </style>
25
  </head>
26
  <body>
27
- <h1>Store Placement Analysis Tool</h1>
 
 
 
 
 
 
 
 
 
28
 
29
- <div id="drop-area">
30
- <p>Drag and drop your CSV file here, or click to select</p>
31
- <input type="file" id="csv-upload" style="display: none;" accept=".csv">
 
 
 
 
 
32
  </div>
33
 
34
- <div id="map"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
- <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
37
- integrity="sha256-20nQCchB9co0qIjJZRGuk2/Zi9VM3yavCwpSEYOsMoeY="
38
- crossorigin=""></script>
39
- <script src="script.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  </body>
41
  </html>
 
1
  <!DOCTYPE html>
2
+ <html lang="en">
3
  <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Dark Store Placement & Heatmap</title>
7
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
8
+ <link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
9
  <style>
10
+ body {
11
+ font-family: 'Poppins', sans-serif;
12
+ background: url('https://wallpapercave.com/wp/wp4411792.jpg') no-repeat center center fixed;
13
+ background-size: cover;
14
+ color: #ffffff;
15
+ margin: 0;
16
+ padding: 0;
17
  }
18
+ .container {
19
+ background: rgba(255, 255, 255, 0.1);
20
+ backdrop-filter: blur(15px);
21
+ padding: 30px;
22
+ border-radius: 15px;
23
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
24
  text-align: center;
25
+ max-width: 900px;
26
+ margin: 40px auto;
27
+ border: 1px solid rgba(255, 255, 255, 0.2);
28
+ }
29
+ h2 {
30
+ font-weight: 600;
31
+ text-transform: uppercase;
32
+ background: linear-gradient(90deg, #ff416c, #ff4b2b);
33
+ -webkit-background-clip: text;
34
+ -webkit-text-fill-color: transparent;
35
+ }
36
+ .file-upload {
37
+ position: relative;
38
+ display: inline-block;
39
+ }
40
+ .file-upload input[type="file"] {
41
+ position: absolute;
42
+ opacity: 0;
43
+ width: 100%;
44
+ height: 100%;
45
  cursor: pointer;
 
46
  }
47
+ .file-upload label {
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ padding: 12px 20px;
52
+ background: linear-gradient(135deg, #007bff, #00d4ff);
53
+ color: #fff;
54
+ font-weight: 600;
55
+ border-radius: 8px;
56
+ cursor: pointer;
57
+ transition: all 0.3s ease;
58
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
59
+ }
60
+ .btn {
61
+ padding: 12px 24px;
62
+ font-size: 16px;
63
+ font-weight: 600;
64
+ border-radius: 8px;
65
+ text-transform: uppercase;
66
+ transition: all 0.3s ease-in-out;
67
+ cursor: pointer;
68
+ }
69
+ .btn-primary {
70
+ background: linear-gradient(135deg, #007bff, #00d4ff);
71
+ color: #fff;
72
+ }
73
+ .btn-danger {
74
+ background: linear-gradient(135deg, #ff416c, #ff4b2b);
75
+ color: #fff;
76
+ }
77
+ .btn:hover {
78
+ transform: translateY(-3px);
79
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
80
+ }
81
+ #map, #heatmap {
82
+ height: 500px;
83
+ border-radius: 10px;
84
+ overflow: hidden;
85
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
86
+ margin-top: 20px;
87
  }
88
  </style>
89
  </head>
90
  <body>
91
+ <div class="container mt-4">
92
+ <h2 class="text-center"> Dark Store Placement & Heatmap</h2>
93
+
94
+ <div class="mb-3">
95
+ <label class="form-label">Upload CSV File (Latitude, Longitude, Location)</label>
96
+ <div class="file-upload">
97
+ <input type="file" id="csvFileInput">
98
+ <label for="csvFileInput">Choose File</label>
99
+ </div>
100
+ </div>
101
 
102
+ <div class="d-flex justify-content-center gap-3">
103
+ <button class="btn btn-primary" onclick="processCSV()">Generate Store Map</button>
104
+ <button class="btn btn-danger" onclick="generateHeatmap()">Generate Heatmap</button>
105
+ </div>
106
+
107
+ <div id="map" class="mt-4"></div>
108
+ <h3 class="text-center mt-4">🔥 Heatmap Representation</h3>
109
+ <div id="heatmap" class="mt-2"></div>
110
  </div>
111
 
112
+ <script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
113
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.2/papaparse.min.js"></script>
114
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.heat/0.2.0/leaflet-heat.js"></script>
115
+
116
+ <script>
117
+ let map = L.map('map').setView([18.5204, 73.8567], 10);
118
+ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
119
+
120
+ let heatmapMap = L.map('heatmap').setView([18.5204, 73.8567], 10);
121
+ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(heatmapMap);
122
+
123
+ let selectedLocations = [];
124
+ let heatLayer;
125
+
126
+ function processCSV() {
127
+ const fileInput = document.getElementById("csvFileInput");
128
+ if (!fileInput.files.length) return alert("Please upload a CSV file");
129
+
130
+ Papa.parse(fileInput.files[0], {
131
+ header: true,
132
+ skipEmptyLines: true,
133
+ complete: function (result) {
134
+ let data = result.data;
135
+ selectedLocations = [];
136
 
137
+ data.forEach(row => {
138
+ let lat = parseFloat(row.Latitude);
139
+ let lon = parseFloat(row.Longitude);
140
+ let location = row.Location;
141
+
142
+ selectedLocations.push([lat, lon, 1.0]);
143
+ L.marker([lat, lon]).addTo(map)
144
+ .bindPopup(`<b>${location}</b><br>Lat: ${lat}, Lon: ${lon}`);
145
+ });
146
+ }
147
+ });
148
+ }
149
+
150
+ function generateHeatmap() {
151
+ if (heatLayer) heatmapMap.removeLayer(heatLayer);
152
+
153
+ heatLayer = L.heatLayer(selectedLocations, {
154
+ radius: 25,
155
+ blur: 15,
156
+ maxZoom: 10
157
+ }).addTo(heatmapMap);
158
+ }
159
+ </script>
160
  </body>
161
  </html>