diff --git a/vacs-map-app/package-lock.json b/vacs-map-app/package-lock.json index 602896d..e7eb58d 100644 --- a/vacs-map-app/package-lock.json +++ b/vacs-map-app/package-lock.json @@ -14,7 +14,8 @@ "d3": "^7.8.5", "mapbox-gl": "^2.15.0", "pinia": "^2.1.7", - "vue": "^3.3.4" + "vue": "^3.3.4", + "vue-router": "^4.2.5" }, "devDependencies": { "@rushstack/eslint-patch": "^1.3.3", @@ -3472,6 +3473,20 @@ "eslint": ">=6.0.0" } }, + "node_modules/vue-router": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.2.5.tgz", + "integrity": "sha512-DIUpKcyg4+PTQKfFPX88UWhlagBEBEfJ5A8XDXRJLUnZOvcpMF8o/dnL90vpVkGaPbjvXazV/rC1qBKrZlFugw==", + "dependencies": { + "@vue/devtools-api": "^6.5.0" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -5800,6 +5815,14 @@ "semver": "^7.3.6" } }, + "vue-router": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.2.5.tgz", + "integrity": "sha512-DIUpKcyg4+PTQKfFPX88UWhlagBEBEfJ5A8XDXRJLUnZOvcpMF8o/dnL90vpVkGaPbjvXazV/rC1qBKrZlFugw==", + "requires": { + "@vue/devtools-api": "^6.5.0" + } + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/vacs-map-app/package.json b/vacs-map-app/package.json index 42423b2..ed2f005 100644 --- a/vacs-map-app/package.json +++ b/vacs-map-app/package.json @@ -16,7 +16,8 @@ "d3": "^7.8.5", "mapbox-gl": "^2.15.0", "pinia": "^2.1.7", - "vue": "^3.3.4" + "vue": "^3.3.4", + "vue-router": "^4.2.5" }, "devDependencies": { "@rushstack/eslint-patch": "^1.3.3", diff --git a/vacs-map-app/src/App.vue b/vacs-map-app/src/App.vue index f62671b..2fb6d1c 100644 --- a/vacs-map-app/src/App.vue +++ b/vacs-map-app/src/App.vue @@ -1,55 +1,11 @@ - - - {{ map.name }} - - - - + diff --git a/vacs-map-app/src/LandingPage.vue b/vacs-map-app/src/LandingPage.vue new file mode 100644 index 0000000..3992e2b --- /dev/null +++ b/vacs-map-app/src/LandingPage.vue @@ -0,0 +1,80 @@ + + + + + + How does + + {{ t.label }} + + impact decisions about food security? + + + Find out + + + + + + + + + + + + diff --git a/vacs-map-app/src/MapExplorer.vue b/vacs-map-app/src/MapExplorer.vue new file mode 100644 index 0000000..9ae714c --- /dev/null +++ b/vacs-map-app/src/MapExplorer.vue @@ -0,0 +1,70 @@ + + + + + {{ map.name }} + + + + + + + + + + + diff --git a/vacs-map-app/src/assets/main.css b/vacs-map-app/src/assets/main.css index 3bbaf55..f186231 100644 --- a/vacs-map-app/src/assets/main.css +++ b/vacs-map-app/src/assets/main.css @@ -1,5 +1,16 @@ @import './base.css'; +*, +*:before, +*:after { + box-sizing: border-box; +} + #app { margin: 0 auto; + + --dark-gray: #404040; + --white: #ffffff; + + --page-horizontal-margin: 5rem; } diff --git a/vacs-map-app/src/components/NavigationButton.vue b/vacs-map-app/src/components/NavigationButton.vue new file mode 100644 index 0000000..240d17d --- /dev/null +++ b/vacs-map-app/src/components/NavigationButton.vue @@ -0,0 +1,27 @@ + + + + + + + + + diff --git a/vacs-map-app/src/components/OverviewTop.vue b/vacs-map-app/src/components/OverviewTop.vue new file mode 100644 index 0000000..18d40da --- /dev/null +++ b/vacs-map-app/src/components/OverviewTop.vue @@ -0,0 +1,44 @@ + + + + + How does impact decisions about food security? + + Explore the map + + + Go Back + + + + + + + diff --git a/vacs-map-app/src/components/TopicPicker.vue b/vacs-map-app/src/components/TopicPicker.vue new file mode 100644 index 0000000..d1ccf45 --- /dev/null +++ b/vacs-map-app/src/components/TopicPicker.vue @@ -0,0 +1,32 @@ + + + {{ t.label }} + + + + + + + diff --git a/vacs-map-app/src/components/layouts/LayoutOpen.vue b/vacs-map-app/src/components/layouts/LayoutOpen.vue new file mode 100644 index 0000000..9021076 --- /dev/null +++ b/vacs-map-app/src/components/layouts/LayoutOpen.vue @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/vacs-map-app/src/components/layouts/LayoutOverview.vue b/vacs-map-app/src/components/layouts/LayoutOverview.vue new file mode 100644 index 0000000..2b1df94 --- /dev/null +++ b/vacs-map-app/src/components/layouts/LayoutOverview.vue @@ -0,0 +1,40 @@ + + + + + + + + + + + + diff --git a/vacs-map-app/src/components/pages/ClimateChangeOverview.vue b/vacs-map-app/src/components/pages/ClimateChangeOverview.vue new file mode 100644 index 0000000..a779115 --- /dev/null +++ b/vacs-map-app/src/components/pages/ClimateChangeOverview.vue @@ -0,0 +1,12 @@ + + + climate change + + + + + + diff --git a/vacs-map-app/src/components/pages/CropTypeOverview.vue b/vacs-map-app/src/components/pages/CropTypeOverview.vue new file mode 100644 index 0000000..229bb73 --- /dev/null +++ b/vacs-map-app/src/components/pages/CropTypeOverview.vue @@ -0,0 +1,12 @@ + + + crop type + + + + + + diff --git a/vacs-map-app/src/components/pages/GeographyOverview.vue b/vacs-map-app/src/components/pages/GeographyOverview.vue new file mode 100644 index 0000000..a1186a0 --- /dev/null +++ b/vacs-map-app/src/components/pages/GeographyOverview.vue @@ -0,0 +1,12 @@ + + + geography + + + + + + diff --git a/vacs-map-app/src/constants/topics.js b/vacs-map-app/src/constants/topics.js new file mode 100644 index 0000000..5466c28 --- /dev/null +++ b/vacs-map-app/src/constants/topics.js @@ -0,0 +1,14 @@ +export const topicUrlOptions = [ + { + label: 'crop type', + value: '/crop-type', + }, + { + label: 'climate change', + value: '/climate-change', + }, + { + label: 'geography', + value: '/geography', + }, +]; diff --git a/vacs-map-app/src/main.js b/vacs-map-app/src/main.js index 48dad43..b1e056f 100644 --- a/vacs-map-app/src/main.js +++ b/vacs-map-app/src/main.js @@ -1,11 +1,31 @@ -import './assets/main.css' +import './assets/main.css'; -import { createApp } from 'vue' -import { createPinia } from 'pinia' -import App from './App.vue' +import { createApp } from 'vue'; +import * as VueRouter from 'vue-router'; +import { createPinia } from 'pinia'; +import App from './App.vue'; +import LandingPage from './LandingPage.vue'; +import MapExplorer from './MapExplorer.vue'; +import ClimateChangeOverview from '@/components/pages/ClimateChangeOverview.vue'; +import CropTypeOverview from '@/components/pages/CropTypeOverview.vue'; +import GeographyOverview from '@/components/pages/GeographyOverview.vue'; const app = createApp(App) -app.use(createPinia()) +const routes = [ + { path: '/', component: LandingPage }, + { path: '/crop-type', component: CropTypeOverview }, + { path: '/climate-change', component: ClimateChangeOverview }, + { path: '/geography', component: GeographyOverview }, + { path: '/map-explore', component: MapExplorer }, +]; -app.mount('#app') +const router = VueRouter.createRouter({ + // 4. Provide the history implementation to use. We are using the hash history for simplicity here. + history: VueRouter.createWebHashHistory(), + routes, // short for `routes: routes` +}) + +app.use(createPinia()); +app.use(router); +app.mount('#app');