chore: move receipt blade views

This commit is contained in:
Benjamin Nussbaum 2025-03-16 19:21:07 +01:00
parent 09b0d8bcf8
commit b0610a62b0
3 changed files with 159 additions and 0 deletions

View file

@ -0,0 +1,46 @@
{{-- Credit: Lucide (https://lucide.dev) --}}
@props([
'variant' => 'outline',
])
@php
if ($variant === 'solid') {
throw new \Exception('The "solid" variant is not supported in Lucide.');
}
$classes = Flux::classes('shrink-0')
->add(match($variant) {
'outline' => '[:where(&)]:size-6',
'solid' => '[:where(&)]:size-6',
'mini' => '[:where(&)]:size-5',
'micro' => '[:where(&)]:size-4',
});
$strokeWidth = match ($variant) {
'outline' => 2,
'mini' => 2.25,
'micro' => 2.5,
};
@endphp
<svg
{{ $attributes->class($classes) }}
data-flux-icon
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="{{ $strokeWidth }}"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
data-slot="icon"
>
<path d="M8 3.1V7a4 4 0 0 0 8 0V3.1" />
<path d="m9 15-1-1" />
<path d="m15 15 1-1" />
<path d="M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z" />
<path d="m8 19-2 3" />
<path d="m16 19 2 3" />
</svg>

View file

@ -0,0 +1,57 @@
<x-trmnl::view>
<x-trmnl::layout>
<x-trmnl::table>
<thead>
<tr>
<th>
<x-trmnl::title>Abfahrt</x-trmnl::title>
</th>
<th>
<x-trmnl::title>Aktuell</x-trmnl::title>
</th>
<th>
<x-trmnl::title>Zug</x-trmnl::title>
</th>
<th>
<x-trmnl::title>Ziel</x-trmnl::title>
</th>
<th>
<x-trmnl::title>Steig</x-trmnl::title>
</th>
</tr>
</thead>
<tbody>
@foreach($data['departures'] as $journey)
<tr>
<td>
<x-trmnl::label>{{ \Carbon\Carbon::parse($journey['scheduledTime'])->setTimezone(config('app.timezone'))->format('H:i') }}</x-trmnl::label>
</td>
@if($journey['isCancelled'])
<td>
<x-trmnl::label variant="inverted">{{ $journey->status }}</x-trmnl::label>
</td>
@else
<td>
<x-trmnl::label>{{ \Carbon\Carbon::parse($journey['time'])->setTimezone(config('app.timezone'))->format('H:i') }}</x-trmnl::label>
</td>
@endif
<td>
<x-trmnl::label
variant="{{ $journey['isCancelled'] ? 'gray-out' : '' }}">{{ $journey['train'] }}</x-trmnl::label>
</td>
<td>
<x-trmnl::label
variant="{{ $journey['isCancelled'] ? 'gray-out' : '' }}">{{ $journey['destination'] }}</x-trmnl::label>
</td>
<td>
<x-trmnl::label
variant="{{ $journey['isCancelled'] ? 'gray-out' : '' }}">{{ $journey['platform']}}</x-trmnl::label>
</td>
</tr>
@endforeach
</tbody>
</x-trmnl::table>
</x-trmnl::layout>
<x-trmnl::title-bar title="{{config('services.oebb.station_name')}}"
instance="aktualisiert: {{now()}}"/>
</x-trmnl::view>

View file

@ -0,0 +1,56 @@
{{--@dump($data)--}}
<x-trmnl::view>
<x-trmnl::layout class="layout--col gap--space-between">
<div class="grid" style="gap: 9px;">
<div class="row row--center col--span-3 col--end">
<img class="weather-image" style="max-height: 150px; margin:auto;" src="https://usetrmnl.com/images/weather/wi-thermometer.svg">
</div>
<div class="col col--span-3 col--end">
<div class="item h--full">
<div class="meta"></div>
<div class="justify-center">
<span class="value value--xxxlarge" data-fit-value="true">{{Arr::get($data, 'properties.timeseries.0.data.instant.details.air_temperature', 'N/A')}}</span>
<span class="label">Temperature</span>
</div>
</div>
</div>
<div class="col col--span-3 col--end gap--medium">
<div class="item">
<div class="meta"></div>
<div class="icon">
{{-- <img class="weather-icon" src="https://usetrmnl.com/images/weather/wi-thermometer.svg">--}}
</div>
<div class="content">
<span class="value value--small">{{Arr::get($data, 'properties.timeseries.0.data.instant.details.wind_speed', 'N/A')}}</span>
<span class="label">Wind Speed (km/h)</span>
</div>
</div>
<div class="item">
<div class="meta"></div>
<div class="icon">
{{-- <img class="weather-icon" src="https://usetrmnl.com/images/weather/wi-raindrops.svg">--}}
</div>
<div class="content">
<span class="value value--small">{{Arr::get($data, 'properties.timeseries.0.data.instant.details.relative_humidity', 'N/A')}}%</span>
<span class="label">Humidity</span>
</div>
</div>
<div class="item">
<div class="meta"></div>
<div class="icon">
{{-- <img class="weather-icon" src="https://usetrmnl.com/images/weather/wi-day-sunny.svg">--}}
</div>
<div class="content">
<span class="value value--xsmall">{{Str::title(Arr::get($data, 'properties.timeseries.0.data.next_1_hours.summary.symbol_code', 'N/A'))}}</span>
<span class="label">Right Now</span>
</div>
</div>
</div>
</div>
</x-trmnl::layout>
<x-trmnl::title-bar title="Weather Vienna"
instance="updated: {{now()}}"/>
</x-trmnl::view>