💄 Restyled web pages
This commit is contained in:
@ -6,53 +6,44 @@
|
||||
|
||||
@if (Model.Account != null)
|
||||
{
|
||||
<div class="h-full bg-gray-100 dark:bg-gray-900 py-8 px-4">
|
||||
<div class="p-4 sm:p-8 bg-base-200">
|
||||
<div class="max-w-6xl mx-auto">
|
||||
<!-- Header -->
|
||||
<div class="mb-8">
|
||||
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">Profile Settings</h1>
|
||||
<p class="text-gray-600 dark:text-gray-400 mt-2">Manage your account information and preferences</p>
|
||||
<h1 class="text-3xl font-bold">Profile Settings</h1>
|
||||
<p class="text-base-content/70 mt-2">Manage your account information and preferences</p>
|
||||
</div>
|
||||
|
||||
<!-- Two Column Layout -->
|
||||
<div class="flex flex-col md:flex-row gap-8">
|
||||
<!-- Left Pane - Profile Card -->
|
||||
<div class="w-full md:w-1/3 lg:w-1/4">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 sticky top-8">
|
||||
<div class="flex flex-col items-center text-center">
|
||||
<div class="card bg-base-100 shadow-xl sticky top-8">
|
||||
<div class="card-body items-center text-center">
|
||||
<!-- Avatar -->
|
||||
<div
|
||||
class="w-32 h-32 rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center mb-4 overflow-hidden">
|
||||
<span class="text-4xl text-gray-500 dark:text-gray-400">
|
||||
@Model.Account.Name?.Substring(0, 1).ToUpper()
|
||||
</span>
|
||||
<div class="avatar avatar-placeholder mb-4">
|
||||
<div class="bg-neutral text-neutral-content rounded-full w-32">
|
||||
<span class="text-4xl">@Model.Account.Name?[..1].ToUpper()</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Basic Info -->
|
||||
<h2 class="text-xl font-semibold text-gray-900 dark:text-white">
|
||||
@Model.Account.Nick
|
||||
</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">@Model.Account.Name</p>
|
||||
<h2 class="card-title">@Model.Account.Nick</h2>
|
||||
<p class="font-mono text-sm">@@@Model.Account.Name</p>
|
||||
|
||||
<!-- Stats -->
|
||||
<div
|
||||
class="mt-4 flex justify-around w-full border-t border-gray-200 dark:border-gray-700 pt-4">
|
||||
<div class="text-center">
|
||||
<div
|
||||
class="text-lg font-semibold text-gray-900 dark:text-white">@Model.Account.Profile.Level</div>
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">Level</div>
|
||||
<div class="stats stats-vertical shadow mt-4">
|
||||
<div class="stat">
|
||||
<div class="stat-title">Level</div>
|
||||
<div class="stat-value">@Model.Account.Profile.Level</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div
|
||||
class="text-lg font-semibold text-gray-900 dark:text-white">@Model.Account.Profile.Experience</div>
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">XP</div>
|
||||
<div class="stat">
|
||||
<div class="stat-title">XP</div>
|
||||
<div class="stat-value">@Model.Account.Profile.Experience</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div
|
||||
class="text-lg font-semibold text-gray-900 dark:text-white">
|
||||
@Model.Account.CreatedAt.ToDateTimeUtc().ToString("yyyy/MM/dd")
|
||||
</div>
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">Member since</div>
|
||||
<div class="stat">
|
||||
<div class="stat-title">Member since</div>
|
||||
<div class="stat-value">@Model.Account.CreatedAt.ToDateTimeUtc().ToString("yyyy/MM")</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -61,181 +52,107 @@
|
||||
|
||||
<!-- Right Pane - Tabbed Content -->
|
||||
<div class="flex-1">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md overflow-hidden">
|
||||
<!-- Tabs -->
|
||||
<div class="border-b border-gray-200 dark:border-gray-700">
|
||||
<nav class="flex -mb-px">
|
||||
<button type="button"
|
||||
class="tab-button active py-4 px-6 text-sm font-medium border-b-2 border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-200"
|
||||
data-tab="profile">
|
||||
Profile
|
||||
</button>
|
||||
<button type="button"
|
||||
class="tab-button py-4 px-6 text-sm font-medium border-b-2 border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-200"
|
||||
data-tab="security">
|
||||
Security
|
||||
</button>
|
||||
<button type="button"
|
||||
class="tab-button py-4 px-6 text-sm font-medium border-b-2 border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-200"
|
||||
data-tab="sessions">
|
||||
Sessions
|
||||
</button>
|
||||
</nav>
|
||||
<div role="tablist" class="tabs tabs-lift w-full">
|
||||
<input type="radio" name="profile-tabs" role="tab" class="tab" aria-label="Profile" checked />
|
||||
<div role="tabpanel" class="tab-content bg-base-100 border-base-300 p-6">
|
||||
<h2 class="text-xl font-semibold mb-6">Profile Information</h2>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<h3 class="text-lg font-medium mb-4">Basic Information</h3>
|
||||
<dl class="space-y-4">
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-base-content/70">Full Name</dt>
|
||||
<dd class="mt-1 text-sm">@($"{Model.Account.Profile.FirstName} {Model.Account.Profile.MiddleName} {Model.Account.Profile.LastName}".Trim())</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-base-content/70">Username</dt>
|
||||
<dd class="mt-1 text-sm">@Model.Account.Name</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-base-content/70">Nickname</dt>
|
||||
<dd class="mt-1 text-sm">@Model.Account.Nick</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-base-content/70">Gender</dt>
|
||||
<dd class="mt-1 text-sm">@Model.Account.Profile.Gender</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="text-lg font-medium mb-4">Additional Details</h3>
|
||||
<dl class="space-y-4">
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-base-content/70">Location</dt>
|
||||
<dd class="mt-1 text-sm">@Model.Account.Profile.Location</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-base-content/70">Birthday</dt>
|
||||
<dd class="mt-1 text-sm">@Model.Account.Profile.Birthday?.ToString("MMMM d, yyyy", System.Globalization.CultureInfo.InvariantCulture)</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-base-content/70">Bio</dt>
|
||||
<dd class="mt-1 text-sm">@(string.IsNullOrEmpty(Model.Account.Profile.Bio) ? "No bio provided" : Model.Account.Profile.Bio)</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab Content -->
|
||||
<div class="p-6">
|
||||
<!-- Profile Tab -->
|
||||
<div id="profile-tab" class="tab-content">
|
||||
<h2 class="text-xl font-semibold text-gray-900 dark:text-white mb-6">Profile
|
||||
Information</h2>
|
||||
<input type="radio" name="profile-tabs" role="tab" class="tab" aria-label="Security" />
|
||||
<div role="tabpanel" class="tab-content bg-base-100 border-base-300 p-6">
|
||||
<h2 class="text-xl font-semibold mb-2">Security Settings</h2>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<h3 class="text-lg font-medium text-gray-900 dark:text-white mb-4">Basic
|
||||
Information</h3>
|
||||
<dl class="space-y-4">
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Full
|
||||
Name
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white">
|
||||
@($"{Model.Account.Profile.FirstName} {Model.Account.Profile.MiddleName} {Model.Account.Profile.LastName}".Trim())
|
||||
</dd>
|
||||
<div class="space-y-6">
|
||||
<div class="card bg-base-300 shadow-xl">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Access Token</h3>
|
||||
<p>Use this token to authenticate with the API</p>
|
||||
<div class="form-control">
|
||||
<div class="join">
|
||||
<input type="password" id="accessToken" value="@Model.AccessToken" readonly class="input input-bordered join-item flex-grow" />
|
||||
<button onclick="copyAccessToken()" class="btn join-item">Copy</button>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
Username
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white">@Model.Account.Name</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
Nickname
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white">@Model.Account.Nick</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
Gender
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white">@Model.Account.Profile.Gender</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="text-lg font-medium text-gray-900 dark:text-white mb-4">Additional
|
||||
Details</h3>
|
||||
<dl class="space-y-4">
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
Location
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white">@Model.Account.Profile.Location</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
Birthday
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white">
|
||||
@Model.Account.Profile.Birthday?.ToString("MMMM d, yyyy", System.Globalization.CultureInfo.InvariantCulture)
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Bio
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white">
|
||||
@(string.IsNullOrEmpty(Model.Account.Profile.Bio) ? "No bio provided" : Model.Account.Profile.Bio)
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 pt-6 border-t border-gray-200 dark:border-gray-700">
|
||||
<button type="button"
|
||||
class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
|
||||
Edit Profile
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Security Tab -->
|
||||
<div id="security-tab" class="tab-content hidden">
|
||||
<h2 class="text-xl font-semibold text-gray-900 dark:text-white mb-6">Security
|
||||
Settings</h2>
|
||||
|
||||
<div class="space-y-6">
|
||||
<div class="bg-white dark:bg-gray-800 shadow overflow-hidden sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:px-6">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900 dark:text-white">
|
||||
Access Token</h3>
|
||||
<p class="mt-1 max-w-2xl text-sm text-gray-500 dark:text-gray-400">Use this
|
||||
token to authenticate with the API</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-200 dark:border-gray-700 px-4 py-5 sm:px-6">
|
||||
<div class="flex items-center">
|
||||
<input type="password" id="accessToken" value="@Model.AccessToken"
|
||||
readonly
|
||||
class="form-input flex-grow rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring focus:ring-blue-500 focus:ring-opacity-50 dark:bg-gray-700 dark:border-gray-600 dark:text-white py-2 px-4"/>
|
||||
<button onclick="copyAccessToken()"
|
||||
class="ml-4 bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50">
|
||||
Copy
|
||||
</button>
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
||||
Keep this token secure and do not share it with anyone.
|
||||
</p>
|
||||
</div>
|
||||
<p class="text-sm text-base-content/70 mt-2">Keep this token secure and do not share it with anyone.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sessions Tab -->
|
||||
<div id="sessions-tab" class="tab-content hidden">
|
||||
<h2 class="text-xl font-semibold text-gray-900 dark:text-white mb-6">Active
|
||||
Sessions</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-6">This is a list of devices that have
|
||||
logged into your account. Revoke any sessions that you do not recognize.</p>
|
||||
<input type="radio" name="profile-tabs" role="tab" class="tab" aria-label="Sessions" />
|
||||
<div role="tabpanel" class="tab-content bg-base-100 border-base-300 p-6">
|
||||
<h2 class="text-xl font-semibold">Active Sessions</h2>
|
||||
<p class="text-base-content/70 mb-3">This is a list of devices that have logged into your account. Revoke any sessions that you do not recognize.</p>
|
||||
|
||||
<div class="bg-white dark:bg-gray-800 shadow overflow-hidden sm:rounded-lg">
|
||||
<ul class="divide-y divide-gray-200 dark:divide-gray-700">
|
||||
<li class="px-4 py-4 sm:px-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center">
|
||||
<div
|
||||
class="flex-shrink-0 h-10 w-10 rounded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center">
|
||||
<svg class="h-6 w-6 text-blue-600 dark:text-blue-400"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd"
|
||||
d="M4 4a2 2 0 012-2h8a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 0v12h8V4H6z"
|
||||
clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<div class="text-sm font-medium text-gray-900 dark:text-white">
|
||||
Current Session
|
||||
<div class="card bg-base-300 shadow-xl">
|
||||
<div class="card-body">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="avatar">
|
||||
<div class="mask mask-squircle w-12 h-12">
|
||||
<svg class="h-full w-full text-blue-600 dark:text-blue-400" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M4 4a2 2 0 012-2h8a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 0v12h8V4H6z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">
|
||||
@($"{Request.Headers["User-Agent"]} • {DateTime.Now:MMMM d, yyyy 'at' h:mm tt}")
|
||||
<div>
|
||||
<div class="font-bold">Current Session</div>
|
||||
<div class="text-sm opacity-50">@($"{Request.Headers["User-Agent"]} • {DateTime.Now:MMMM d, yyyy 'at' h:mm tt}")</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-4 flex-shrink-0">
|
||||
<span
|
||||
class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200">
|
||||
Active now
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="bg-gray-50 dark:bg-gray-800 px-4 py-4 sm:px-6 text-right">
|
||||
<button type="button"
|
||||
class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
|
||||
Sign out all other sessions
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-actions justify-end mt-4">
|
||||
<button type="button" class="btn btn-error">Sign out all other sessions</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -245,10 +162,7 @@
|
||||
<!-- Logout Button -->
|
||||
<div class="mt-6 flex justify-end">
|
||||
<form method="post" asp-page-handler="Logout">
|
||||
<button type="submit"
|
||||
class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">
|
||||
Sign out
|
||||
</button>
|
||||
<button type="submit" class="btn btn-error">Sign out</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@ -258,54 +172,22 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="min-h-screen flex items-center justify-center bg-gray-100 dark:bg-gray-900">
|
||||
<div class="max-w-md w-full p-8 bg-white dark:bg-gray-800 rounded-lg shadow-md text-center">
|
||||
<div class="text-red-500 text-5xl mb-4">
|
||||
<i class="fas fa-exclamation-circle"></i>
|
||||
<div class="hero min-h-screen bg-base-200">
|
||||
<div class="hero-content text-center">
|
||||
<div class="max-w-md">
|
||||
<div class="text-error text-5xl mb-4">
|
||||
<i class="fas fa-exclamation-circle"></i>
|
||||
</div>
|
||||
<h1 class="text-5xl font-bold">Profile Not Found</h1>
|
||||
<p class="py-6">User profile not found. Please log in to continue.</p>
|
||||
<a href="/auth/login" class="btn btn-primary">Go to Login</a>
|
||||
</div>
|
||||
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-2">Profile Not Found</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-6">User profile not found. Please log in to continue.</p>
|
||||
<a href="/auth/login"
|
||||
class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
|
||||
Go to Login
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@section Scripts {
|
||||
<script>
|
||||
// Tab functionality
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// Get all tab buttons and content
|
||||
const tabButtons = document.querySelectorAll('.tab-button');
|
||||
const tabContents = document.querySelectorAll('.tab-content');
|
||||
|
||||
// Add click event listeners to tab buttons
|
||||
tabButtons.forEach(button => {
|
||||
button.addEventListener('click', function () {
|
||||
const tabId = this.getAttribute('data-tab');
|
||||
|
||||
// Update active tab button
|
||||
tabButtons.forEach(btn => btn.classList.remove('border-blue-500', 'text-blue-600', 'dark:text-blue-400'));
|
||||
this.classList.add('border-blue-500', 'text-blue-600', 'dark:text-blue-400');
|
||||
|
||||
// Show corresponding tab content
|
||||
tabContents.forEach(content => {
|
||||
content.classList.add('hidden');
|
||||
if (content.id === `${tabId}-tab`) {
|
||||
content.classList.remove('hidden');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Show first tab by default
|
||||
if (tabButtons.length > 0) {
|
||||
tabButtons[0].click();
|
||||
}
|
||||
});
|
||||
|
||||
// Copy access token to clipboard
|
||||
function copyAccessToken() {
|
||||
const copyText = document.getElementById("accessToken");
|
||||
@ -340,4 +222,4 @@ else
|
||||
}
|
||||
}
|
||||
</script>
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user