Skip to content

Commit

Permalink
☀ projected laravel-site-github from f704d4b
Browse files Browse the repository at this point in the history
Source-holobranch: laravel-site-github
Source-commit: f704d4b
Source: f704d4b
  • Loading branch information
themightychris committed Aug 23, 2021
2 parents e990b45 + f704d4b commit 984c4fc
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 52 deletions.
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.js.map

Large diffs are not rendered by default.

61 changes: 20 additions & 41 deletions resources/js/Pages/Explore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<v-card-title class="px-1">
<v-btn
icon
@click="goToPrevPane"
@click="() => currentPane--"
>
<span class="d-sr-only">Previous data</span>
<v-icon>mdi-chevron-left</v-icon>
Expand All @@ -16,7 +16,7 @@
style="flex: 1 1 0"
>
<v-window
v-model="exploreCurrentPane"
v-model="currentPane"
vertical
>
<v-window-item
Expand All @@ -31,7 +31,7 @@
</div>
<v-btn
icon
@click="goToNextPane"
@click="() => currentPane++"
>
<span class="d-sr-only">Next data</span>
<v-icon>mdi-chevron-right</v-icon>
Expand All @@ -41,7 +41,7 @@

<template #sheet-expanded>
<v-window
v-model="exploreCurrentPane"
v-model="currentPane"
class="mt-n6"
>
<v-window-item
Expand Down Expand Up @@ -105,55 +105,34 @@ export default {
},
computed: {
currentPaneRoute() {
return this.panes[this.exploreCurrentPane].route;
},
paneCount() {
return this.panes.length;
},
currentPane: {
get() {
const { pane } = route().params;
return this.panes.findIndex((p) => p.route === pane);
},
set(value) {
let index = value;
if (index < 0) {
index = this.panes.length - 1;
} else if (index >= this.panes.length) {
index = 0;
}
this.$inertia.visit(`/explore/${this.panes[index].route}`, { replace: true });
},
},
...mapFields([
'exploreIsExpanded',
'exploreCurrentPane',
]),
},
watch: {
exploreCurrentPane() {
this.handleNewPane();
},
},
methods: {
handleNewPane() {
window.history.pushState(null, null, `/explore/${this.currentPaneRoute}`);
this.$parent.$emit('new-pane', this.currentPaneRoute);
},
handleToggle(newState) {
this.exploreIsExpanded = newState;
},
goToNextPane() {
if (this.exploreCurrentPane + 1 < this.paneCount) {
this.exploreCurrentPane += 1;
} else {
this.exploreCurrentPane = 0;
}
this.handleNewPane();
},
goToPrevPane() {
if (this.exploreCurrentPane > 0) {
this.exploreCurrentPane -= 1;
} else {
this.exploreCurrentPane = this.paneCount - 1;
}
this.handleNewPane();
},
},
};
</script>
27 changes: 27 additions & 0 deletions resources/js/Pages/Explore/panes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import Alteration from './Alteration.vue';
import NewConstruction from './NewConstruction.vue';
import SalePrices from './SalePrices.vue';
import Zoning from './Zoning.vue';
import Layers from './Layers.vue';

export default [{
title: 'Sale Prices',
component: SalePrices,
route: 'sales',
}, {
title: 'Zoning',
component: Zoning,
route: 'zoning',
}, {
title: 'New Construction Permits',
component: NewConstruction,
route: 'construction',
}, {
title: 'Alteration Permits',
component: Alteration,
route: 'alteration',
}, {
title: 'Planning Overlays',
component: Layers,
route: 'layers',
}];
15 changes: 7 additions & 8 deletions resources/js/Shared/Layouts/MapSheetLayout.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<lp-bottom-sheet @new-pane="handleNewPane">
<lp-bottom-sheet>
<mapbox-map
ref="mapboxmap"
:tiles="mapTiles"
Expand Down Expand Up @@ -57,11 +57,13 @@ export default {
computed: {
...mapFields([
'exploreIsExpanded',
'exploreCurrentPane',
'shownTour',
]),
},
mounted() {
this.$inertia.on('finish', () => {
this.mapTiles = route().params.pane;
});
// if already shown before then do not show again
if (this.shownTour) { return; }
this.$nextTick(() => {
Expand Down Expand Up @@ -232,9 +234,6 @@ export default {
});
},
methods: {
handleNewPane(pane) {
this.mapTiles = pane;
},
sourceDataLoaded(event) {
// we should not mess with the parcel color
Expand Down Expand Up @@ -317,7 +316,7 @@ export default {
filter: ['==', 'parcel_id', '441425'],
});
const coordinates = { lat: 39.9534051531393, lng: -75.20876878307995 };
const parcel = feature[0].properties;
const parcel = feature[0] ? feature[0].properties : undefined;
this.showPopup({ properties: parcel, coords: coordinates, feature: feature[0] });
},
triggerExpanded() {
Expand All @@ -327,10 +326,10 @@ export default {
this.exploreIsExpanded = false;
},
triggerPlanningOverlays() {
this.exploreCurrentPane = 4;
this.$inertia.visit('/explore/layers', { replace: true });
},
triggerSales() {
this.exploreCurrentPane = 0;
this.$inertia.visit('/explore/sales', { replace: true });
},
},
};
Expand Down
1 change: 0 additions & 1 deletion resources/js/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default new Vuex.Store({
// from letsplanorg
exploreIsExpanded: false,
layersIsExpanded: true,
exploreCurrentPane: 0,
tourShown: false,
},
mutations: {
Expand Down

0 comments on commit 984c4fc

Please sign in to comment.