From 1e0f82d43525c756cede216655083f6427ef5c25 Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sat, 6 Jul 2024 00:28:10 +0200 Subject: [PATCH 1/3] feat: add privacy zones --- .env.example | 2 ++ config/app.php | 2 ++ resources/views/tracker.blade.php | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/.env.example b/.env.example index 13732c1..2b6a2a8 100644 --- a/.env.example +++ b/.env.example @@ -7,6 +7,8 @@ APP_URL= CURRENT_TRIP_ID= PAST_TRIP_IDS= +PRIVACY_LAT_LONS= + MAIL_MAILER=mailjet MAILJET_APIKEY= MAILJET_APISECRET= diff --git a/config/app.php b/config/app.php index 41a0865..65dbc7b 100644 --- a/config/app.php +++ b/config/app.php @@ -76,6 +76,8 @@ return [ 'past_trip_ids' => explode(',', env('PAST_TRIP_IDS')), + 'privacy_lat_lons' => explode(';', env('PRIVACY_LAT_LONS')), + /* |-------------------------------------------------------------------------- | Digest Mailing Lists diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index 0985cdd..12e2b75 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -65,6 +65,22 @@ L.polyline([ @foreach(array_slice($trip->locations, $idx, 100) as $location) @if(!in_array($location->id, config('app.current_trip_ignore'))) + + @php + // Privacy zones + $privacyLatLons = config('app.privacy_lat_lons'); + $latLon = explode(',', $privacyLatLons[0]); + if ( + !( + ( $location->latitude - $latLon[0] > 0.01 ) || ( $location->latitude - $latLon[0] < -0.01 ) || + ( $location->longitude - $latLon[1] > 0.01 ) || ( $location->longitude - $latLon[1] < -0.01 ) + ) + ) { + $location->latitude = $location->latitude + ((rand(0,2)-1)/100); + $location->longitude = $location->longitude + ((rand(0,2)-1)/100); + } + @endphp + [{{ $location->latitude }}, {{ $location->longitude }}], @endif From 1b0b240de359ec979b9dd2c87222e9a4d959a80d Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sat, 6 Jul 2024 00:28:30 +0200 Subject: [PATCH 2/3] feat: cherry-picked checkins --- app/Http/Controllers/TrackerController.php | 3 ++- resources/views/tracker.blade.php | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/TrackerController.php b/app/Http/Controllers/TrackerController.php index 2c46805..cbd59fc 100644 --- a/app/Http/Controllers/TrackerController.php +++ b/app/Http/Controllers/TrackerController.php @@ -90,7 +90,8 @@ class TrackerController extends Controller 'trip' => $tripData, 'showAllCheckins' => ($viewMode === 'all'), 'fromCheckin' => $fromCheckin, - 'toCheckin' => $toCheckin + 'toCheckin' => $toCheckin, + 'cherryPicked' => !!$cherryPickedCheckins ] ); } diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index 12e2b75..b4939c0 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -30,11 +30,11 @@
-

@if ($showAllCheckins) Posts @else Recent Posts @endif

+

@if ($showAllCheckins) Posts @elseif ($cherryPicked || $toCheckin || $fromCheckin) Selected Posts @else Recent Posts @endif

Want to receive a regular email digest of updates?

Ask me and I'll add you to the list: weekly, fortnightly and monthly options available (or daily if you're really keen).

-
    - @if($showAllCheckins || $toCheckin || $fromCheckin) +
      + @if($showAllCheckins || $toCheckin || $fromCheckin || $cherryPicked) @php $checkinsList = $trip->checkins @endphp @else @php $checkinsList = array_slice(array_reverse($trip->checkins), 0, 10) @endphp From 12bfb800ce352ccd2395d62538ec853a81c62c8a Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sat, 6 Jul 2024 00:28:44 +0200 Subject: [PATCH 3/3] style: update links and text spacing --- resources/css/app.css | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/resources/css/app.css b/resources/css/app.css index f30954f..c9f2723 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -16,6 +16,22 @@ body { font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; } +:where(:root) { + line-height: 1.5; +} + +a { + text-decoration-skip-ink: auto; + color: #020202; + text-decoration: underline; + opacity: 0.8; +} + +a:hover { + text-decoration: none; + opacity: 1; +} + .page-title { font-size: 1.5em; text-align: center;