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
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Indian Regional Songs</title>
|
7 |
+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
|
8 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" rel="stylesheet">
|
9 |
+
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
|
10 |
+
<style>
|
11 |
+
/* Global Styles */
|
12 |
+
body {
|
13 |
+
font-family: 'Roboto', sans-serif;
|
14 |
+
margin: 0;
|
15 |
+
padding: 0;
|
16 |
+
background: linear-gradient(to right, #f9f9f9, #eaeaea);
|
17 |
+
color: #212529;
|
18 |
+
}
|
19 |
+
|
20 |
+
h1 {
|
21 |
+
text-align: center;
|
22 |
+
margin: 20px 0;
|
23 |
+
font-size: 2.5rem;
|
24 |
+
color: #6c63ff;
|
25 |
+
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
|
26 |
+
}
|
27 |
+
|
28 |
+
/* Map Container */
|
29 |
+
#map {
|
30 |
+
height: 80vh;
|
31 |
+
width: 90%;
|
32 |
+
border: 3px solid #6c63ff;
|
33 |
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
|
34 |
+
border-radius: 10px;
|
35 |
+
margin: 20px auto;
|
36 |
+
}
|
37 |
+
|
38 |
+
/* Popup Content */
|
39 |
+
.popup-content {
|
40 |
+
text-align: center;
|
41 |
+
font-size: 1rem;
|
42 |
+
color: #495057;
|
43 |
+
}
|
44 |
+
|
45 |
+
.popup-content b {
|
46 |
+
color: #6c63ff;
|
47 |
+
font-size: 1.1rem;
|
48 |
+
}
|
49 |
+
|
50 |
+
/* Button Styles */
|
51 |
+
.popup-content button {
|
52 |
+
background: linear-gradient(to right, #6c63ff, #4639ff);
|
53 |
+
color: white;
|
54 |
+
border: none;
|
55 |
+
padding: 10px 20px;
|
56 |
+
font-size: 0.9rem;
|
57 |
+
border-radius: 20px;
|
58 |
+
cursor: pointer;
|
59 |
+
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
|
60 |
+
display: inline-flex;
|
61 |
+
align-items: center;
|
62 |
+
gap: 8px;
|
63 |
+
transition: all 0.3s ease-in-out;
|
64 |
+
}
|
65 |
+
|
66 |
+
.popup-content button i {
|
67 |
+
font-size: 1.1rem;
|
68 |
+
}
|
69 |
+
|
70 |
+
.popup-content button:hover {
|
71 |
+
background: linear-gradient(to right, #4639ff, #321fff);
|
72 |
+
transform: scale(1.05);
|
73 |
+
}
|
74 |
+
|
75 |
+
/* Footer */
|
76 |
+
footer {
|
77 |
+
text-align: center;
|
78 |
+
padding: 15px;
|
79 |
+
background-color: #6c63ff;
|
80 |
+
color: white;
|
81 |
+
font-size: 0.9rem;
|
82 |
+
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
|
83 |
+
}
|
84 |
+
|
85 |
+
footer a {
|
86 |
+
color: #ffd700;
|
87 |
+
text-decoration: none;
|
88 |
+
font-weight: bold;
|
89 |
+
}
|
90 |
+
|
91 |
+
footer a:hover {
|
92 |
+
text-decoration: underline;
|
93 |
+
}
|
94 |
+
|
95 |
+
/* Header */
|
96 |
+
header {
|
97 |
+
text-align: center;
|
98 |
+
background: #6c63ff;
|
99 |
+
padding: 20px;
|
100 |
+
color: white;
|
101 |
+
font-size: 1.5rem;
|
102 |
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
|
103 |
+
}
|
104 |
+
|
105 |
+
/* Search Box */
|
106 |
+
#search-bar {
|
107 |
+
display: flex;
|
108 |
+
justify-content: center;
|
109 |
+
margin: 20px auto;
|
110 |
+
}
|
111 |
+
|
112 |
+
#search-bar input {
|
113 |
+
padding: 10px 15px;
|
114 |
+
width: 300px;
|
115 |
+
border: 2px solid #6c63ff;
|
116 |
+
border-radius: 20px;
|
117 |
+
font-size: 1rem;
|
118 |
+
outline: none;
|
119 |
+
transition: all 0.3s ease-in-out;
|
120 |
+
}
|
121 |
+
|
122 |
+
#search-bar input:focus {
|
123 |
+
border-color: #4639ff;
|
124 |
+
box-shadow: 0 0 10px rgba(108, 99, 255, 0.5);
|
125 |
+
}
|
126 |
+
|
127 |
+
#search-bar button {
|
128 |
+
margin-left: 10px;
|
129 |
+
padding: 10px 20px;
|
130 |
+
background: #6c63ff;
|
131 |
+
color: white;
|
132 |
+
border: none;
|
133 |
+
border-radius: 20px;
|
134 |
+
font-size: 1rem;
|
135 |
+
cursor: pointer;
|
136 |
+
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
|
137 |
+
transition: all 0.3s ease-in-out;
|
138 |
+
}
|
139 |
+
|
140 |
+
#search-bar button:hover {
|
141 |
+
background: #4639ff;
|
142 |
+
transform: scale(1.05);
|
143 |
+
}
|
144 |
+
.location-label {
|
145 |
+
text-align: center;
|
146 |
+
font-family: 'Roboto', sans-serif;
|
147 |
+
color: black;
|
148 |
+
font-size: 0.9rem;
|
149 |
+
}
|
150 |
+
</style>
|
151 |
+
</head>
|
152 |
+
<body>
|
153 |
+
<header>
|
154 |
+
Explore the Rich Heritage of Indian Regional Songs
|
155 |
+
</header>
|
156 |
+
|
157 |
+
<h1>Indian Regional Songs Map</h1>
|
158 |
+
|
159 |
+
|
160 |
+
<div id="map"></div>
|
161 |
+
<footer>
|
162 |
+
© 2024 Indian Regional Songs | Made with ❤️ by <a href="#">Your Name</a>
|
163 |
+
</footer>
|
164 |
+
|
165 |
+
<script>
|
166 |
+
// Initialize map centered at India's approximate geographic center
|
167 |
+
const map = L.map('map').setView([22.9734, 78.6569], 5);
|
168 |
+
|
169 |
+
// Add OpenStreetMap tiles
|
170 |
+
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
171 |
+
maxZoom: 18,
|
172 |
+
}).addTo(map);
|
173 |
+
|
174 |
+
// Define a custom icon for the marker
|
175 |
+
const locationIcon = L.icon({
|
176 |
+
iconUrl: 'https://cdn-icons-png.flaticon.com/512/684/684908.png', // Use any URL for a pin icon
|
177 |
+
iconSize: [32, 32], // Adjust the size of the icon
|
178 |
+
iconAnchor: [16, 32], // Anchor point of the icon (centered at the bottom)
|
179 |
+
popupAnchor: [0, -32] // Where the popup should open relative to the icon
|
180 |
+
});
|
181 |
+
|
182 |
+
// Data passed from Flask
|
183 |
+
const data = {{ data|tojson }};
|
184 |
+
|
185 |
+
// Loop through data to add markers and labels
|
186 |
+
data.forEach(region => {
|
187 |
+
const { Latitude, Longitude, "Music/Song Type": song, "State/Region": state } = region;
|
188 |
+
|
189 |
+
// Create a marker with a custom icon
|
190 |
+
L.marker([Latitude, Longitude], { icon: locationIcon })
|
191 |
+
.addTo(map)
|
192 |
+
.bindPopup(`
|
193 |
+
<div class="popup-content">
|
194 |
+
<b>Location:</b> <span style="font-size: 1.1rem; font-weight: bold; color: #4639ff;">${state}</span><br>
|
195 |
+
<b>Song Type:</b> ${song}<br>
|
196 |
+
<a href="https://www.youtube.com/results?search_query=${encodeURIComponent(song)}" target="_blank">
|
197 |
+
<button>
|
198 |
+
<i class="fas fa-search"></i> Get your song
|
199 |
+
</button>
|
200 |
+
</a>
|
201 |
+
</div>
|
202 |
+
`);
|
203 |
+
|
204 |
+
// Add a label with the location name in bold, displayed near the marker
|
205 |
+
const label = L.divIcon({
|
206 |
+
className: 'location-label',
|
207 |
+
html: `<b style="color: #4639ff; font-size: 1.1rem;">${state}</b>`,
|
208 |
+
iconSize: [100, 20], // Adjust size of the label box
|
209 |
+
iconAnchor: [50, -10] // Position the label above the marker
|
210 |
+
});
|
211 |
+
|
212 |
+
L.marker([Latitude, Longitude], { icon: label }).addTo(map);
|
213 |
+
});
|
214 |
+
</script>
|
215 |
+
|
216 |
+
</body>
|
217 |
+
</html>
|
218 |
+
|
219 |
+
|
220 |
+
|
221 |
+
|