Files
Kent-logistics-Laravel/resources/views/admin/invoice_edit.blade.php
Utkarsh Khedkar 837f4fe566 Invoice Frontend
2025-11-18 14:35:58 +05:30

481 lines
13 KiB
PHP

@extends('admin.layouts.app')
@section('page-title', 'Edit Invoice')
@section('content')
<style>
/* World-Class UI Design System - No Blur Effects */
:root {
--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
--glass-bg: #ffffff;
--glass-border: rgba(255, 255, 255, 0.2);
--shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
--shadow-medium: 0 12px 48px rgba(0, 0, 0, 0.15);
--shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.2);
}
/* Enhanced Card - No Blur */
.card {
background: var(--glass-bg);
border-radius: 24px;
box-shadow: var(--shadow-strong);
border: 1px solid #e4e6ef;
animation: cardEntrance 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
position: relative;
overflow: hidden;
}
.card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(45deg,
rgba(102, 126, 234, 0.03) 0%,
rgba(118, 75, 162, 0.03) 50%,
rgba(16, 185, 129, 0.03) 100%);
pointer-events: none;
}
@keyframes cardEntrance {
0% {
opacity: 0;
transform: translateY(30px) scale(0.95);
}
100% {
opacity: 1;
transform: translateY(0) scale(1);
}
}
/* Premium Card Header */
.card-header {
background: var(--primary-gradient);
color: white;
border-bottom: none;
padding: 28px 35px;
position: relative;
overflow: hidden;
}
.card-header::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: linear-gradient(45deg,
transparent 0%,
rgba(255, 255, 255, 0.1) 50%,
transparent 100%);
animation: headerShimmer 6s infinite linear;
transform: rotate(45deg);
}
@keyframes headerShimmer {
0% { transform: translateX(-100%) rotate(45deg); }
100% { transform: translateX(100%) rotate(45deg); }
}
.card-header h4 {
margin: 0;
font-weight: 800;
font-size: 1.6rem;
position: relative;
display: flex;
align-items: center;
gap: 12px;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.card-header h4::before {
content: '✨';
font-size: 1.4rem;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
.card-body {
padding: 35px;
background: #f8fafc;
position: relative;
}
/* World-Class Form Elements - No Blur */
.form-label {
font-weight: 700;
color: #1e293b;
margin-bottom: 10px;
font-size: 0.95rem;
display: flex;
align-items: center;
gap: 8px;
text-transform: uppercase;
letter-spacing: 0.5px;
position: relative;
}
.form-label::before {
content: '';
width: 4px;
height: 16px;
background: var(--primary-gradient);
border-radius: 2px;
display: inline-block;
}
.form-control, .form-select {
border: 2px solid #e2e8f0;
border-radius: 16px;
padding: 16px 20px;
font-size: 1rem;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
background: #ffffff;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
position: relative;
}
.form-control:focus, .form-select:focus {
border-color: #667eea;
box-shadow:
0 0 0 4px rgba(102, 126, 234, 0.15),
0 8px 24px rgba(102, 126, 234, 0.2),
inset 0 1px 0 rgba(255, 255, 255, 0.8);
background: #ffffff;
transform: translateY(-2px) scale(1.02);
animation: inputGlow 2s infinite;
}
@keyframes inputGlow {
0%, 100% { box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 8px 24px rgba(102, 126, 234, 0.2); }
50% { box-shadow: 0 0 0 6px rgba(102, 126, 234, 0.1), 0 12px 32px rgba(102, 126, 234, 0.25); }
}
.form-control:hover, .form-select:hover {
border-color: #cbd5e1;
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
/* Enhanced Grid System */
.row.g-3 {
margin: -15px;
}
.row.g-3 > [class*="col-"] {
padding: 15px;
animation: formElementEntrance 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
@keyframes formElementEntrance {
0% {
opacity: 0;
transform: translateY(25px) scale(0.9);
}
100% {
opacity: 1;
transform: translateY(0) scale(1);
}
}
/* Staggered Animation Delays */
.row.g-3 > [class*="col-"]:nth-child(1) { animation-delay: 0.1s; }
.row.g-3 > [class*="col-"]:nth-child(2) { animation-delay: 0.2s; }
.row.g-3 > [class*="col-"]:nth-child(3) { animation-delay: 0.3s; }
.row.g-3 > [class*="col-"]:nth-child(4) { animation-delay: 0.4s; }
.row.g-3 > [class*="col-"]:nth-child(5) { animation-delay: 0.5s; }
.row.g-3 > [class*="col-"]:nth-child(6) { animation-delay: 0.6s; }
.row.g-3 > [class*="col-"]:nth-child(7) { animation-delay: 0.7s; }
.row.g-3 > [class*="col-"]:nth-child(8) { animation-delay: 0.8s; }
/* Premium Textarea */
textarea.form-control {
resize: vertical;
min-height: 120px;
line-height: 1.6;
background: #ffffff;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
textarea.form-control:focus {
transform: translateY(-2px) scale(1.01);
box-shadow:
0 0 0 4px rgba(102, 126, 234, 0.15),
0 12px 32px rgba(102, 126, 234, 0.2);
}
/* World-Class Button Design - No Blur */
.btn-success {
background: var(--success-gradient);
border: none;
padding: 18px 45px;
border-radius: 16px;
color: white;
font-weight: 700;
font-size: 1.1rem;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: var(--shadow-medium);
position: relative;
overflow: hidden;
}
.btn-success::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg,
transparent,
rgba(255, 255, 255, 0.4),
transparent);
transition: left 0.6s ease;
}
.btn-success:hover::before {
left: 100%;
}
.btn-success:hover {
transform: translateY(-4px) scale(1.05);
box-shadow:
0 16px 40px rgba(16, 185, 129, 0.4),
0 0 0 1px rgba(255, 255, 255, 0.1);
background: var(--success-gradient);
}
.btn-success:active {
transform: translateY(-1px) scale(1.02);
transition: all 0.1s ease;
}
/* Enhanced Select Styling */
.form-select {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
background-position: right 20px center;
background-repeat: no-repeat;
background-size: 18px;
padding-right: 50px;
cursor: pointer;
appearance: none;
}
/* Advanced Loading Animation */
.btn-success.loading {
pointer-events: none;
padding-right: 60px;
}
.btn-success.loading::after {
content: '';
position: absolute;
right: 20px;
top: 50%;
width: 20px;
height: 20px;
margin-top: -10px;
border: 2px solid transparent;
border-top: 2px solid white;
border-radius: 50%;
animation: spin 1s linear infinite;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Premium Focus States */
.form-control:focus-visible,
.form-select:focus-visible,
.btn-success:focus-visible {
outline: 3px solid #667eea;
outline-offset: 2px;
border-radius: 8px;
}
/* Advanced Responsive Design */
@media (max-width: 768px) {
.card-body {
padding: 25px 20px;
}
.card-header {
padding: 22px 25px;
}
.card-header h4 {
font-size: 1.4rem;
}
.btn-success {
width: 100%;
padding: 16px 30px;
font-size: 1rem;
}
.form-control, .form-select {
padding: 14px 16px;
}
}
/* Micro-interactions for Enhanced UX */
.form-control:valid {
border-left: 3px solid #10b981;
}
.form-control:invalid:not(:focus):not(:placeholder-shown) {
border-left: 3px solid #ef4444;
animation: shake 0.5s ease-in-out;
}
@keyframes shake {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-5px); }
75% { transform: translateX(5px); }
}
/* Smooth scrolling for better UX */
html {
scroll-behavior: smooth;
}
/* Performance optimized animations */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
</style>
<div class="card shadow-sm">
<div class="card-header bg-light">
<h4>Edit Invoice</h4>
</div>
<div class="card-body">
<form action="{{ route('admin.invoices.update', $invoice->id) }}" method="POST">
@csrf
<div class="row g-3">
<div class="col-md-4">
<label class="form-label">Invoice Date</label>
<input type="date" class="form-control"
name="invoice_date"
value="{{ $invoice->invoice_date }}" required>
</div>
<div class="col-md-4">
<label class="form-label">Due Date</label>
<input type="date" class="form-control"
name="due_date"
value="{{ $invoice->due_date }}" required>
</div>
<div class="col-md-4">
<label class="form-label">Payment Method</label>
<input type="text" class="form-control"
name="payment_method"
value="{{ $invoice->payment_method }}">
</div>
<div class="col-md-4">
<label class="form-label">Reference No</label>
<input type="text" class="form-control"
name="reference_no"
value="{{ $invoice->reference_no }}">
</div>
<div class="col-md-4">
<label class="form-label">Final Amount (Editable)</label>
<input type="number" step="0.01" class="form-control"
name="final_amount"
value="{{ $invoice->final_amount }}" required>
</div>
<div class="col-md-4">
<label class="form-label">GST Percentage</label>
<input type="number" step="0.01" class="form-control"
name="gst_percent"
value="{{ $invoice->gst_percent }}" required>
</div>
<div class="col-md-4">
<label class="form-label">Status</label>
<select class="form-select" name="status" required>
<option value="pending" @selected($invoice->status=='pending')>Pending</option>
<option value="paid" @selected($invoice->status=='paid')>Paid</option>
<option value="overdue" @selected($invoice->status=='overdue')>Overdue</option>
</select>
</div>
<div class="col-md-12">
<label class="form-label">Notes</label>
<textarea class="form-control" rows="3" name="notes">
{{ $invoice->notes }}
</textarea>
</div>
<div class="col-md-12 text-end mt-3">
<button type="submit" class="btn btn-success">
Update Invoice
</button>
</div>
</div>
</form>
</div>
</div>
<script>
// World-Class Interactive Enhancements - No Parallax
document.addEventListener('DOMContentLoaded', function() {
const form = document.querySelector('form');
const submitBtn = document.querySelector('.btn-success');
const inputs = document.querySelectorAll('input, select, textarea');
// Enhanced form submission
form.addEventListener('submit', function(e) {
submitBtn.classList.add('loading');
submitBtn.innerHTML = 'Updating Invoice...';
// Add a small delay to show loading state
setTimeout(() => {
if (!form.checkValidity()) {
submitBtn.classList.remove('loading');
submitBtn.innerHTML = 'Update Invoice';
}
}, 100);
});
// Real-time validation with visual feedback
inputs.forEach(input => {
input.addEventListener('input', function() {
if (this.checkValidity()) {
this.style.borderLeftColor = '#10b981';
} else {
this.style.borderLeftColor = '#ef4444';
}
});
// Add focus effects
input.addEventListener('focus', function() {
this.parentElement.style.transform = 'translateY(-2px)';
});
input.addEventListener('blur', function() {
this.parentElement.style.transform = 'translateY(0)';
});
});
});
</script>
@endsection