Skip to content

Commit

Permalink
Minor Improvements (#24)
Browse files Browse the repository at this point in the history
* remove dangers page, fix counter

* fix bad instrucitons

* cleanup

* allow nonstandard direction tag, link to OSM

* update privacy policy to account for intro message
  • Loading branch information
frillweeman authored Jan 5, 2025
1 parent e03cb9d commit a937c43
Show file tree
Hide file tree
Showing 44 changed files with 170 additions and 178 deletions.
Binary file added webapp/public/alprs/elsag-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/elsag-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/elsag-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/elsag-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/flock-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/flock-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/flock-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/flock-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/motorola-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/motorola-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/motorola-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/motorola-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/neology-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/alprs/neology-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed webapp/public/chicago-pd.jpg
Binary file not shown.
Binary file removed webapp/public/flock-1.jpg
Binary file not shown.
Binary file removed webapp/public/flock-2.jpg
Binary file not shown.
Binary file removed webapp/public/flock-3.jpg
Binary file not shown.
Binary file removed webapp/public/flock-4.jpg
Binary file not shown.
Binary file removed webapp/public/flock-5.jpg
Binary file not shown.
Binary file removed webapp/public/flock-6.jpg
Binary file not shown.
14 changes: 14 additions & 0 deletions webapp/public/flock-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed webapp/public/neology-1.jpg
Binary file not shown.
Binary file removed webapp/public/redlight-camera.jpg
Binary file not shown.
Binary file removed webapp/public/security-camera.jpg
Binary file not shown.
Binary file removed webapp/public/toll-camera.jpg
Diff not rendered.
Binary file removed webapp/public/traffic-camera.jpg
Diff not rendered.
Binary file removed webapp/public/vigilant-1.jpg
Diff not rendered.
Binary file removed webapp/public/vigilant-2.jpg
Diff not rendered.
Binary file removed webapp/public/vigilant-3.jpg
Diff not rendered.
1 change: 0 additions & 1 deletion webapp/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const items = [
{ title: 'Home', icon: 'mdi-home', to: '/' },
{ title: 'Map', icon: 'mdi-map', to: '/map' },
{ title: 'What is an ALPR?', icon: 'mdi-cctv', to: '/what-is-an-alpr' },
{ title: 'Dangers of ALPRs', icon: 'mdi-shield-alert', to: '/dangers' },
{ title: 'Report an ALPR', icon: 'mdi-map-marker-plus', to: '/report' },
{ title: 'Known Operators', icon: 'mdi-police-badge', to: '/operators' },
// { title: 'About', icon: 'mdi-information', to: '/about' },
Expand Down
4 changes: 4 additions & 0 deletions webapp/src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ p {
font-family: "PT Serif", serif;
}

.sans-serif {
font-family: unset !important;
}

/* Prevent Scrolling Horizontally */
html, body {
overflow-x: hidden;
Expand Down
36 changes: 28 additions & 8 deletions webapp/src/components/ALPRCounter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ import { useDisplay } from 'vuetify'
import { getALPRCounts } from '@/services/apiService';
import { CountUp } from 'countup.js';
const props = defineProps({
delayMs: {
type: Number,
default: 200,
}
});
const counterEl: Ref<HTMLElement|null> = ref(null);
const countupOptions = {
useEasing: true,
Expand All @@ -33,13 +40,17 @@ const counts: Ref<Counts> = ref({
const showFinalAnimation = ref(false);
const { xs: isMobile } = useDisplay();
let timeOfMount: number|undefined = undefined;
onMounted(() => {
getALPRCounts().then((response) => {
counts.value = response;
timeOfMount = new Date().getTime();
getALPRCounts().then((countResponse) => {
counts.value = countResponse;
countUp(countResponse);
});
});
watch(counts, (newCounts: Counts) => {
function countUp(newCounts: Counts) {
if (!newCounts.worldwide) return;
if (!counterEl.value) {
console.error('Counter element not found');
Expand All @@ -48,14 +59,23 @@ watch(counts, (newCounts: Counts) => {
if (!counter) {
counter = new CountUp(counterEl.value, newCounts.worldwide, countupOptions);
setTimeout(() => {
counter?.start();
}, 500);
if (timeOfMount) {
const timeSinceMount = new Date().getTime() - timeOfMount;
if (timeSinceMount < props.delayMs) {
setTimeout(() => {
counter?.start();
}, props.delayMs - timeSinceMount);
} else {
counter.start();
}
}
setTimeout(() => {
showFinalAnimation.value = true;
}, 3000);
}, 2500);
}
});
}
</script>

<style scoped>
Expand Down
25 changes: 13 additions & 12 deletions webapp/src/components/DFMapPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{{ alpr.tags.brand }}
</span>
<span v-else>
Unknown Manufacturer
Unspecified Manufacturer
</span>
</b>
</v-list-item>
Expand All @@ -32,19 +32,14 @@
{{ alpr.tags.operator }}
</span>
<span v-else>
Unknown Operator
Unspecified Operator
</span>
</b>
</v-list-item>
</v-list>

<div class="text-center text-grey-darken-1">

<v-tooltip open-delay="500" text="OSM Node ID" location="bottom">
<template #activator="{ props }">
<span style="font-size: 0.9em; cursor: default" v-bind="props">node/{{ alpr.id }}</span>
</template>
</v-tooltip>
<div class="text-center">
<v-btn target="_blank" size="x-small" :href="osmNodeLink(props.alpr.id)" variant="text" color="grey-darken-1"><v-icon start>mdi-open-in-new</v-icon>View on OSM</v-btn>
</div>
</v-sheet>
</template>
Expand All @@ -53,7 +48,7 @@
import { defineProps, computed } from 'vue';
import type { PropType } from 'vue';
import type { ALPR } from '@/types';
import { VIcon, VList, VSheet, VListItem, VTooltip } from 'vuetify/components';
import { VIcon, VList, VSheet, VListItem, VBtn } from 'vuetify/components';
const props = defineProps({
alpr: {
Expand All @@ -64,12 +59,18 @@ const props = defineProps({
const isFaceRecognition = computed(() => props.alpr.tags.brand === 'Avigilon');
const cardinalDirection = computed(() =>
props.alpr.tags.direction === undefined ? 'Unknown Direction' : degreesToCardinal(parseInt(props.alpr.tags.direction))
const cardinalDirection = computed(() => {
const direction = props.alpr.tags.direction || props.alpr.tags["camera:direction"];
return direction === undefined ? 'Unspecified Direction' : degreesToCardinal(parseInt(direction))
}
);
function degreesToCardinal(degrees: number): string {
const cardinals = ['North', 'Northeast', 'East', 'Southeast', 'South', 'Southwest', 'West', 'Northwest'];
return 'Faces ' + cardinals[Math.round(degrees / 45) % 8];
}
function osmNodeLink(id: string): string {
return `https://www.openstreetmap.org/node/${id}`;
}
</script>
4 changes: 2 additions & 2 deletions webapp/src/components/LeafletMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ let currentLocationLayer: FeatureGroup;
// Marker Creation Utilities
function createSVGMarker(alpr: ALPR): string {
const orientationDegrees = alpr.tags.direction;
const orientationDegrees = alpr.tags.direction || alpr.tags['camera:direction'];
const fovPath = `
<path class="someSVGpath" d="M215.248,221.461L99.696,43.732C144.935,16.031 198.536,0 256,0C313.464,0 367.065,16.031 412.304,43.732L296.752,221.461C287.138,209.593 272.448,202.001 256,202.001C239.552,202.001 224.862,209.593 215.248,221.461Z" style="fill:rgb(87,87,87);fill-opacity:0.46;"/>
<path class="someSVGpath" d="M215.248,221.461L99.696,43.732C144.935,16.031 198.536,0 256,0C313.464,0 367.065,16.031 412.304,43.732L296.752,221.461C287.138,209.593 272.448,202.001 256,202.001C239.552,202.001 224.862,209.593 215.248,221.461ZM217.92,200.242C228.694,192.652 241.831,188.195 256,188.195C270.169,188.195 283.306,192.652 294.08,200.242C294.08,200.242 392.803,48.4 392.803,48.4C352.363,26.364 305.694,13.806 256,13.806C206.306,13.806 159.637,26.364 119.197,48.4L217.92,200.242Z" style="fill:rgb(137,135,135);"/>
Expand All @@ -73,7 +73,7 @@ function createSVGMarker(alpr: ALPR): string {
}
function createMarker(alpr: ALPR): Marker | CircleMarker {
if (hasPlottableOrientation(alpr.tags.direction)) {
if (hasPlottableOrientation(alpr.tags.direction || alpr.tags['camera:direction'])) {
const icon = L.divIcon({
className: 'leaflet-data-marker',
html: createSVGMarker(alpr),
Expand Down
Loading

0 comments on commit a937c43

Please sign in to comment.