Files
verifikator/resources/views/auth/login.blade.php
T

575 lines
25 KiB
PHP

<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Login | {{ config('app.name') }}</title>
<!-- Font & Icons -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
<!-- CSS Notifikasi -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/simple-notify/dist/simple-notify.css" />
<!-- App Vite (Tailwind CSS v4 & High-Legibility Tokens) -->
@vite(['resources/css/app.css', 'resources/js/app.js'])
<style>
/* Modern Micro-Animations & Glow Effects */
@keyframes float-slow {
0%, 100% {
transform: translateY(0px) rotate(0deg);
}
50% {
transform: translateY(-10px) rotate(1deg);
}
}
@keyframes pulse-glow {
0%, 100% {
opacity: 0.35;
transform: scale(1);
}
50% {
opacity: 0.65;
transform: scale(1.1);
}
}
@keyframes card-entrance {
0% {
opacity: 0;
transform: translateY(28px) scale(0.98);
}
100% {
opacity: 1;
transform: translateY(0) scale(1);
}
}
@keyframes shake {
0%, 100% { transform: translateX(0); }
20%, 60% { transform: translateX(-5px); }
40%, 80% { transform: translateX(5px); }
}
.animate-float-slow {
animation: float-slow 6s ease-in-out infinite;
}
.animate-pulse-glow {
animation: pulse-glow 8s ease-in-out infinite;
}
.animate-card-entrance {
animation: card-entrance 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
/* Glassmorphism */
.glass-card {
background: rgba(255, 255, 255, 0.98);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
}
/* Slider Captcha Modern Overrides */
#slider-captcha-container .slider-captcha-wrapper {
border-radius: 14px;
}
#slider-captcha-container .slider-captcha-canvas-wrapper {
border: 1.5px solid #e2e8f0 !important;
border-radius: 14px !important;
box-shadow: 0 3px 10px -2px rgba(15, 23, 42, 0.06);
overflow: hidden;
background: #f8fafc !important;
}
#slider-captcha-container .slider-control {
margin-top: 14px !important;
height: 44px !important;
background: #f8fafc !important;
border: 1.5px solid #e2e8f0 !important;
border-radius: 12px !important;
transition: all 0.2s ease;
}
#slider-captcha-container .slider-control:hover {
border-color: #93c5fd !important;
background: #eff6ff !important;
}
#slider-captcha-container .slider-track {
color: #475569 !important;
font-size: 13px !important;
font-weight: 600 !important;
letter-spacing: 0.01em;
}
#slider-captcha-container .slider-button {
width: 44px !important;
height: 44px !important;
border-radius: 10px !important;
background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s !important;
}
#slider-captcha-container .slider-button:hover {
box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45) !important;
}
#slider-captcha-container .slider-refresh {
margin-top: 10px !important;
padding: 9px 16px !important;
background: #ffffff !important;
border: 1.5px solid #e2e8f0 !important;
border-radius: 12px !important;
color: #2563eb !important;
font-weight: 600 !important;
font-size: 12.5px !important;
transition: all 0.2s ease !important;
}
#slider-captcha-container .slider-refresh:hover {
background: #eff6ff !important;
border-color: #bfdbfe !important;
transform: translateY(-1px);
color: #1d4ed8 !important;
}
/* Input error effect */
.input-error {
border-color: #ef4444 !important;
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
animation: shake 0.35s ease;
}
</style>
</head>
<body class="min-h-screen bg-slate-950 font-sans text-slate-800 antialiased flex items-center justify-center p-4 sm:p-6 lg:p-8 relative overflow-x-hidden selection:bg-blue-600 selection:text-white">
<!-- Ambient Glowing Orbs Background -->
<div class="fixed inset-0 pointer-events-none overflow-hidden z-0">
<!-- Top Left Cyan/Blue Glow -->
<div class="absolute -top-40 -left-40 w-96 h-96 sm:w-[520px] sm:h-[520px] bg-blue-600/25 rounded-full blur-3xl animate-pulse-glow"></div>
<!-- Bottom Right Indigo/Navy Glow -->
<div class="absolute -bottom-40 -right-40 w-96 h-96 sm:w-[580px] sm:h-[580px] bg-indigo-600/20 rounded-full blur-3xl animate-pulse-glow" style="animation-delay: -3s;"></div>
<!-- Center Subtle Blue Ambient -->
<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-80 h-80 bg-blue-500/15 rounded-full blur-3xl"></div>
<!-- Grid Pattern Overlay -->
<div class="absolute inset-0 bg-[radial-gradient(#334155_1px,transparent_1px)] [background-size:24px_24px] opacity-25"></div>
</div>
<!-- Main Login Card Container (Kompak & Proporsional) -->
<div class="w-full max-w-[740px] glass-card rounded-2xl shadow-2xl shadow-blue-950/40 border border-white/20 overflow-hidden relative z-10 animate-card-entrance grid grid-cols-1 md:grid-cols-12 min-h-[480px]">
<!-- Sisi Kiri: Brand & Visual Hero (5 Kolom) -->
<div class="md:col-span-5 relative bg-gradient-to-br from-blue-600 via-blue-700 to-indigo-900 p-6 sm:p-7 flex flex-col justify-between overflow-hidden text-white">
<!-- Decorative Vector Background -->
<div class="absolute -top-16 -right-16 w-48 h-48 bg-white/10 rounded-full blur-xl pointer-events-none"></div>
<div class="absolute -bottom-16 -left-16 w-52 h-52 bg-blue-400/20 rounded-full blur-xl pointer-events-none"></div>
<div class="absolute inset-0 bg-[radial-gradient(rgba(255,255,255,0.12)_1px,transparent_1px)] [background-size:16px_16px] pointer-events-none"></div>
<!-- Center Brand Section -->
<div class="relative z-10 my-6 sm:my-auto text-center flex flex-col items-center">
<!-- Logo Avatar with Floating Micro-animation -->
<div class="w-20 h-20 max-w-[80px] max-h-[80px] rounded-2xl bg-white/15 backdrop-blur-md p-3 flex items-center justify-center border border-white/30 shadow-lg shadow-blue-950/20 mb-3 animate-float-slow group shrink-0">
<img src="{{ asset('assets/images/logo-untan.png') }}" alt="Logo UNTAN" class="h-full w-full max-h-full max-w-full object-contain filter drop-shadow-md transition-transform duration-300 group-hover:scale-105">
</div>
<h1 class="text-xl sm:text-2xl font-extrabold tracking-tight mb-1 text-white">Verifikator</h1>
<p class="text-xs font-medium text-blue-100/90 leading-relaxed max-w-[200px]">
Sistem Verifikasi Remunerasi<br>Universitas Tanjungpura
</p>
<!-- Floating Info Pill -->
<div class="mt-4 inline-flex items-center gap-1.5 bg-white/10 backdrop-blur-md border border-white/20 px-3 py-1 rounded-full text-[11px] text-blue-50 font-medium shadow-2xs">
<i class="fas fa-shield-halved text-emerald-300 text-[10px]"></i>
<span>Aman & Terintegrasi</span>
</div>
</div>
<!-- Bottom Footer Note -->
<div class="relative z-10 text-center md:text-left text-[10px] text-blue-200/70 border-t border-white/10 pt-3">
&copy; {{ date('Y') }} Universitas Tanjungpura
</div>
</div>
<!-- Sisi Kanan: Form Login (7 Kolom) -->
<div class="md:col-span-7 p-6 sm:p-7 flex flex-col justify-center bg-white relative">
<div class="max-w-[320px] w-full mx-auto">
<!-- Form Header -->
<div class="mb-4">
<h2 class="text-xl sm:text-2xl font-black text-slate-900 tracking-tight mb-1">
Selamat Datang
</h2>
<p class="text-xs text-slate-500 font-medium">
Silakan masuk ke akun Anda untuk melanjutkan
</p>
</div>
<!-- Auth Form -->
<form id="loginForm" class="space-y-3">
<!-- Input NIP -->
<div>
<label for="username" class="block text-[11px] font-bold text-slate-600 uppercase tracking-wider mb-1">
NIP Pegawai
</label>
<div class="relative rounded-lg shadow-2xs">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-slate-400">
<i class="fas fa-id-badge text-xs"></i>
</div>
<input type="text" id="username" name="username" placeholder="Masukkan 18 Digit NIP"
class="w-full pl-9 pr-3 py-2 text-xs sm:text-sm bg-slate-50/90 border border-slate-200 rounded-lg font-medium text-slate-800 placeholder-slate-400 focus:bg-white focus:outline-none focus:border-blue-600 focus:ring-3 focus:ring-blue-100 transition-all duration-200">
</div>
</div>
<!-- Input Password -->
<div>
<label for="password" class="block text-[11px] font-bold text-slate-600 uppercase tracking-wider mb-1">
Password
</label>
<div class="relative rounded-lg shadow-2xs">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-slate-400">
<i class="fas fa-lock text-xs"></i>
</div>
<input type="password" id="password" name="password" placeholder="Masukkan Password Akun"
class="w-full pl-9 pr-9 py-2 text-xs sm:text-sm bg-slate-50/90 border border-slate-200 rounded-lg font-medium text-slate-800 placeholder-slate-400 focus:bg-white focus:outline-none focus:border-blue-600 focus:ring-3 focus:ring-blue-100 transition-all duration-200">
<button type="button" onclick="togglePassword()" class="absolute inset-y-0 right-0 pr-3 flex items-center justify-center bg-transparent border-none text-slate-400 hover:text-blue-600 transition cursor-pointer focus:outline-none" title="Lihat / Sembunyikan Password">
<i class="fas fa-eye text-xs" id="eyeIcon"></i>
</button>
</div>
</div>
<!-- Slider Captcha Container -->
<div class="pt-0.5">
<div id="slider-captcha-container" class="w-full overflow-hidden"></div>
</div>
<!-- Tombol Masuk -->
<div class="pt-1">
<button type="submit" id="loginButton"
class="btn-login w-full py-2.5 px-4 text-xs sm:text-sm font-bold text-white bg-blue-600 hover:bg-blue-700 active:bg-blue-800 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-blue-600 rounded-lg shadow-md shadow-blue-600/30 hover:shadow-blue-600/40 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 flex items-center justify-center gap-2">
<i class="fas fa-right-to-bracket text-xs"></i>
<span>Masuk ke Sistem</span>
</button>
</div>
</form>
<!-- Divider Atau -->
<div class="relative my-4">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-slate-200"></div>
</div>
<div class="relative flex justify-center text-[11px]">
<span class="px-2.5 bg-white text-slate-400 font-semibold uppercase tracking-wider">
atau masuk dengan
</span>
</div>
</div>
<!-- Single Sign On / Google Button -->
<div>
<button type="button" onclick="loginWithGoogle()"
class="w-full py-2 px-3 text-xs font-bold text-slate-700 bg-white hover:bg-slate-50 active:bg-slate-100 border border-slate-200 hover:border-slate-300 rounded-lg shadow-2xs hover:shadow-xs transition-all duration-200 flex items-center justify-center gap-2 group">
<svg class="w-3.5 h-3.5" viewBox="0 0 24 24">
<path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z" />
<path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" />
<path fill="#FBBC05" d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l2.85-2.22.81-.63z" />
<path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84c.87-2.6 3.3-4.52 6.16-4.52z" />
</svg>
<span class="group-hover:text-blue-600 transition-colors">Akun Google UNTAN</span>
</button>
</div>
</div>
</div>
</div>
<!-- Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/simple-notify/dist/simple-notify.min.js"></script>
<script src="{{ asset('assets/js/slider-captcha.js') }}?v={{ time() }}"></script>
<script>
// Fungsi notifikasi dinamis
function showNotification(options = {}) {
const defaultOptions = {
status: 'info',
title: 'Notification',
text: 'Default notification message',
effect: 'fade',
speed: 300,
customClass: null,
customIcon: null,
showIcon: true,
showCloseButton: true,
autoclose: true,
autotimeout: 3000,
gap: 20,
distance: 20,
type: 'outline',
position: 'right top'
};
const config = {
...defaultOptions,
...options
};
new Notify(config);
}
function showSuccess(title = 'Success', text = 'Operation completed successfully') {
showNotification({
status: 'success',
title: title,
text: text,
});
}
function showError(title = 'Error', text = 'An error occurred') {
showNotification({
status: 'error',
title: title,
text: text,
autotimeout: 5000
});
}
function showWarning(title = 'Warning', text = 'Please check your input') {
showNotification({
status: 'warning',
title: title,
text: text,
});
}
function showInfo(title = 'Information', text = 'Here is some information') {
showNotification({
status: 'info',
title: title,
text: text,
});
}
function handleAjaxError(xhr, status, error) {
let errorMessage = 'An unexpected error occurred';
let errorTitle = 'Error';
function getMessageFromResponse(xhr) {
try {
const responseData = JSON.parse(xhr.responseText);
return responseData.message || responseData.error || responseData.msg || null;
} catch (e) {
return xhr.responseText || null;
}
}
switch (xhr.status) {
case 400:
errorTitle = 'Bad Request';
errorMessage = getMessageFromResponse(xhr) || 'Bad request. Please check your input.';
break;
case 401:
errorTitle = 'Unauthorized';
errorMessage = getMessageFromResponse(xhr) || 'You are not authorized to perform this action.';
break;
case 403:
errorTitle = 'Forbidden';
errorMessage = getMessageFromResponse(xhr) || 'Access denied. You do not have permission.';
break;
case 404:
errorTitle = 'Not Found';
errorMessage = getMessageFromResponse(xhr) || 'The requested resource was not found.';
break;
case 422:
errorTitle = 'Validation Error';
try {
const responseData = JSON.parse(xhr.responseText);
if (responseData.errors) {
const errors = Object.values(responseData.errors).flat();
errorMessage = errors.join('<br>');
} else if (responseData.message) {
errorMessage = responseData.message;
} else {
errorMessage = 'Validation failed. Please check your input.';
}
} catch (e) {
errorMessage = 'Validation failed. Please check your input.';
}
break;
case 500:
errorTitle = 'Server Error';
errorMessage = getMessageFromResponse(xhr) || 'Internal server error. Please try again later.';
break;
default:
try {
const responseData = JSON.parse(xhr.responseText);
if (responseData.message) errorMessage = responseData.message;
if (responseData.title) errorTitle = responseData.title;
} catch (e) {
errorMessage = getMessageFromResponse(xhr) || `Error ${xhr.status}: ${error}`;
}
}
showError(errorTitle, errorMessage);
}
function resetFormErrors() {
$('input').removeClass('input-error');
}
function highlightFieldError(fieldName) {
$(`#${fieldName}`).addClass('input-error');
}
function togglePassword() {
const passwordInput = document.getElementById('password');
const eyeIcon = document.getElementById('eyeIcon');
if (passwordInput.type === 'password') {
passwordInput.type = 'text';
eyeIcon.classList.remove('fa-eye');
eyeIcon.classList.add('fa-eye-slash');
} else {
passwordInput.type = 'password';
eyeIcon.classList.remove('fa-eye-slash');
eyeIcon.classList.add('fa-eye');
}
}
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
let sliderCaptcha;
$(document).ready(function() {
const containerWidth = Math.min($('#loginForm').width() || 310, 310);
sliderCaptcha = new SliderCaptcha({
container: '#slider-captcha-container',
width: containerWidth,
height: 145,
onSuccess: function(token) {
$('#loginButton').prop('disabled', false);
},
onFail: function() {
$('#loginButton').prop('disabled', true);
}
});
$('#loginButton').prop('disabled', true);
$('#loginForm').on('submit', function(e) {
e.preventDefault();
resetFormErrors();
const formData = new FormData(this);
const username = formData.get('username');
const password = formData.get('password');
if (!username) {
showError('Validation Error', 'NIP tidak boleh kosong');
highlightFieldError('username');
return;
}
if (!password) {
showError('Validation Error', 'Password tidak boleh kosong');
highlightFieldError('password');
return;
}
if (!sliderCaptcha.isVerified()) {
showError('Validation Error', 'Silakan selesaikan verifikasi captcha terlebih dahulu');
return;
}
formData.append('captcha_token', sliderCaptcha.getToken());
const loginBtn = $('#loginButton');
const originalHtml = loginBtn.html();
loginBtn.html('<i class="fas fa-spinner fa-spin"></i> Memproses...');
loginBtn.prop('disabled', true);
$.ajax({
url: "{{ route('authenticated') }}",
method: 'POST',
data: formData,
processData: false,
contentType: false,
success: function(response, status, xhr) {
loginBtn.html(originalHtml);
loginBtn.prop('disabled', false);
if (response.success) {
showSuccess(
'Login Berhasil',
response.message || 'Selamat datang! Anda akan diarahkan ke dashboard.'
);
setTimeout(function() {
window.location.href = response.redirect;
}, 1500);
} else {
showError(
'Login Gagal',
response.message || 'Terjadi Kesalahan Login.'
);
}
},
error: function(xhr, status, error) {
loginBtn.html(originalHtml);
loginBtn.prop('disabled', false);
handleAjaxError(xhr, status, error);
if (xhr.status === 422) {
try {
const responseData = JSON.parse(xhr.responseText);
if (responseData.errors) {
Object.keys(responseData.errors).forEach(function(field) {
highlightFieldError(field);
});
}
} catch (e) {}
}
}
});
});
$('input').on('input', function() {
$(this).removeClass('input-error');
});
});
function loginWithGoogle() {
window.location.href = "{{ route('auth.google') }}";
}
@if (session('error'))
showError('Akses Ditolak', '{{ session('error') }}');
@endif
@if (session('success'))
showSuccess('Berhasil', '{{ session('success') }}');
@endif
@if (session('info'))
showInfo('Informasi', '{{ session('info') }}');
@endif
@if (session('warning'))
showWarning('Peringatan', '{{ session('warning') }}');
@endif
</script>
</body>
</html>