Spaces:
Sleeping
Sleeping
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Edit Data Siswa</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"> | |
| <style> | |
| :root { | |
| --primary-color: #6d28d9; /* Purple */ | |
| --secondary-color: #7c3aed; | |
| --accent-color: #4f46e5; | |
| --success-color: #10b981; | |
| --danger-color: #ef4444; | |
| --background-color: #f3f4f6; | |
| --card-color: #ffffff; | |
| --text-color: #374151; | |
| --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); | |
| } | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| background-color: var(--background-color); | |
| color: var(--text-color); | |
| min-height: 100vh; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| padding: 2rem; | |
| } | |
| .container { | |
| width: 100%; | |
| max-width: 600px; | |
| background-color: var(--card-color); | |
| border-radius: 1rem; | |
| box-shadow: var(--shadow); | |
| overflow: hidden; | |
| transition: transform 0.3s ease; | |
| } | |
| .container:hover { | |
| transform: translateY(-5px); | |
| } | |
| .header { | |
| background-color: var(--primary-color); | |
| color: white; | |
| padding: 1.5rem; | |
| text-align: center; | |
| position: relative; | |
| } | |
| .header h1 { | |
| font-size: 1.8rem; | |
| margin-bottom: 0.5rem; | |
| } | |
| .header p { | |
| font-size: 0.9rem; | |
| opacity: 0.9; | |
| } | |
| .form-container { | |
| padding: 2rem; | |
| } | |
| .form-group { | |
| margin-bottom: 1.5rem; | |
| position: relative; | |
| } | |
| .form-group i { | |
| position: absolute; | |
| top: 42px; | |
| left: 12px; | |
| color: var(--primary-color); | |
| } | |
| label { | |
| display: block; | |
| margin-bottom: 0.5rem; | |
| font-weight: 600; | |
| color: var(--text-color); | |
| font-size: 0.95rem; | |
| } | |
| input[type="text"], | |
| input[type="date"] { | |
| width: 100%; | |
| padding: 0.8rem 0.8rem 0.8rem 2.5rem; | |
| border: 1px solid #e5e7eb; | |
| border-radius: 0.5rem; | |
| font-size: 1rem; | |
| transition: all 0.3s ease; | |
| background-color: #f9fafb; | |
| } | |
| input[type="text"]:focus, | |
| input[type="date"]:focus { | |
| border-color: var(--primary-color); | |
| box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.2); | |
| outline: none; | |
| } | |
| input[type="date"] { | |
| padding-left: 2.5rem; | |
| } | |
| .button-group { | |
| display: flex; | |
| justify-content: space-between; | |
| margin-top: 2rem; | |
| } | |
| .btn { | |
| padding: 0.8rem 1.5rem; | |
| border: none; | |
| border-radius: 0.5rem; | |
| font-weight: 600; | |
| cursor: pointer; | |
| transition: all 0.3s ease; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| font-size: 1rem; | |
| } | |
| .btn i { | |
| margin-right: 0.5rem; | |
| } | |
| .btn-primary { | |
| background-color: var(--primary-color); | |
| color: white; | |
| flex: 1; | |
| margin-right: 1rem; | |
| } | |
| .btn-primary:hover { | |
| background-color: var(--secondary-color); | |
| transform: translateY(-2px); | |
| box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); | |
| } | |
| .btn-secondary { | |
| background-color: #e5e7eb; | |
| color: #4b5563; | |
| } | |
| .btn-secondary:hover { | |
| background-color: #d1d5db; | |
| transform: translateY(-2px); | |
| box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); | |
| } | |
| /* Animation for form input focus */ | |
| @keyframes pulse { | |
| 0% { transform: scale(1); } | |
| 50% { transform: scale(1.02); } | |
| 100% { transform: scale(1); } | |
| } | |
| .form-group:focus-within { | |
| animation: pulse 0.5s ease; | |
| } | |
| /* Responsive */ | |
| @media (max-width: 640px) { | |
| .container { | |
| border-radius: 0; | |
| } | |
| .button-group { | |
| flex-direction: column; | |
| } | |
| .btn-primary { | |
| margin-right: 0; | |
| margin-bottom: 1rem; | |
| } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <div class="header"> | |
| <h1>Edit Data Siswa</h1> | |
| <p>Perbarui informasi siswa</p> | |
| </div> | |
| <div class="form-container"> | |
| <form action="{{ url_for('edit_siswa', id=student.NRP if student.NRP is defined else student.nim) }}" method="POST"> | |
| <div class="form-group"> | |
| <label for="NRP"><i class="fas fa-id-card"></i> NRP/NIM:</label> | |
| <input type="text" id="NRP" name="NRP" value="{{ student.NRP if student.NRP is defined else student.nim }}" readonly> | |
| </div> | |
| <div class="form-group"> | |
| <label for="nama_lengkap"><i class="fas fa-user"></i> Nama Lengkap:</label> | |
| <input type="text" id="nama_lengkap" name="nama_lengkap" value="{{ student.nama_lengkap }}" required> | |
| </div> | |
| <div class="form-group"> | |
| <label for="no_hp"><i class="fas fa-phone"></i> Nomor HP:</label> | |
| <input type="text" id="no_hp" name="no_hp" value="{{ student.no_hp }}" required> | |
| </div> | |
| <div class="form-group"> | |
| <label for="tanggal_lahir"><i class="fas fa-calendar-alt"></i> Tanggal Lahir:</label> | |
| <input type="date" id="tanggal_lahir" name="tanggal_lahir" | |
| value="{{ student.tanggal_lahir.strftime('%Y-%m-%d') if student.tanggal_lahir is not string else student.tanggal_lahir }}" required> | |
| </div> | |
| <div class="button-group"> | |
| <button type="submit" class="btn btn-primary"> | |
| <i class="fas fa-save"></i> Simpan Perubahan | |
| </button> | |
| <a href="{{ url_for('index') }}" class="btn btn-secondary"> | |
| <i class="fas fa-arrow-left"></i> Batal | |
| </a> | |
| </div> | |
| </form> | |
| </div> | |
| </div> | |
| <script> | |
| // Animasi sederhana untuk input saat form loading | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const inputs = document.querySelectorAll('input'); | |
| inputs.forEach((input, index) => { | |
| setTimeout(() => { | |
| input.style.opacity = '0'; | |
| input.style.transform = 'translateY(20px)'; | |
| input.style.transition = 'all 0.5s ease'; | |
| setTimeout(() => { | |
| input.style.opacity = '1'; | |
| input.style.transform = 'translateY(0)'; | |
| }, 100); | |
| }, index * 100); | |
| }); | |
| }); | |
| </script> | |
| </body> | |
| </html> |