272 lines
9.2 KiB
PHP
272 lines
9.2 KiB
PHP
<x-app-layout>
|
|
<!-- Header Halaman -->
|
|
<x-slot name="header">
|
|
<div class="header-container-css">
|
|
<span class="icon-pulse-css">🕒</span>
|
|
<h2 class="title-grad-css">Riwayat Terjemahan Anda</h2>
|
|
</div>
|
|
</x-slot>
|
|
|
|
<!-- STYLE LEMBARAN CSS UTUH (MURNI CUSTOM CSS - BEBAS DEPENDENSI TAILWIND) -->
|
|
<style>
|
|
/* 1. VARIABEL WARNA & TEMA PREMIUM COHERENT */
|
|
:root {
|
|
--primary-blue: #0052cc;
|
|
--primary-glow: rgba(0, 82, 204, 0.15);
|
|
--neon-sky: #00b3ff;
|
|
--light-ice: #f2f7ff;
|
|
--clean-white: #ffffff;
|
|
--text-main: #1e293b;
|
|
--text-muted: #64748b;
|
|
--border-soft: #e2e8f0;
|
|
--card-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
|
|
--grad-accent: linear-gradient(135deg, #0052cc 0%, #00b3ff 100%);
|
|
}
|
|
|
|
/* 2. BASE CONTAINER & GRID LATAR BELAKANG */
|
|
.hs-wrapper-css {
|
|
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
|
background-color: #f8fafc;
|
|
min-height: 100vh;
|
|
padding: 40px 20px;
|
|
position: relative;
|
|
overflow: hidden;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.hs-container-css {
|
|
max-width: 800px;
|
|
margin: 0 auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 30px;
|
|
position: relative;
|
|
z-index: 10;
|
|
}
|
|
|
|
/* 3. GELEMBUNG LATAR BELAKANG MELAYANG (FLOATING BLOBS) */
|
|
.blob-css {
|
|
position: absolute;
|
|
border-radius: 50%;
|
|
filter: blur(80px);
|
|
pointer-events: none;
|
|
z-index: 1;
|
|
opacity: 0.25;
|
|
}
|
|
.blob-1 {
|
|
width: 400px;
|
|
height: 400px;
|
|
background-color: #93c5fd;
|
|
top: 10%;
|
|
left: -15%;
|
|
animation: float-slow 8s infinite ease-in-out;
|
|
}
|
|
.blob-2 {
|
|
width: 500px;
|
|
height: 500px;
|
|
background-color: #bae6fd;
|
|
bottom: 10%;
|
|
right: -15%;
|
|
animation: float-slow-rev 10s infinite ease-in-out;
|
|
}
|
|
|
|
/* 4. PAPAN KARTU UTAMA (MAIN CARD) */
|
|
.hs-card-css {
|
|
background: var(--clean-white);
|
|
border: 1px solid var(--border-soft);
|
|
border-radius: 32px;
|
|
padding: 35px;
|
|
box-shadow: var(--card-shadow);
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.hs-card-css:hover {
|
|
box-shadow: 0 20px 40px rgba(0, 82, 204, 0.05);
|
|
border-color: rgba(0, 82, 204, 0.1);
|
|
}
|
|
|
|
.hs-card-title {
|
|
font-size: 20px;
|
|
font-weight: 900;
|
|
color: var(--text-main);
|
|
margin: 0 0 24px 0;
|
|
letter-spacing: -0.5px;
|
|
border-left: 5px solid var(--primary-blue);
|
|
padding-left: 12px;
|
|
}
|
|
|
|
/* 5. ITEM DAFTAR RIWAYAT (HISTORY LIST CARDS) */
|
|
.hs-list-css {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 16px;
|
|
}
|
|
|
|
.hs-item-css {
|
|
background: var(--clean-white);
|
|
border: 1px solid var(--border-soft);
|
|
border-radius: 20px;
|
|
padding: 20px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
gap: 20px;
|
|
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
position: relative;
|
|
}
|
|
|
|
.hs-item-css:hover {
|
|
border-color: var(--primary-blue);
|
|
background-color: var(--light-ice);
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 10px 20px rgba(0, 82, 204, 0.03);
|
|
}
|
|
|
|
.hs-text-block {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
}
|
|
|
|
.hs-sentence-text {
|
|
font-size: 16px;
|
|
font-weight: 800;
|
|
color: var(--text-main);
|
|
margin: 0;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.hs-date-text {
|
|
font-size: 10px;
|
|
font-weight: 700;
|
|
color: var(--text-muted);
|
|
letter-spacing: 0.2px;
|
|
}
|
|
|
|
/* Badge Sukses Terjemah */
|
|
.hs-badge-status {
|
|
font-size: 9px;
|
|
font-weight: 950;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
background-color: #e6fbf1;
|
|
color: #059669;
|
|
border: 1px solid rgba(5, 150, 105, 0.1);
|
|
padding: 6px 14px;
|
|
border-radius: 100px;
|
|
shrink-0: true;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* Keadaan Kosong (Empty State) */
|
|
.hs-empty-state {
|
|
text-align: center;
|
|
padding: 40px 20px;
|
|
color: var(--text-muted);
|
|
font-style: italic;
|
|
font-size: 13px;
|
|
}
|
|
|
|
/* 6. KEYFRAMES ANIMASI */
|
|
@keyframes float-slow {
|
|
0%, 100% { transform: translateY(0) scale(1); }
|
|
50% { transform: translateY(-15px) scale(1.03); }
|
|
}
|
|
@keyframes float-slow-rev {
|
|
0%, 100% { transform: translateY(0) scale(1); }
|
|
50% { transform: translateY(15px) scale(0.97); }
|
|
}
|
|
@keyframes bounce-slow {
|
|
0%, 100% { transform: translateY(0); }
|
|
50% { transform: translateY(-4px); }
|
|
}
|
|
|
|
/* Header Navigation Styles Coherent */
|
|
.header-container-css {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
.icon-pulse-css {
|
|
font-size: 24px;
|
|
animation: bounce-slow 2s infinite ease-in-out;
|
|
}
|
|
.title-grad-css {
|
|
font-size: 20px;
|
|
font-weight: 900;
|
|
background: linear-gradient(to right, var(--primary-blue), var(--neon-sky));
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
margin: 0;
|
|
letter-spacing: -0.5px;
|
|
}
|
|
</style>
|
|
|
|
<!-- WRAPPER UTAMA RIWAYAT DENGAN GELEMBUNG LATAR BELAKANG -->
|
|
<div class="hs-wrapper-css">
|
|
<!-- Blobs Background -->
|
|
<div class="blob-css blob-1"></div>
|
|
<div class="blob-css blob-2"></div>
|
|
|
|
<div class="hs-container-css">
|
|
|
|
<!-- MAIN CONTAINER CARD -->
|
|
<div class="hs-card-css">
|
|
<h3 class="hs-card-title">Daftar Susunan Huruf Tersimpan</h3>
|
|
|
|
<!-- Kondisi Pengecekan Riwayat Kosong -->
|
|
<!-- Daftar Item Riwayat -->
|
|
<div class="hs-list-css">
|
|
@foreach($histories as $data)
|
|
<div class="hs-item-css" style="display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 25px;">
|
|
|
|
{{-- 1. TEKS KATA UTUH DI ATAS (CONTOH: HALO DUNIA) --}}
|
|
<div style="width: 100%; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f1f5f9; padding-bottom: 12px;">
|
|
<p class="hs-sentence-text" style="font-size: 22px; font-weight: 900; letter-spacing: 1px; color: var(--text-main);">
|
|
"{{ $data->hasil_teks }}"
|
|
</p>
|
|
<span class="hs-badge-status">Sukses Terjemah</span>
|
|
</div>
|
|
|
|
{{-- 2. PENJABARAN HURUF & DERETAN FOTO KECIL (MENDUKUNG SPASI) --}}
|
|
@php
|
|
$photos = json_decode($data->gambar, true) ?? [];
|
|
$letters = str_split($data->hasil_teks);
|
|
$photoIndex = 0; // Penanda urutan foto agar tidak loncat saat ada spasi
|
|
@endphp
|
|
|
|
<div style="display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; margin-top: 4px;">
|
|
@foreach($letters as $char)
|
|
<div style="display: flex; flex-direction: column; align-items: center; gap: 6px;">
|
|
{{-- Huruf atau Simbol Spasi di Tengah --}}
|
|
<span style="font-size: 16px; font-weight: 800; color: {{ $char === ' ' ? 'transparent' : 'var(--primary-blue)' }};">
|
|
{{ $char === ' ' ? '_' : $char }}
|
|
</span>
|
|
|
|
{{-- Jika bukan spasi, ambil dan tampilkan foto kecilnya --}}
|
|
@if($char !== ' ')
|
|
<div style="width: 55px; height: 55px; border-radius: 8px; overflow: hidden; background: #000; border: 1px solid var(--border-soft); box-shadow: 0 2px 4px rgba(0,0,0,0.05);">
|
|
<img src="{{ asset($photos[$photoIndex] ?? '') }}" style="width: 100%; height: 100%; object-fit: cover;" alt="Foto Isyarat">
|
|
</div>
|
|
@php $photoIndex++; @endphp
|
|
@else
|
|
{{-- Spasi memberikan jarak kosong agar pemisah kata tetap rapi --}}
|
|
<div style="width: 15px; height: 55px;"></div>
|
|
@endif
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
{{-- 3. TANGGAL & WAKTU DI BAGIAN PALING BAWAH --}}
|
|
<div style="width: 100%; margin-top: 4px;">
|
|
<span class="hs-date-text">
|
|
🕒 {{ $data->created_at->format('d M Y, H:i') }} ({{ $data->created_at->diffForHumans() }})
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-app-layout> |