@@ -96,9 +96,9 @@ function initMap(pubs) {
9696
9797 const beerIcon = L . icon ( {
9898 iconUrl : 'data:image/svg+xml;base64,' + btoa ( beerSVG ) ,
99- iconSize : [ 26 , 32 ] ,
100- iconAnchor : [ 13 , 32 ] ,
101- popupAnchor : [ 0 , - 32 ]
99+ iconSize : [ 26 , 32 ] ,
100+ iconAnchor : [ 13 , 32 ] ,
101+ popupAnchor : [ 0 , - 32 ]
102102 } ) ;
103103
104104 // Beer-themed popup CSS
@@ -124,40 +124,43 @@ function initMap(pubs) {
124124 padding: 12px 16px;
125125 font-size: 18px;
126126 font-weight: bold;
127- border-bottom: 4px solid #f4c95d ;
127+ border-bottom: 4px solid #b87334 ;
128128 text-align: center;
129+ font-family: 'Instrument Serif', serif;
129130 }
130131
131132 /* Golden beer body */
132133 .beer-popup .popup-body {
133- background: #FFCC00 ;
134- color: #2c3e50 ;
134+ background: #b87334 ;
135+ color: #fff ;
135136 padding: 14px 16px;
136137 line-height: 1.6;
138+ font-family: 'Inter', sans-serif;
137139 }
138140
139141 .beer-popup .popup-body a {
140- color: #2c3e50 ;
142+ color: #fff ;
141143 font-weight: bold;
142- text-decoration: underline ;
144+ text-decoration: none ;
143145 }
144146
145147 .beer-popup .popup-body a:hover {
146148 color: #1a252f;
147149 }
148150
149151 .beer-popup .leaflet-popup-tip {
150- background: #FFCC00 ;
152+ background: #b87334 ;
151153 }
154+
152155 ` ;
153- document . head . appendChild ( style ) ;
156+ document . head . appendChild ( style ) ;
154157
155158 const markers = [ ] ;
156159 pubs . forEach ( pub => {
157160 let reviewHTML = `<em>No reviews yet</em>` ;
158161
159162 if ( pub . comment ) {
160- reviewHTML = `
163+ reviewHTML = `
161164 <strong>Latest Review:</strong><br>
162165 Rating: ${ pub . rating } /5<br>
163166 ${ pub . ai_pour_score ? `AI Score: ${ pub . ai_pour_score } <br>` : "" }
@@ -171,44 +174,48 @@ function initMap(pubs) {
171174 ${ pub . name }
172175 </div>
173176 <div class="popup-body">
174- ${ pub . address } , ${ pub . postcode } <br><br>
175-
176- ${ reviewHTML } <br><br>
177+ <p style="margin: 0 0 15px 0;">${ pub . address } , ${ pub . postcode } </p>
178+ <div style="margin-bottom: 20px;">
179+ ${ reviewHTML }
180+ </div>
177181
178- <a href="/pubs/${ pub . id } ">View Pub Details →</a>
182+ <div style="display: flex; flex-direction: row; gap: 10px; justify-content: space-between;">
183+ <a class="btn" style="flex: 1; text-align: center; padding: 12px 0; font-size: 1em; font-weight: bold; margin: 0 15px 0 5px;" href="/pubs/${ pub . id } ">Details</a>
184+ <a class="btn" style="flex: 1; text-align: center; padding: 12px 0; font-size: 1em; font-weight: bold; margin: 0 5px 0 5px;" href="/map?pub_id=${ pub . id } ">Directions</a>
185+ </div>
179186 </div>
180187 </div>
181188 ` ;
182189
183- const marker = L . marker ( [ pub . latitude , pub . longitude ] , {
184- icon : beerIcon
190+ const marker = L . marker ( [ pub . latitude , pub . longitude ] , {
191+ icon : beerIcon
185192 } )
186193 . addTo ( map )
187194 . bindPopup ( popupHTML , {
188- className : 'beer-popup' ,
195+ className : 'beer-popup' ,
189196 closeButton : true ,
190197 maxWidth : 280
191198 } ) ;
192-
199+
193200 markers . push ( marker ) ;
194201 } ) ;
195202
196203 const urlParams = new URLSearchParams ( window . location . search ) ;
197204 const searchQuery = urlParams . get ( 'search' ) ;
198-
205+
199206 if ( searchQuery ) {
200207 const searchInput = document . getElementById ( 'mapSearchInput' ) ;
201208 if ( searchInput ) {
202209 searchInput . value = searchQuery ;
203210 }
204-
211+
205212 const overlay = document . getElementById ( 'searchOverlay' ) ;
206213 const overlayText = document . getElementById ( 'searchOverlayText' ) ;
207214 if ( overlay && overlayText ) {
208215 overlayText . textContent = `Showing ${ pubs . length } result${ pubs . length === 1 ? '' : 's' } for "${ searchQuery } "` ;
209216 overlay . style . display = 'flex' ;
210217 }
211-
218+
212219 if ( markers . length > 0 ) {
213220 const group = L . featureGroup ( markers ) ;
214221 map . fitBounds ( group . getBounds ( ) , { padding : [ 50 , 50 ] , maxZoom : 16 } ) ;
0 commit comments