Skip to content

Commit 92432c4

Browse files
committed
refactor: improve map routing, refine login UI styling, update footer credits, add George Inn data, and enhance particle background rendering.
1 parent 93aaf8b commit 92432c4

5 files changed

Lines changed: 47 additions & 22 deletions

File tree

app/views/layout.pug

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ html
4343

4444
block footer
4545
footer
46-
p © 2026 TapThat
46+
p © 2026 TapThat - Created by Luke Pring, Jack Turner, Alec Thompson, and Victor Tepeniuc - University of Roehampton London - #[a(href="https://github.com/jackoturner/SoftwareEngineeringModuleCoursework" target="_blank") View Project on GitHub]
4747

4848
script(src="https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js")
4949
script(src="/static/bubbles.js")
@@ -102,6 +102,7 @@ html
102102
script.
103103
function showLoginModal() {
104104
document.getElementById('loginModal').classList.add('show');
105+
setTimeout(() => window.dispatchEvent(new Event('resize')), 50);
105106
}
106107

107108
document.addEventListener('DOMContentLoaded', () => {

schema.sql

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ INSERT INTO pubs VALUES
135135
(47,'The Seven Stars','53-54 Carey Street','WC2A 2JB',51.51620000,-0.11320000,'Tiny historic legal quarter pub',NOW()),
136136
(48,'The Ship & Shovell','1-3 Craven Passage','WC2N 5PH',51.50790000,-0.12450000,'Unique split pub near Charing Cross',NOW()),
137137
(49,'The White Cross','1 Water Lane','TW9 1TH',51.46080000,-0.30720000,'Riverside Richmond pub',NOW()),
138-
(50,'The Trafalgar Tavern','Park Row','SE10 9NW',51.48230000,-0.00680000,'Grand Greenwich riverside pub',NOW());
138+
(50,'The Trafalgar Tavern','Park Row','SE10 9NW',51.48230000,-0.00680000,'Grand Greenwich riverside pub',NOW()),
139+
(51,'The George Inn','High Street, Robertsbridge','TN32 5AW',50.98595400,0.48202100,'Historic inn in Robertsbridge, East Sussex',NOW());
139140

140141
-- BEERS DATA
141142
INSERT INTO beers VALUES
@@ -206,7 +207,8 @@ INSERT INTO pub_beers (pub_id, beer_id, is_available) VALUES
206207
(47,13,1),(47,3,1),(47,11,1),(47,5,1),(47,14,1),(47,8,1),(47,9,1),
207208
(48,12,1),(48,7,1),(48,9,1),(48,1,1),(48,2,1),(48,11,1),
208209
(49,15,1),(49,12,1),(49,3,1),(49,9,1),(49,1,1),(49,6,1),
209-
(50,10,1),(50,9,1),(50,3,1),(50,7,1),(50,13,1),(50,1,1),(50,5,1),(50,6,1),(50,12,1),(50,15,1);
210+
(50,10,1),(50,9,1),(50,3,1),(50,7,1),(50,13,1),(50,1,1),(50,5,1),(50,6,1),(50,12,1),(50,15,1),
211+
(51,1,1),(51,2,1),(51,5,1),(51,12,1),(51,13,1);
210212

211213
-- REVIEWS DATA
212214
INSERT INTO reviews (user_id,pub_id,beer_id,rating,ai_pour_score,comment) VALUES
@@ -299,4 +301,5 @@ INSERT INTO reviews (user_id,pub_id,beer_id,rating,ai_pour_score,comment) VALUES
299301
(7,49,5,5,4.7,'Riverside Richmond'),
300302
(8,49,3,4,4.4,'White Cross views'),
301303
(9,50,7,5,4.9,'Trafalgar Tavern grand'),
302-
(10,50,1,4,4.3,'Greenwich riverside perfect');
304+
(10,50,1,4,4.3,'Greenwich riverside perfect'),
305+
(2,51,5,5,5.00,'Wonderful service from Ethan Pring');

static/bubbles.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
document.addEventListener("DOMContentLoaded", function() {
1+
document.addEventListener("DOMContentLoaded", function () {
22
if (typeof particlesJS !== "function") return;
3-
const heroes = document.querySelectorAll('section.beer-hero, .beer-hero');
3+
const heroes = document.querySelectorAll('section.beer-hero, .beer-hero, #loginModal');
44
heroes.forEach((hero, index) => {
55
const id = 'particles-hero-' + index;
66
const div = document.createElement('div');
77
div.id = id;
88
div.className = 'particles-bg';
9-
9+
1010
// Setup hero for absolute positioning of the canvas
11-
hero.style.position = 'relative';
12-
11+
if (window.getComputedStyle(hero).position === 'static') {
12+
hero.style.position = 'relative';
13+
}
14+
1315
// zIndex 1 for children so they sit on top of the canvas
1416
Array.from(hero.children).forEach(child => {
1517
child.style.position = 'relative';

static/maps.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,15 @@ function showRoute(userLat, userLng, pub) {
297297
L.latLng(userLat, userLng),
298298
L.latLng(pub.latitude, pub.longitude)
299299
],
300-
routeWhileDragging: false
300+
routeWhileDragging: false,
301+
fitSelectedRoutes: false // Disable the default fit so we can do it manually with padding
301302
}).addTo(map);
303+
304+
routingControl.on('routesfound', function (e) {
305+
const routes = e.routes;
306+
if (routes && routes.length > 0) {
307+
const bounds = L.latLngBounds(routes[0].coordinates);
308+
map.fitBounds(bounds, { padding: [50, 50] });
309+
}
310+
});
302311
}

static/styles.css

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -831,17 +831,26 @@ body.login-page {
831831
z-index: 2;
832832
background: #ffffff;
833833
padding: 40px;
834-
border-radius: 20px;
835-
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
834+
border-radius: 12px;
835+
box-shadow: 0 15px 35px rgba(184, 115, 51, 0.15);
836836
width: 100%;
837837
max-width: 400px;
838-
border: 1px solid rgba(0, 0, 0, 0.05);
838+
border: 1px solid rgba(184, 115, 51, 0.1);
839839
}
840840

841+
.login-container .close-btn {
842+
color: #888 !important;
843+
z-index: 10;
844+
}
841845

846+
.login-container .close-btn:hover {
847+
color: #333 !important;
848+
}
842849

843-
.login-title {
844-
color: #2c2c2c;
850+
.modal-content h2.login-title {
851+
color: #B87333;
852+
background: transparent;
853+
padding: 0;
845854
text-align: center;
846855
margin-bottom: 30px;
847856
font-size: 2.8rem;
@@ -850,7 +859,6 @@ body.login-page {
850859
font-style: italic;
851860
}
852861

853-
854862
.login-form {
855863
width: 100%;
856864
margin: 0 auto;
@@ -861,13 +869,14 @@ body.login-page {
861869

862870
.form-group {
863871
margin-bottom: 24px;
872+
width: 100%;
864873
}
865874

866875
.form-label {
867876
display: block;
868-
color: #16183a;
877+
color: #2c2c2c;
869878
margin-bottom: 8px;
870-
font-weight: 500;
879+
font-weight: 600;
871880
text-align: left;
872881
}
873882

@@ -876,17 +885,18 @@ body.login-page {
876885
padding: 12px 16px;
877886
border: 1px solid #ddd;
878887
border-radius: 8px;
879-
background: white;
888+
background: #fdfdfd;
880889
font-size: 1rem;
881890
color: #333;
882891
transition: all 0.2s ease;
892+
box-sizing: border-box;
883893
}
884894

885-
886895
.form-input:focus {
887896
outline: none;
888897
background: #fff;
889-
box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.5);
898+
border-color: #B87333;
899+
box-shadow: 0 0 0 4px rgba(184, 115, 51, 0.2);
890900
}
891901

892902
.login-button {
@@ -904,7 +914,7 @@ body.login-page {
904914
}
905915

906916
.login-button:hover {
907-
background: #ff9800;
917+
background: #a0632b;
908918
transform: translateY(-2px);
909919
box-shadow: 0 4px 12px rgba(184, 115, 51, 0.3);
910920
}

0 commit comments

Comments
 (0)