@extends('layouts.app') @section('title', 'Informasi Cuaca | Tanam Pepaya') @section('page_title', 'Informasi Cuaca') @push('head') @endpush @section('content') @if(! $ok)
Gagal mengambil data cuaca.
{{ $error }}
@endif @php $code = (int) ($current['code'] ?? 0); $isRain = in_array($code, [51,53,55,56,57,61,63,65,66,67,80,81,82,95,96,99], true); $tempsForScale = array_map(fn ($d) => (float) ($d['temp_max'] ?? 0), $forecast); $minsForScale = array_map(fn ($d) => (float) ($d['temp_min'] ?? 0), $forecast); $globalMin = count($minsForScale) ? min($minsForScale) : 0; $globalMax = count($tempsForScale) ? max($tempsForScale) : 0; $range = max(1, $globalMax - $globalMin); @endphp
@if($isRain)
@endif
{{ $now->format('H.i') }} {{ number_format($lat, 4) }}, {{ number_format($lon, 4) }}
{{ $locationName }}
{{ $locationSub }}
{{ $current['temp_c'] !== null ? round((float) $current['temp_c']) : '-' }}°
{{ $current['desc'] }}
T:{{ $todayMax !== null ? round((float) $todayMax) : '-' }}°  R:{{ $todayMin !== null ? round((float) $todayMin) : '-' }}°
Sekarang
@forelse($hourlyItems as $it)
{{ $it['label'] }}
@if($it['type'] === 'hour') @if($it['pop'] !== null && (int) $it['pop'] > 0)
{{ (int) $it['pop'] }}%
@else
 
@endif
{{ round((float) $it['temp']) }}°
@else
{{ $it['text'] }}
 
@endif
@empty
Belum ada data jam-jaman.
@endforelse
Ringkasan
Kondisi saat ini dan indikator cuaca.
{{ $timezoneLabel }}
Kelembaban
{{ $current['humidity'] !== null ? $current['humidity'].'%' : '-' }}
Curah Hujan
{{ $current['precip_mm'] !== null ? $current['precip_mm'].' mm' : '-' }}
Kelembapan Tanah
{{ $current['soil_moisture'] !== null ? round(((float) $current['soil_moisture']) * 100).'%' : '-' }}
@if($current['soil_moisture_depth'])
{{ $current['soil_moisture_depth'] }}
@endif
Kondisi
{{ $current['desc'] }}
Rekomendasi
@if(count($recommendations['warnings']) > 0)
Peringatan
    @foreach($recommendations['warnings'] as $w)
  • {{ $w }}
  • @endforeach
@endif
Saran
    @foreach($recommendations['suggestions'] as $s)
  • {{ $s }}
  • @endforeach
Ramalan {{ count($forecast) }} Hari
{{ $days }} hari
@forelse($forecast as $d) @php $minT = (float) $d['temp_min']; $maxT = (float) $d['temp_max']; $left = (($minT - $globalMin) / $range) * 100; $width = max(6, (($maxT - $minT) / $range) * 100); @endphp
{{ \Carbon\Carbon::parse($d['date'])->translatedFormat('D') }}
{{ round((float) $d['precip_mm']) }} mm
{{ round($minT) }}°
{{ round($maxT) }}°
@empty
Belum ada data ramalan.
@endforelse
Ubah Lokasi
Masukkan koordinat atau ubah nama lokasi agar tampilan menyesuaikan daerahmu.
@endsection