576 lines
19 KiB
PHP
576 lines
19 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Dashboard</title>
|
|
<!-- Google Fonts: Outfit & Inter -->
|
|
<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=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&display=swap" rel="stylesheet">
|
|
|
|
<style>
|
|
:root {
|
|
--bg-color: #0b0f19;
|
|
--card-bg: rgba(17, 24, 39, 0.7);
|
|
--card-border: rgba(255, 255, 255, 0.08);
|
|
--accent-primary: #4f46e5;
|
|
--accent-secondary: #0078d4;
|
|
--text-main: #f3f4f6;
|
|
--text-muted: #9ca3af;
|
|
--success-color: #10b981;
|
|
--info-color: #06b6d4;
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Inter', sans-serif;
|
|
background-color: var(--bg-color);
|
|
color: var(--text-main);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow-x: hidden;
|
|
position: relative;
|
|
}
|
|
|
|
/* Glowing background circles */
|
|
body::before {
|
|
content: '';
|
|
position: absolute;
|
|
width: 500px;
|
|
height: 500px;
|
|
border-radius: 50%;
|
|
background: radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
|
|
top: -200px;
|
|
right: -100px;
|
|
z-index: -1;
|
|
}
|
|
|
|
body::after {
|
|
content: '';
|
|
position: absolute;
|
|
width: 400px;
|
|
height: 400px;
|
|
border-radius: 50%;
|
|
background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
|
|
bottom: -100px;
|
|
left: -100px;
|
|
z-index: -1;
|
|
}
|
|
|
|
/* Navigation Bar */
|
|
.navbar {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 20px 5%;
|
|
background: rgba(17, 24, 39, 0.4);
|
|
border-bottom: 1px solid var(--card-border);
|
|
backdrop-filter: blur(12px);
|
|
-webkit-backdrop-filter: blur(12px);
|
|
z-index: 100;
|
|
}
|
|
|
|
.nav-logo {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-size: 1.5rem;
|
|
font-weight: 800;
|
|
background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 100%);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.nav-logo svg {
|
|
width: 24px;
|
|
height: 24px;
|
|
fill: #38bdf8;
|
|
}
|
|
|
|
.nav-user {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
|
|
.logout-link {
|
|
color: var(--text-muted);
|
|
text-decoration: none;
|
|
font-size: 0.85rem;
|
|
font-weight: 500;
|
|
padding: 8px 16px;
|
|
border-radius: 8px;
|
|
border: 1px solid var(--card-border);
|
|
transition: all 0.25s ease;
|
|
}
|
|
|
|
.logout-link:hover {
|
|
color: #ef4444;
|
|
border-color: rgba(239, 68, 68, 0.2);
|
|
background-color: rgba(239, 68, 68, 0.05);
|
|
}
|
|
|
|
/* Dashboard Wrapper */
|
|
.dashboard-container {
|
|
flex: 1;
|
|
padding: 40px 5%;
|
|
max-width: 1200px;
|
|
width: 100%;
|
|
margin: 0 auto;
|
|
z-index: 10;
|
|
}
|
|
|
|
/* Profile Banner Widget */
|
|
.profile-card {
|
|
background-color: var(--card-bg);
|
|
border: 1px solid var(--card-border);
|
|
border-radius: 20px;
|
|
padding: 30px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
flex-wrap: wrap;
|
|
gap: 20px;
|
|
backdrop-filter: blur(16px);
|
|
-webkit-backdrop-filter: blur(16px);
|
|
margin-bottom: 40px;
|
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
.profile-info {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 20px;
|
|
}
|
|
|
|
.profile-avatar-container {
|
|
position: relative;
|
|
}
|
|
|
|
.profile-avatar {
|
|
width: 80px;
|
|
height: 80px;
|
|
border-radius: 50%;
|
|
object-fit: cover;
|
|
border: 3px solid var(--accent-primary);
|
|
box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
|
|
}
|
|
|
|
.profile-avatar-fallback {
|
|
width: 80px;
|
|
height: 80px;
|
|
border-radius: 50%;
|
|
background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 2rem;
|
|
font-weight: 700;
|
|
color: white;
|
|
box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
|
|
}
|
|
|
|
.profile-details h1 {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-size: 1.8rem;
|
|
font-weight: 700;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.profile-email {
|
|
color: var(--text-muted);
|
|
font-size: 0.95rem;
|
|
margin-bottom: 8px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
.badge {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 4px 10px;
|
|
border-radius: 9999px;
|
|
font-size: 0.75rem;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.badge-user {
|
|
background-color: rgba(6, 182, 212, 0.15);
|
|
color: var(--info-color);
|
|
border: 1px solid rgba(6, 182, 212, 0.3);
|
|
}
|
|
|
|
.badge-sso {
|
|
background-color: rgba(16, 185, 129, 0.15);
|
|
color: var(--success-color);
|
|
border: 1px solid rgba(16, 185, 129, 0.3);
|
|
}
|
|
|
|
.badge-admin {
|
|
background-color: rgba(99, 102, 241, 0.15);
|
|
color: #818cf8;
|
|
border: 1px solid rgba(99, 102, 241, 0.3);
|
|
}
|
|
|
|
.session-status {
|
|
text-align: right;
|
|
}
|
|
|
|
.status-pill {
|
|
font-size: 0.85rem;
|
|
color: var(--text-muted);
|
|
background-color: rgba(255, 255, 255, 0.03);
|
|
padding: 8px 16px;
|
|
border-radius: 12px;
|
|
border: 1px solid var(--card-border);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.status-dot {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
background-color: var(--success-color);
|
|
box-shadow: 0 0 10px var(--success-color);
|
|
}
|
|
|
|
/* Services Grid */
|
|
.section-title {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-size: 1.4rem;
|
|
font-weight: 700;
|
|
margin-bottom: 24px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.section-title::after {
|
|
content: '';
|
|
flex: 1;
|
|
height: 1px;
|
|
background: linear-gradient(to right, var(--card-border), transparent);
|
|
}
|
|
|
|
.services-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
|
gap: 16px;
|
|
}
|
|
|
|
/* Service Cards - Small */
|
|
.service-card-small {
|
|
background-color: var(--card-bg);
|
|
border: 1px solid var(--card-border);
|
|
border-radius: 12px;
|
|
padding: 16px;
|
|
cursor: pointer;
|
|
position: relative;
|
|
overflow: hidden;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 14px;
|
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
backdrop-filter: blur(8px);
|
|
}
|
|
|
|
.service-card-small:hover {
|
|
transform: translateY(-3px);
|
|
border-color: rgba(255, 255, 255, 0.15);
|
|
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
|
|
}
|
|
|
|
.service-icon-wrapper-small {
|
|
width: 44px;
|
|
height: 44px;
|
|
border-radius: 8px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
transition: transform 0.3s ease;
|
|
}
|
|
|
|
.service-card-small:hover .service-icon-wrapper-small {
|
|
transform: scale(1.08);
|
|
}
|
|
|
|
.service-icon-wrapper-small svg {
|
|
width: 24px;
|
|
height: 24px;
|
|
}
|
|
|
|
.service-info-small {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
}
|
|
|
|
.service-name-small {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
color: var(--text-main);
|
|
margin: 0;
|
|
}
|
|
|
|
.service-tag-small {
|
|
font-size: 0.7rem;
|
|
color: var(--text-muted);
|
|
align-self: flex-start;
|
|
}
|
|
|
|
/* Fullscreen SSO Modal Overlay */
|
|
.sso-modal {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: rgba(11, 15, 25, 0.85);
|
|
backdrop-filter: blur(20px);
|
|
-webkit-backdrop-filter: blur(20px);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 1000;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
transition: opacity 0.35s ease;
|
|
}
|
|
|
|
.sso-modal.active {
|
|
opacity: 1;
|
|
pointer-events: all;
|
|
}
|
|
|
|
.sso-modal-card {
|
|
background-color: rgba(25, 30, 45, 0.7);
|
|
border: 1px solid var(--card-border);
|
|
border-radius: 20px;
|
|
padding: 40px;
|
|
text-align: center;
|
|
max-width: 450px;
|
|
width: 90%;
|
|
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
|
|
transform: scale(0.9);
|
|
transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
}
|
|
|
|
.sso-modal.active .sso-modal-card {
|
|
transform: scale(1);
|
|
}
|
|
|
|
.sso-loader {
|
|
position: relative;
|
|
width: 80px;
|
|
height: 80px;
|
|
margin: 0 auto 30px;
|
|
}
|
|
|
|
.sso-spinner {
|
|
box-sizing: border-box;
|
|
display: block;
|
|
position: absolute;
|
|
width: 80px;
|
|
height: 80px;
|
|
border: 4px solid transparent;
|
|
border-radius: 50%;
|
|
animation: sso-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
border-top-color: var(--accent-secondary);
|
|
}
|
|
|
|
.sso-spinner-inner {
|
|
box-sizing: border-box;
|
|
display: block;
|
|
position: absolute;
|
|
width: 64px;
|
|
height: 64px;
|
|
margin: 8px;
|
|
border: 4px solid transparent;
|
|
border-radius: 50%;
|
|
animation: sso-spin-reverse 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
border-top-color: var(--accent-primary);
|
|
}
|
|
|
|
.sso-title {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-size: 1.4rem;
|
|
font-weight: 700;
|
|
margin-bottom: 12px;
|
|
background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 100%);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
}
|
|
|
|
.sso-subtitle {
|
|
font-size: 0.85rem;
|
|
color: var(--text-muted);
|
|
line-height: 1.5;
|
|
}
|
|
|
|
@keyframes sso-spin {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(360deg); }
|
|
}
|
|
|
|
@keyframes sso-spin-reverse {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(-360deg); }
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.profile-card {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
padding: 24px;
|
|
}
|
|
.nav-user {
|
|
margin-top: 10px;
|
|
width: 100%;
|
|
display: flex;
|
|
justify-content: flex-start;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<!-- Main Container -->
|
|
<main class="dashboard-container">
|
|
|
|
<!-- User Welcome / Profile Card -->
|
|
<section class="profile-card">
|
|
<div class="profile-info">
|
|
<div class="profile-avatar-container">
|
|
@if($user->avatar)
|
|
<img src="{{ $user->avatar }}" alt="{{ $user->name }}" class="profile-avatar">
|
|
@else
|
|
<div class="profile-avatar-fallback">
|
|
{{ strtoupper(substr($user->name, 0, 1)) }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
<div class="profile-details">
|
|
<h1>Welcome, {{ $user->name }}</h1>
|
|
<div class="profile-email">
|
|
<span>{{ $user->email }}</span>
|
|
•
|
|
<span class="badge badge-user">
|
|
@if($user->isAdmin())
|
|
Admin
|
|
@elseif($user->roles->isNotEmpty())
|
|
{{ $user->roles->pluck('name')->implode(', ') }}
|
|
@else
|
|
{{ ucfirst($user->role) }}
|
|
@endif
|
|
</span>
|
|
@if($user->microsoft_id)
|
|
<span class="badge badge-sso">Microsoft Linked</span>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="nav-user">
|
|
@if($user->role === 'admin')
|
|
<a href="{{ route('admin.dashboard') }}" class="logout-link" style="color: var(--info-color); border-color: rgba(6, 182, 212, 0.2); background-color: rgba(6, 182, 212, 0.05); margin-right: 10px;">
|
|
Admin Panel
|
|
</a>
|
|
@endif
|
|
<form action="{{ route('logout') }}" method="POST" id="logout-form" style="display: none;">
|
|
@csrf
|
|
</form>
|
|
<a href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();" class="logout-link">
|
|
Sign Out
|
|
</a>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Services Section -->
|
|
<section>
|
|
<h2 class="section-title">Authorized Corporate Services</h2>
|
|
|
|
<div class="services-grid">
|
|
@foreach($services as $service)
|
|
<div class="service-card-small" onclick="launchSSO('{{ $service['name'] }}', '{{ route('sso.launch', $service['id']) }}')" style="border-left: 4px solid {{ $service['color'] }}">
|
|
<div class="service-icon-wrapper-small" style="background-color: rgba({{ hexdec(substr($service['color'] ?? '#4f46e5', 1, 2)) }}, {{ hexdec(substr($service['color'] ?? '#4f46e5', 3, 2)) }}, {{ hexdec(substr($service['color'] ?? '#4f46e5', 5, 2)) }}, 0.08)">
|
|
@if($service['logo'])
|
|
<img src="{{ asset($service['logo']) }}" alt="{{ $service['name'] }}" style="width: 32px; height: 32px; object-fit: contain; border-radius: 6px;">
|
|
@elseif($service['icon_svg'] === 'outlook')
|
|
<svg viewBox="0 0 24 24" fill="{{ $service['color'] }}">
|
|
<path d="M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,19H5V8H19V19M19,6H5V5H19V6M17,12H12V17H17V12Z" />
|
|
</svg>
|
|
@elseif($service['icon_svg'] === 'teams')
|
|
<svg viewBox="0 0 24 24" fill="{{ $service['color'] }}">
|
|
<path d="M12.5,9A2.5,2.5 0 0,1 15,11.5A2.5,2.5 0 0,1 12.5,14A2.5,2.5 0 0,1 10,11.5A2.5,2.5 0 0,1 12.5,9M12.5,15.5C14.71,15.5 18.5,16.5 18.5,18.5V20H6.5V18.5C6.5,16.5 10.29,15.5 12.5,15.5M6,8A2,2 0 0,1 8,10A2,2 0 0,1 6,12A2,2 0 0,1 4,10A2,2 0 0,1 6,8M6,13.5C7.43,13.5 10,14.07 10,15.25V17H2V15.25C2,14.07 4.57,13.5 6,13.5M12.5,3A2,2 0 0,1 14.5,5A2,2 0 0,1 12.5,7A2,2 0 0,1 10.5,5A2,2 0 0,1 12.5,3M12.5,20V22H19V20H12.5Z" />
|
|
</svg>
|
|
@elseif($service['icon_svg'] === 'keka')
|
|
<svg viewBox="0 0 24 24" fill="{{ $service['color'] }}">
|
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H7c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.04-.42 1.99-1.07 2.75z"/>
|
|
</svg>
|
|
@elseif(str_starts_with($service['icon_svg'] ?? '', '<svg'))
|
|
{!! $service['icon_svg'] !!}
|
|
@else
|
|
<img src="{{ asset('images/default_logo.png') }}" alt="Default Logo" style="width: 32px; height: 32px; object-fit: contain; border-radius: 6px;">
|
|
@endif
|
|
</div>
|
|
<div class="service-info-small">
|
|
<h3 class="service-name-small">{{ $service['name'] }}</h3>
|
|
<span class="service-tag-small">{{ $service['tag'] }}</span>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</section>
|
|
|
|
</main>
|
|
|
|
<!-- SSO Interstitial Loading Modal -->
|
|
<div id="sso-modal" class="sso-modal">
|
|
<div class="sso-modal-card">
|
|
<div class="sso-loader">
|
|
<div class="sso-spinner"></div>
|
|
<div class="sso-spinner-inner"></div>
|
|
</div>
|
|
<div class="sso-title" id="sso-modal-title">Signing into Service</div>
|
|
<div class="sso-subtitle">
|
|
Negotiating single sign-on token with Microsoft Identity Server...<br>
|
|
Connecting securely. You will be redirected silently.
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function launchSSO(serviceName, url) {
|
|
const modal = document.getElementById('sso-modal');
|
|
const modalTitle = document.getElementById('sso-modal-title');
|
|
|
|
modalTitle.innerText = `Connecting to ${serviceName}`;
|
|
modal.classList.add('active');
|
|
|
|
// Artificial delay of 1.2s to visually represent and simulate the Microsoft session SSO handshake,
|
|
// then open in a new tab silently.
|
|
setTimeout(() => {
|
|
modal.classList.remove('active');
|
|
window.open(url, '_blank');
|
|
}, 1200);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|