feat: added recipe Sunrise/Sunset

This commit is contained in:
Benjamin Nussbaum 2025-05-13 20:57:39 +02:00
parent d572c738cc
commit 9cb808dee6
3 changed files with 136 additions and 0 deletions

View file

@ -106,5 +106,24 @@ class ExampleRecipesSeeder extends Seeder
'flux_icon_name' => 'thermometer', 'flux_icon_name' => 'thermometer',
] ]
); );
Plugin::updateOrCreate(
[
'uuid' => 'be5f7e1f-3ad8-4d66-93b2-36f7d6dcbd80',
'name' => 'Sunrise/Sunset',
'user_id' => $user_id,
'data_payload' => null,
'data_stale_minutes' => 720,
'data_strategy' => 'polling',
'polling_url' => 'https://suntracker.me/?lat=48.2083&lon=16.3731',
'polling_verb' => 'get',
'polling_header' => null,
'render_markup' => null,
'render_markup_view' => 'recipes.sunrise-sunset',
'detail_view_route' => null,
'icon_url' => null,
'flux_icon_name' => 'sunrise',
]
);
} }
} }

View file

@ -0,0 +1,48 @@
{{-- 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="M12 2v8" />
<path d="m4.93 10.93 1.41 1.41" />
<path d="M2 18h2" />
<path d="M20 18h2" />
<path d="m19.07 10.93-1.41 1.41" />
<path d="M22 22H2" />
<path d="m8 6 4-4 4 4" />
<path d="M16 18a4 4 0 0 0-8 0" />
</svg>

View file

@ -0,0 +1,69 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=Inter:300,400,500" rel="stylesheet"/>
<link rel="stylesheet" href="https://usetrmnl.com/css/latest/plugins.css">
<script src="https://usetrmnl.com/js/latest/plugins.js"></script>
<title>plugin</title>
<style>
.trmnl .content .description {
word-break: break-word;
}
</style>
</head>
<body class="environment trmnl">
<div class="screen">
<div class="view view--full">
<div class="layout layout--col gap--space-between">
<!-- Top row: 2 columns -->
<div class="grid">
<!-- Sunrise Time - Left column -->
<div class="item col-span-6">
<div class="content text--center flex flex--col flex--center-xy">
<span class="label label--large font--bold text--center">Sunrise</span>
<span class="value value--large text--center font--normal">
{{ data.today.sunrise }}
</span>
</div>
</div>
<!-- Sunset Time - Right column -->
<div class="item col-span-6">
<div class="content text--center flex flex--col flex--center-xy">
<span class="label label--large font--bold text--center">Sunset</span>
<span class="value value--large text--center font--normal">
{{ data.today.sunset }}
</span>
</div>
</div>
</div>
<!-- Bottom row: 2 columns -->
<div class="grid">
<!-- Day Progress - Left column -->
<!-- Tomorrow's Times - Right column -->
<div class="item col-span-6">
<div class="content text--center flex flex--col flex--center-xy">
<span class="label label--large font--bold text--center">Tomorrow</span>
<div class="value value--medium text--center font--normal">
<div>
<span>↑ {{ data.tomorrow.sunrise }}</span>
</div>
<div>
<span>↓ {{ data.tomorrow.sunset }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Title Bar -->
<div class="title_bar">
<span class="title">Sunrise & Sunset</span>
</div>
</div>
</div>
</body>
</html>