-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.html
More file actions
240 lines (203 loc) · 6.87 KB
/
map.html
File metadata and controls
240 lines (203 loc) · 6.87 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
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
<!-- map.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sherlock's Literary London</title>
<!-- Include Leaflet CSS -->
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<!-- Include leaflet-search CSS -->
<link rel="stylesheet" href="https://unpkg.com/leaflet-search/dist/leaflet-search.min.css" />
<!-- Font Awesome for icons (you can include it in your project or use a CDN) -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8sh+Wy8tsILt4Q7P4MQTgPD6jRq2EPgJLQRO8" crossorigin="anonymous">
<style>
/* Set the height of the map container to 100vh (100% of viewport height) */
#map {
height: calc(100vh - 0px); /* Adjust the height based on the header/banner height */
}
/* Header/banner styles */
header {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 80px; /* Adjust the height as needed */
background: rgba(111, 111, 11, 0.8); /* Semi-transparent background color */
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 60px;
z-index: 1000;
font-family: 'Arial', sans-serif; /* Use a modern font */
}
/* Style for the home button */
#home-button {
order: -1; /* Move the home button to the left */
background-color: #4d301e; /* Dark brown background color */
color: #fff; /* White text color */
padding: 10px 20px; /* Padding for better appearance */
border: none;
cursor: pointer;
font-weight: bold;
border-radius: 5px; /* Add a slight border-radius for a rounded look */
transition: background-color 0.3s ease; /* Smooth transition for hover effect */
}
/* Style for the Sherlock Holmes text */
#sherlock-text {
color: #4d301e; /* Adjust the color as needed */
font-size: 24px;
font-weight: bold;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%); /* Center the text both horizontally and vertically */
}
/* Custom Zoom Control */
.custom-zoom-control {
display: flex;
gap: 10px; /* Adjust the gap between buttons */
}
/* Adjust map container position to accommodate the header/banner */
body {
margin: 0;
padding: 0;
height: 100vh;
overflow: hidden; /* Prevent scrolling when the map is dragged */
}
/* Legend styles */
#legend {
position: fixed;
top: 80px; /* Adjust the top position based on your header height */
right: 20px;
background-color: white;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
z-index: 1000;
}
.legend-item {
display: flex;
align-items: center;
margin-bottom: 5px;
}
.legend-marker {
width: 20px;
height: 30px;
margin-right: 5px;
border: 1px solid #ccc;
}
.legend-icon {
width: 20px;
height: 20px;
margin-right: 5px;
border: 1px solid #ccc;
}
.popup-content {
display: flex;
}
.popup-text {
flex: 1;
padding-right: 10px;
}
.popup-image {
flex-shrink: 0;
}
.leaflet-popup-content {
max-width: 700px !important;
width: 700px !important;
height: 300px;
overflow-y: scroll;
}
.popup-content {
display: flex;
}
.popup-text {
flex: 1;
padding-right: 10px;
}
.popup-image {
flex-shrink: 0;
}
.crime-scene-icon {
font-size: 30px;
color: red;
}
/* Optionally, add some animation to the banner */
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
header {
animation: fadeInDown 0.5s ease-in-out; /* Add animation to the header/banner */
}
/* Hover effect for the home button */
#home-button:hover {
background-color: #593a27; /* Darken the background color on hover */
}
</style>
</head>
<script>
// Home button functionality
function goToHome() {
// Navigate to the index.html page
window.location.href = 'index.html';
}
</script>
<body>
<!-- Header/banner -->
<header>
<div id="home-button" onclick="goToHome()">Home</div>
<div id="sherlock-text">Sherlock's Literary London</div>
<div class="custom-zoom-control" id="custom-zoom-control"></div>
</header>
<!-- The map container -->
<div id="map"></div>
<!-- Legend -->
<div id="legend">
<h4>Legend</h4>
<div class="legend-item">
<div class="legend-marker"><img src="https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png" alt="The Lauriston Gardens Mystery" width="20" height="30"></div>
<span>The Lauriston Gardens Mystery</span>
</div>
<div class="legend-item">
<div class="legend-marker"><img src="https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-orange.png" alt="The Sign of the Four" width="20" height="30"></div>
<span>The Sign of the Four</span>
</div>
<div class="legend-item">
<div class="legend-marker"><img src="https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-gold.png" alt="The Yellow Face" width="20" height="30"></div>
<span>The Yellow Face</span>
</div>
<div class="legend-item">
<div class="legend-marker"><img src="https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-black.png" alt="The Engineer's Thumb" width="20" height="30"></div>
<span>The Engineer's Thumb</span>
</div>
<div class="legend-item">
<div class="legend-icon"><img src="https://www.svgrepo.com/show/35009/policeman.svg" alt="Police Man" width="20" height="20"></div>
<span>Police Man</span>
</div>
<div class="legend-item">
<div class="legend-icon"><img src="https://www.svgrepo.com/show/34968/maid.svg" alt="Witness" width="20" height="20"></div>
<span>Witness</span>
</div>
<div class="legend-item">
<div class="legend-icon"><img src="https://www.svgrepo.com/show/438667/magnifying-glass-round.svg" alt="Crime Scene" width="20" height="20"></div>
<span>Crime Scene</span>
</div>
<!-- Add more legend items as needed -->
</div>
<!-- Include Leaflet JavaScript -->
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<!-- Include leaflet-search JavaScript -->
<script src="https://unpkg.com/leaflet-search/dist/leaflet-search.min.js"></script>
<!-- Your custom JavaScript file -->
<script type="module" src="map.js"></script>
</body>
</html>