-
Notifications
You must be signed in to change notification settings - Fork 0
/
event_details.html
273 lines (235 loc) · 9.79 KB
/
event_details.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Event Details - {{ team_data.city }} {{ team_data.team }}</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/map.css">
<style>
.scroll-container {
max-height: 300px;
overflow-y: auto;
border: 1px solid #ccc;
padding: 10px;
margin-top: 20px;
background-color: #f9f9f9;
}
.amenity-item {
cursor: pointer;
margin-bottom: 15px;
padding: 10px;
border-left: 4px solid #007BFF;
background-color: #ffffff;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
transition: transform 0.3s ease, border-color 0.3s ease;
}
.amenity-item:hover {
transform: translateY(-2px);
border-left-color: #0056b3;
}
.amenity-item strong {
display: block;
color: #DAA520; /* Gold color for a more distinctive look */
margin-bottom: 5px;
font-size: 1.2em;
font-family: 'Georgia', serif; /* More distinctive, professional font */
font-weight: bold;
}
.amenity-name {
color: black; /* Gold color for distinction */
font-weight: bold;
font-family: 'Georgia', serif; /* A more elegant font */
}
</style>
<script>
// Ensure the initMap function is globally accessible by assigning it to the window object
window.initMap = function() {
var categoryColors = {
'restaurants_bars': 'red',
'accommodations': 'blue',
'tourist_attractions': 'green',
'team_related_activities': 'purple'
};
// Assuming team_data.venue.coordinates contains valid latitude and longitude
var venueLocation = {
lat: Number("{{ team_data.venue.coordinates.latitude }}"),
lng: Number("{{ team_data.venue.coordinates.longitude }}"),
};
// Initialize the map
var map = new google.maps.Map(document.getElementById("map"), {
zoom: 14,
center: venueLocation,
});
// Add a marker for the event venue
addMarker(map, venueLocation, "{{ team_data.venue.name }}", "Event Venue");
// Dynamically parse the amenities data and add markers
var amenities = {{ team_data.venue.nearby_amenities | tojson | safe }};
Object.keys(amenities).forEach(function(category) {
var color = categoryColors[category] || 'gray'; // Default to gray if category not found
amenities[category].forEach(function(amenity) {
if (amenity.coordinates) {
addAmenityMarker(map, amenity, color); // Pass color based on category
}
});
});
};
var markers = {}; // Global object to store markers
function addMarker(map, location, title, label = "", contentString = "", iconColor = "") {
var marker = new google.maps.Marker({
position: location,
map: map,
title: title,
label: label,
icon: iconColor ? getMarkerIcon(iconColor) : null
});
if (contentString !== "") {
var infowindow = new google.maps.InfoWindow({content: contentString});
marker.addListener("click", function() {
infowindow.open(map, marker);
});
}
markers[title] = { marker: marker, infowindow: infowindow }; // Store marker
}
function highlightMarker(name) {
var markerInfo = markers[name];
if (markerInfo) {
// Start animation
markerInfo.marker.setAnimation(google.maps.Animation.BOUNCE);
// Open the InfoWindow
markerInfo.infowindow.open(map, markerInfo.marker);
// Stop animation after 2 seconds (2000 milliseconds)
setTimeout(function() {
markerInfo.marker.setAnimation(null);
}, 2000);
// Optionally, animate the map to the marker position
map.panTo(markerInfo.marker.getPosition());
}
}
// Adjusted addAmenityMarker function example
function addAmenityMarker(map, amenity, iconColor) {
var contentString = `<div id="content">
<h1 id="firstHeading" class="firstHeading">${amenity.name}</h1>
<div id="bodyContent">
<p><strong>Address:</strong> ${amenity.address}</p>
<p><strong>Description:</strong> ${amenity.description}</p>
<p><strong>Website:</strong> <a href="${amenity.website}" target="_blank">${amenity.website}</a></p>
</div>
</div>`;
addMarker(map, {
lat: Number(amenity.coordinates.latitude),
lng: Number(amenity.coordinates.longitude)
}, amenity.name, "", contentString, iconColor);
}
// Helper function to create a colored icon
function getMarkerIcon(color) {
return {
path: google.maps.SymbolPath.CIRCLE,
fillColor: color,
fillOpacity: 0.6,
strokeColor: 'black',
strokeWeight: 2,
scale: 10 // Size of the icon
};
}
</script>
<script
async
defer
src="https://maps.googleapis.com/maps/api/js?key=#&callback=initMap"
></script>
</head>
<body>
</div>
<a href="/" class="back-link" aria-label="Back to schedule"
>Back to schedule</a
>
</div>
<div class="container">
<div class="map-container">
<div id="map" role="application" aria-label="Map showing event location"></div>
</div>
<div class="section event-details">
<h1>{{ team_data.city }} {{ team_data.team }} at {{ team_data.venue.name }}</h1>
<div class="details">
<p><span class="detail-title">Venue:</span> {{ team_data.venue.name }}</p>
<p><span class="detail-title">Average Ticket Price:</span> {{ team_data.venue.average_ticket_price }}</p>
<p><span class="detail-title">Season Start:</span> {{ team_data.venue.season_start }}</p>
<p><span class="detail-title">Playoffs Start:</span> {{ team_data.venue.playoffs_start }}</p>
</div>
</div>
<div class="section restaurants-bars-section">
<h3>Restaurants & Bars</h3>
<div class="scroll-container">
{% for amenity in team_data.venue.nearby_amenities.restaurants_bars %}
<div class="amenity-item" onclick="highlightMarker('{{ amenity.name }}')">
<span class="amenity-name">{{ amenity.name }}</span> - {{ amenity.description }}
</div>
{% endfor %}
</div>
</div>
<div class="section public-transportation">
<h3>Public Transportation</h3>
<div class="scroll-container">
{% for option in team_data.venue.public_transportation.options %}
<div class="amenity-item">
<span class="amenity-name">{{ option.type }}:</span>
{{ option.description }}
<a href="{{ option.map_link }}" target="_blank" class="view-map-link">View Map</a>
</div>
{% endfor %}
</div>
</div>
<!-- Accommodations Section -->
<div class="section accommodations-section">
<h3>Accommodations</h3>
<div class="scroll-container">
{% for amenity in team_data.venue.nearby_amenities.accommodations %}
<div class="amenity-item" onclick="highlightMarker('{{ amenity.name }}')">
<span class="amenity-name">{{ amenity.name }}</span> - {{ amenity.description }}
</div>
{% endfor %}
</div>
</div>
<!-- Tourist Attractions Section -->
<div class="section tourist-attractions-section">
<h3>Things to do in {{ team_data.city }}</h3>
<div class="scroll-container">
{% for attraction in team_data.venue.nearby_amenities.tourist_attractions %}
<div class="amenity-item" onclick="highlightMarker('{{ attraction.name }}')">
<span class="amenity-name">{{ attraction.name }}</span> - {{ attraction.description }}
</div>
{% endfor %}
</div>
</div>
<!-- Team Related Activities Section -->
<div class="section team-related-activities-section">
<h3>{{ team_data.team }} Activities in {{ team_data.city }}</h3>
<div class="scroll-container">
{% for activity in team_data.venue.nearby_amenities.team_related_activities %}
<div class="amenity-item" onclick="highlightMarker('{{ activity.name }}')">
<span class="amenity-name">{{ activity.name }}</span> - {{ activity.description }}
</div>
{% endfor %}
</div>
</div>
<div class="section ticket-purchasing-tips">
<h3>Ticket Purchasing Tips</h3>
<strong>Best Places to Buy:</strong>
<ul>
{% for place in team_data.venue.ticket_purchasing_tips.best_places_to_buy | default([]) %}
<li>
<a href="{{ place.website }}" target="_blank">{{ place.name }}</a> - {{ place.description }}
</li>
{% endfor %}
</ul>
</div>
<div class="section ways-to-save">
<h3>Ways to Save</h3>
<p>{{ team_data.venue.ticket_purchasing_tips.ways_to_save }}</p>
</div>
<div class="section avoiding-scams">
<h3>Avoiding Scams</h3>
<p><strong>Avoiding Scalpers:</strong> {{ team_data.venue.ticket_purchasing_tips.avoiding_scalpers }}</p>
</div>
</body>
</html>