From e70da7d3a9c0241944a035c42cfc7927cd2314e5 Mon Sep 17 00:00:00 2001 From: JeremyJamesL Date: Sat, 28 Dec 2024 16:39:18 +1100 Subject: fixed positioning --- about.html | 5 +++++ index.html | 12 +++++++++--- src/index.css | 13 +++++++++++-- src/main.js | 12 +++++++++--- vite.config.js | 13 +++++++++++++ 5 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 vite.config.js diff --git a/about.html b/about.html index 66f7d2e..8935324 100644 --- a/about.html +++ b/about.html @@ -4,6 +4,11 @@ London pub search + + London pub search + + -
+
  • @@ -81,8 +86,9 @@
-
-
+
+ +
diff --git a/src/index.css b/src/index.css index 57ac450..08ab90b 100644 --- a/src/index.css +++ b/src/index.css @@ -9,11 +9,14 @@ } */ #map { - height: 100%; - height: calc(100dvh - (64px + 288px)); + height: 100dvh; width: 100%; } +.bottom--hide { + bottom: -14rem; +} + .gm-style-mtc-bbw { display: none; } @@ -84,3 +87,9 @@ body { stroke-miterlimit: 10; stroke-dasharray: 4, 3; } + +.bar { + height: 20px; + width: 200px; + background-color: red; +} diff --git a/src/main.js b/src/main.js index ac19077..ceeeb52 100644 --- a/src/main.js +++ b/src/main.js @@ -28,7 +28,7 @@ const dataController = (function () { { lat: 51.493989, lng: -0.085187 }, ]; - const centralPosition = { lat: 51.508616, lng: -0.125319 }; + const centralPosition = { lat: 51.476, lng: -0.11 }; return { initialRectBounds, @@ -74,6 +74,8 @@ const interfaceController = (function () { hits: '#hits', searchBar: '#searchbar', pubCount: '.pub-count', + toggle: '#toggle', + bottom: '#bottom', }; const generateMap = async function (bounds, position, maxSpace, initialPolygonBounds, currentShape, zoom = 12) { @@ -224,7 +226,7 @@ const controller = (function (dataCTRL, uiCTRL) { const initialPolygonBounds = dataCTRL.initialPolygonBounds; // Polygon bounds const initialSetup = async function () { - await uiCTRL.initMap(rectBounds, centralPoint, mapBounds, initialPolygonBounds, 'rectangle', 12); + await uiCTRL.initMap(rectBounds, centralPoint, mapBounds, initialPolygonBounds, 'rectangle', 12.5); const searchResults = await dataCTRL.getSearchResults( '', @@ -285,7 +287,7 @@ const controller = (function (dataCTRL, uiCTRL) { const setupEventListeners = async function () { $(DOM.selectRect).addEventListener('click', async () => { - await uiCTRL.initMap(rectBounds, centralPoint, mapBounds, initialPolygonBounds, 'rectangle', 12); + await uiCTRL.initMap(rectBounds, centralPoint, mapBounds, initialPolygonBounds, 'rectangle', 12.5); const searchResults = await dataCTRL.getSearchResults( dataCTRL.getCurrentQuery(), 'rectangle', @@ -326,6 +328,10 @@ const controller = (function (dataCTRL, uiCTRL) { await uiCTRL.embedSearchResults(searchResults.hits); uiCTRL.updateHitsList(searchResults.hits); }); + + $(DOM.toggle).addEventListener('click', () => { + $(DOM.bottom).classList.toggle('bottom--hide'); + }); }; return { diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..82b8155 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,13 @@ +import { defineConfig } from 'vite'; +import path from 'path'; + +export default defineConfig({ + build: { + rollupOptions: { + input: { + main: path.resolve(__dirname, 'index.html'), + about: path.resolve(__dirname, 'about.html'), + }, + }, + }, +}); -- cgit v1.2.3