Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Aug 26, 2024
1 parent 4eeafa2 commit 76913bb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
1 change: 1 addition & 0 deletions config/buienradar-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

// Whether to show the temperature, weather description, wind speed, wind direction, humidity and last update
'show' => [
'icon' => true,
'temperature' => true,
'weather_description' => true,
'wind_speed' => true,
Expand Down
51 changes: 27 additions & 24 deletions resources/views/widgets/buienradar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,41 @@
<x-filament::section class="h-full">
<div class="p-4 overflow-hidden text-center">
@if ($forecast)
<img src="{{ $forecast['fullIconUrl'] }}" alt="{{ $forecast['weatherdescription'] }}"
class="w-16 mx-auto -m-3">
@if (config('buienradar-widget.show.icon'))
<img src="{{ $forecast['fullIconUrl'] }}" alt="{{ $forecast['weatherdescription'] }}"
class="w-16 mx-auto -m-3">
@endif
@if (config('buienradar-widget.show.temperature'))
<span class="text-2xl sm:text-3xl">{{ round($forecast['temperature']) }}&#x2103;</span><br>
@endif
@if (config('buienradar-widget.show.weather_description'))
<p class="mt-1 text-sm text-gray-400">
{{ $forecast['weatherdescription'] }}
</p>
@if (config('buienradar-widget.show.stationname'))
<p class="mt-1 text-sm">
{{ $forecast['stationname'] }}
</p>
@endif
@if (config('buienradar-widget.show.wind_speed'))
<p class="mt-1 text-xs text-gray-400">
Wind: {{ $forecast['windspeedBft'] }} Bft {{ $forecast['winddirection'] }}
</p>
@endif
@if (config('buienradar-widget.show.humidity'))
<p class="mt-1 text-xs text-gray-400">
Luchtvochtigheid: {{ $forecast['humidity'] }}%
</p>
@endif
@if (config('buienradar-widget.show.last_update'))
<p class="mt-1 text-xs text-gray-400">
Laatste update: {{ \Carbon\Carbon::parse($forecast['timestamp'])->format('H:i') }}
</p>
@endif
@else
<p>No forecast data available.</p>
@endif
@if (config('buienradar-widget.show.stationname'))
<p class="mt-1 text-sm">
{{ $forecast['stationname'] }}
</p>
@endif
@if (config('buienradar-widget.show.wind_speed'))
<p class="mt-1 text-xs text-gray-400">
Wind: {{ $forecast['windspeedBft'] }} Bft {{ $forecast['winddirection'] }}
</p>
@endif
@if (config('buienradar-widget.show.humidity'))
<p class="mt-1 text-xs text-gray-400">
Luchtvochtigheid: {{ $forecast['humidity'] }}%
</p>
@endif
@if (config('buienradar-widget.show.last_update'))
<p class="mt-1 text-xs text-gray-400">
Laatste update: {{ \Carbon\Carbon::parse($forecast['timestamp'])->format('H:i') }}
</p>
@endif
@else
<p>No forecast data available.</p>
@endif
</div>
</x-filament::section>
</x-filament-widgets::widget>

0 comments on commit 76913bb

Please sign in to comment.