feature/profile-page #71
@@ -0,0 +1,19 @@
|
||||
/* UserPage.css - Custom styles that can't be done with Tailwind */
|
||||
|
||||
.spinner {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 3px solid #f0f0f0;
|
||||
border-top: 3px solid #000;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,24 @@
|
||||
<template>
|
||||
<div class="profile-container">
|
||||
<div class="min-h-screen bg-gray-50 p-8 flex items-center justify-center">
|
||||
<!-- Loading State -->
|
||||
<div v-if="loading" class="state-card loading-card">
|
||||
<div v-if="loading" class="bg-white border border-gray-300 p-12 text-center shadow-sm max-w-md w-full">
|
||||
<div class="flex flex-col items-center gap-6">
|
||||
<div class="spinner"></div>
|
||||
<p>Loading your profile...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Error State -->
|
||||
<div v-else-if="error" class="state-card error-card">
|
||||
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<div v-else-if="error" class="bg-white border border-gray-300 p-12 text-center shadow-sm max-w-md w-full text-gray-800">
|
||||
<svg class="w-12 h-12 mx-auto mb-4 text-black" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<circle cx="12" cy="12" r="10" stroke-width="2"/>
|
||||
<line x1="12" y1="8" x2="12" y2="12" stroke-width="2"/>
|
||||
<line x1="12" y1="16" x2="12.01" y2="16" stroke-width="2"/>
|
||||
</svg>
|
||||
<h3>Oops! Something went wrong</h3>
|
||||
<p>{{ error }}</p>
|
||||
<button @click="retry" class="retry-btn">
|
||||
<svg class="btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<h3 class="text-2xl mb-2 text-black">Oops! Something went wrong</h3>
|
||||
<p class="text-gray-600 mb-6">{{ error }}</p>
|
||||
<button @click="retry" class="flex items-center gap-2 px-6 py-3 bg-black text-white cursor-pointer text-base font-medium transition-colors hover:bg-gray-800 mx-auto">
|
||||
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<path d="M1 4v6h6M23 20v-6h-6" stroke-width="2"/>
|
||||
<path d="M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15" stroke-width="2"/>
|
||||
</svg>
|
||||
@@ -25,20 +27,20 @@
|
||||
</div>
|
||||
|
||||
<!-- User Profile -->
|
||||
<div v-else-if="authStore.currentUser" class="profile-card">
|
||||
<div class="profile-header">
|
||||
<div class="avatar-container">
|
||||
<div v-else-if="authStore.currentUser" class="bg-white border border-gray-300 shadow-lg max-w-4xl w-full overflow-hidden">
|
||||
<div class="bg-black p-12 text-center relative text-white border-b border-gray-300">
|
||||
<div class="mb-6 relative inline-block">
|
||||
<img
|
||||
v-if="authStore.currentUser.photo_avatar_filename"
|
||||
:src="`${API_BASE_URL.replace('/api', '')}/storage/photos_avatars/${authStore.currentUser.photo_avatar_filename}`"
|
||||
:alt="authStore.currentUser.name"
|
||||
class="avatar"
|
||||
class="w-24 h-24 border-[3px] border-white object-cover"
|
||||
/>
|
||||
<div v-else class="avatar-placeholder">
|
||||
<div v-else class="w-24 h-24 border-[3px] border-white bg-white text-black flex items-center justify-center text-4xl font-semibold">
|
||||
{{ authStore.currentUser.name.charAt(0).toUpperCase() }}
|
||||
</div>
|
||||
<button class="edit-avatar-btn" @click="triggerFileInput">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<button @click="triggerFileInput" class="absolute bottom-0 right-0 w-9 h-9 bg-white border-2 border-black cursor-pointer flex items-center justify-center transition-colors hover:bg-gray-100">
|
||||
<svg class="w-5 h-5 text-black" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" stroke-width="1.5"/>
|
||||
<circle cx="12" cy="13" r="4" stroke-width="1.5"/>
|
||||
</svg>
|
||||
@@ -48,15 +50,15 @@
|
||||
type="file"
|
||||
accept="image/*"
|
||||
@change="handleAvatarUpload"
|
||||
style="display: none"
|
||||
class="hidden"
|
||||
/>
|
||||
</div>
|
||||
<div class="profile-info">
|
||||
<h1 class="profile-name">{{ authStore.currentUser.name }}</h1>
|
||||
<p class="profile-nickname">@{{ authStore.currentUser.nickname }}</p>
|
||||
<div>
|
||||
<h1 class="text-3xl font-semibold mb-2">{{ authStore.currentUser.name }}</h1>
|
||||
<p class="text-base opacity-80">@{{ authStore.currentUser.nickname }}</p>
|
||||
</div>
|
||||
<div class="coins-badge">
|
||||
<svg class="coin-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<div class="inline-flex items-center gap-2 bg-white text-black px-4 py-2 mt-6 font-medium text-base border border-gray-300">
|
||||
<svg class="w-5 h-5 text-black" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<circle cx="12" cy="12" r="10" stroke-width="1.5"/>
|
||||
<text x="12" y="16" text-anchor="middle" fill="currentColor" font-size="12" font-weight="bold">$</text>
|
||||
</svg>
|
||||
@@ -64,23 +66,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="profile-body">
|
||||
<div>
|
||||
<!-- Tab Navigation -->
|
||||
<div class="tabs">
|
||||
<div class="flex border-b border-gray-300 bg-gray-50">
|
||||
<button
|
||||
:class="['tab', { active: activeTab === 'info' }]"
|
||||
:class="['flex-1 p-4 bg-transparent border-none border-b-2 border-transparent cursor-pointer text-sm font-medium text-gray-600 transition-all hover:bg-gray-100 hover:text-black', { 'border-b-black text-black bg-white': activeTab === 'info' }]"
|
||||
@click="activeTab = 'info'"
|
||||
>
|
||||
Profile Information
|
||||
</button>
|
||||
<button
|
||||
:class="['tab', { active: activeTab === 'edit' }]"
|
||||
:class="['flex-1 p-4 bg-transparent border-none border-b-2 border-transparent cursor-pointer text-sm font-medium text-gray-600 transition-all hover:bg-gray-100 hover:text-black', { 'border-b-black text-black bg-white': activeTab === 'edit' }]"
|
||||
@click="activeTab = 'edit'"
|
||||
>
|
||||
Edit Profile
|
||||
</button>
|
||||
<button
|
||||
:class="['tab', { active: activeTab === 'password' }]"
|
||||
:class="['flex-1 p-4 bg-transparent border-none border-b-2 border-transparent cursor-pointer text-sm font-medium text-gray-600 transition-all hover:bg-gray-100 hover:text-black', { 'border-b-black text-black bg-white': activeTab === 'password' }]"
|
||||
@click="activeTab = 'password'"
|
||||
>
|
||||
Change Password
|
||||
@@ -88,150 +90,153 @@
|
||||
</div>
|
||||
|
||||
<!-- Profile Information Tab -->
|
||||
<div v-if="activeTab === 'info'" class="tab-content">
|
||||
<div class="info-grid">
|
||||
<div class="info-card">
|
||||
<div class="info-icon">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" stroke-width="1.5"/>
|
||||
<polyline points="22,6 12,13 2,6" stroke-width="1.5"/>
|
||||
<div v-if="activeTab === 'info'" class="p-8">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div class="flex items-start gap-4 p-5 bg-white border border-gray-300 transition-shadow hover:shadow-md">
|
||||
<div class="w-10 h-10 flex items-center justify-center flex-shrink-0 text-gray-600">
|
||||
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
||||
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>
|
||||
<polyline points="22,6 12,13 2,6"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="info-content">
|
||||
<label>Email</label>
|
||||
<p>{{ authStore.currentUser.email }}</p>
|
||||
<div class="flex-1">
|
||||
<label class="block text-xs font-semibold text-gray-500 mb-1 uppercase tracking-wider">Email</label>
|
||||
<p class="text-sm text-black">{{ authStore.currentUser.email }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-card">
|
||||
<div class="info-icon">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" stroke-width="1.5"/>
|
||||
<circle cx="12" cy="7" r="4" stroke-width="1.5"/>
|
||||
<div class="flex items-start gap-4 p-5 bg-white border border-gray-300 transition-shadow hover:shadow-md">
|
||||
<div class="w-10 h-10 flex items-center justify-center flex-shrink-0 text-gray-600">
|
||||
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
||||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
|
||||
<circle cx="12" cy="7" r="4"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="info-content">
|
||||
<label>Account Type</label>
|
||||
<p>{{ authStore.currentUser.type === 'P' ? 'Player' : 'Other' }}</p>
|
||||
<div class="flex-1">
|
||||
<label class="block text-xs font-semibold text-gray-500 mb-1 uppercase tracking-wider">Account Type</label>
|
||||
<p class="text-sm text-black">{{ authStore.currentUser.type === 'P' ? 'Player' : 'Other' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-card">
|
||||
<div class="info-icon">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<rect x="3" y="4" width="18" height="18" rx="2" ry="2" stroke-width="1.5"/>
|
||||
<line x1="16" y1="2" x2="16" y2="6" stroke-width="1.5"/>
|
||||
<line x1="8" y1="2" x2="8" y2="6" stroke-width="1.5"/>
|
||||
<line x1="3" y1="10" x2="21" y2="10" stroke-width="1.5"/>
|
||||
<div class="flex items-start gap-4 p-5 bg-white border border-gray-300 transition-shadow hover:shadow-md">
|
||||
<div class="w-10 h-10 flex items-center justify-center flex-shrink-0 text-gray-600">
|
||||
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
||||
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
|
||||
<line x1="16" y1="2" x2="16" y2="6"/>
|
||||
<line x1="8" y1="2" x2="8" y2="6"/>
|
||||
<line x1="3" y1="10" x2="21" y2="10"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="info-content">
|
||||
<label>Member Since</label>
|
||||
<p>{{ formatDate(authStore.currentUser.created_at) }}</p>
|
||||
<div class="flex-1">
|
||||
<label class="block text-xs font-semibold text-gray-500 mb-1 uppercase tracking-wider">Member Since</label>
|
||||
<p class="text-sm text-black">{{ formatDate(authStore.currentUser.created_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-card">
|
||||
<div class="info-icon">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<circle cx="12" cy="12" r="10" stroke-width="1.5"/>
|
||||
<path d="M9 12l2 2 4-4" stroke-width="1.5"/>
|
||||
<div class="flex items-start gap-4 p-5 bg-white border border-gray-300 transition-shadow hover:shadow-md">
|
||||
<div class="w-10 h-10 flex items-center justify-center flex-shrink-0 text-gray-600">
|
||||
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
||||
<circle cx="12" cy="12" r="10"/>
|
||||
<path d="M9 12l2 2 4-4"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="info-content">
|
||||
<label>Status</label>
|
||||
<div class="flex-1">
|
||||
<label class="block text-xs font-semibold text-gray-500 mb-1 uppercase tracking-wider">Status</label>
|
||||
<p>
|
||||
<span :class="['status-badge', authStore.currentUser.blocked ? 'blocked' : 'active']">
|
||||
<span :class="['inline-block px-3 py-1 text-sm font-medium border', authStore.currentUser.blocked ? 'bg-black text-white border-black' : 'bg-white text-black border-black']">
|
||||
{{ authStore.currentUser.blocked ? 'Blocked' : 'Active' }}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-card" v-if="authStore.currentUser.email_verified_at">
|
||||
<div class="info-icon">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14" stroke-width="1.5"/>
|
||||
<polyline points="22 4 12 14.01 9 11.01" stroke-width="1.5"/>
|
||||
<div v-if="authStore.currentUser.email_verified_at" class="flex items-start gap-4 p-5 bg-white border border-gray-300 transition-shadow hover:shadow-md">
|
||||
<div class="w-10 h-10 flex items-center justify-center flex-shrink-0 text-gray-600">
|
||||
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
||||
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/>
|
||||
<polyline points="22 4 12 14.01 9 11.01"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="info-content">
|
||||
<label>Email Verified</label>
|
||||
<p>{{ formatDate(authStore.currentUser.email_verified_at) }}</p>
|
||||
<div class="flex-1">
|
||||
<label class="block text-xs font-semibold text-gray-500 mb-1 uppercase tracking-wider">Email Verified</label>
|
||||
<p class="text-sm text-black">{{ formatDate(authStore.currentUser.email_verified_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-card">
|
||||
<div class="info-icon">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
||||
<polyline points="23 4 23 10 17 10" stroke-width="1.5"/>
|
||||
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10" stroke-width="1.5"/>
|
||||
<div class="flex items-start gap-4 p-5 bg-white border border-gray-300 transition-shadow hover:shadow-md">
|
||||
<div class="w-10 h-10 flex items-center justify-center flex-shrink-0 text-gray-600">
|
||||
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
||||
<polyline points="23 4 23 10 17 10"/>
|
||||
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="info-content">
|
||||
<label>Last Updated</label>
|
||||
<p>{{ formatDate(authStore.currentUser.updated_at) }}</p>
|
||||
<div class="flex-1">
|
||||
<label class="block text-xs font-semibold text-gray-500 mb-1 uppercase tracking-wider">Last Updated</label>
|
||||
<p class="text-sm text-black">{{ formatDate(authStore.currentUser.updated_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Edit Profile Tab -->
|
||||
<div v-if="activeTab === 'edit'" class="tab-content">
|
||||
<form @submit.prevent="updateProfile" class="edit-form">
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<div v-if="activeTab === 'edit'" class="p-8">
|
||||
<form @submit.prevent="updateProfile" class="max-w-lg">
|
||||
<div class="mb-6">
|
||||
<label for="name" class="block text-sm font-semibold text-gray-800 mb-2">Name</label>
|
||||
<input
|
||||
id="name"
|
||||
v-model="profileForm.name"
|
||||
type="text"
|
||||
required
|
||||
:disabled="updatingProfile"
|
||||
class="w-full px-3 py-3 border border-gray-300 text-base transition-colors focus:outline-none focus:border-black disabled:bg-gray-100 disabled:cursor-not-allowed"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="nickname">Nickname</label>
|
||||
<div class="mb-6">
|
||||
<label for="nickname" class="block text-sm font-semibold text-gray-800 mb-2">Nickname</label>
|
||||
<input
|
||||
id="nickname"
|
||||
v-model="profileForm.nickname"
|
||||
type="text"
|
||||
required
|
||||
:disabled="updatingProfile"
|
||||
class="w-full px-3 py-3 border border-gray-300 text-base transition-colors focus:outline-none focus:border-black disabled:bg-gray-100 disabled:cursor-not-allowed"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="button" @click="resetProfileForm" class="btn-secondary" :disabled="updatingProfile">
|
||||
<div class="flex gap-4 mt-8">
|
||||
<button type="button" @click="resetProfileForm" :disabled="updatingProfile" class="px-6 py-3 border border-black cursor-pointer text-base font-medium transition-all bg-white text-black hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed">
|
||||
Cancel
|
||||
</button>
|
||||
<button type="submit" class="btn-primary" :disabled="updatingProfile">
|
||||
<button type="submit" :disabled="updatingProfile" class="px-6 py-3 border border-black cursor-pointer text-base font-medium transition-all bg-black text-white hover:bg-gray-800 disabled:opacity-50 disabled:cursor-not-allowed">
|
||||
{{ updatingProfile ? 'Saving...' : 'Save Changes' }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="profileMessage" :class="['message', profileMessageType]">
|
||||
<div v-if="profileMessage" :class="['mt-4 px-3 py-3 border text-sm', profileMessageType === 'success' ? 'bg-blue-50 border-black text-black' : 'bg-red-50 border-black text-black']">
|
||||
{{ profileMessage }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Change Password Tab -->
|
||||
<div v-if="activeTab === 'password'" class="tab-content">
|
||||
<form @submit.prevent="changePassword" class="edit-form">
|
||||
<div class="form-group">
|
||||
<label for="current_password">Current Password</label>
|
||||
<div v-if="activeTab === 'password'" class="p-8">
|
||||
<form @submit.prevent="changePassword" class="max-w-lg">
|
||||
<div class="mb-6">
|
||||
<label for="current_password" class="block text-sm font-semibold text-gray-800 mb-2">Current Password</label>
|
||||
<input
|
||||
id="current_password"
|
||||
v-model="passwordForm.current_password"
|
||||
type="password"
|
||||
required
|
||||
:disabled="updatingPassword"
|
||||
class="w-full px-3 py-3 border border-gray-300 text-base transition-colors focus:outline-none focus:border-black disabled:bg-gray-100 disabled:cursor-not-allowed"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="new_password">New Password</label>
|
||||
<div class="mb-6">
|
||||
<label for="new_password" class="block text-sm font-semibold text-gray-800 mb-2">New Password</label>
|
||||
<input
|
||||
id="new_password"
|
||||
v-model="passwordForm.new_password"
|
||||
@@ -239,31 +244,33 @@
|
||||
required
|
||||
minlength="8"
|
||||
:disabled="updatingPassword"
|
||||
class="w-full px-3 py-3 border border-gray-300 text-base transition-colors focus:outline-none focus:border-black disabled:bg-gray-100 disabled:cursor-not-allowed"
|
||||
/>
|
||||
<small>Password must be at least 8 characters long</small>
|
||||
<small class="block mt-1 text-xs text-gray-600">Password must be at least 8 characters long</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="confirm_password">Confirm New Password</label>
|
||||
<div class="mb-6">
|
||||
<label for="confirm_password" class="block text-sm font-semibold text-gray-800 mb-2">Confirm New Password</label>
|
||||
<input
|
||||
id="confirm_password"
|
||||
v-model="passwordForm.confirm_password"
|
||||
type="password"
|
||||
required
|
||||
:disabled="updatingPassword"
|
||||
class="w-full px-3 py-3 border border-gray-300 text-base transition-colors focus:outline-none focus:border-black disabled:bg-gray-100 disabled:cursor-not-allowed"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="button" @click="resetPasswordForm" class="btn-secondary" :disabled="updatingPassword">
|
||||
<div class="flex gap-4 mt-8">
|
||||
<button type="button" @click="resetPasswordForm" :disabled="updatingPassword" class="px-6 py-3 border border-black cursor-pointer text-base font-medium transition-all bg-white text-black hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed">
|
||||
Cancel
|
||||
</button>
|
||||
<button type="submit" class="btn-primary" :disabled="updatingPassword">
|
||||
<button type="submit" :disabled="updatingPassword" class="px-6 py-3 border border-black cursor-pointer text-base font-medium transition-all bg-black text-white hover:bg-gray-800 disabled:opacity-50 disabled:cursor-not-allowed">
|
||||
{{ updatingPassword ? 'Updating...' : 'Change Password' }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="passwordMessage" :class="['message', passwordMessageType]">
|
||||
<div v-if="passwordMessage" :class="['mt-4 px-3 py-3 border text-sm', passwordMessageType === 'success' ? 'bg-blue-50 border-black text-black' : 'bg-red-50 border-black text-black']">
|
||||
{{ passwordMessage }}
|
||||
</div>
|
||||
</form>
|
||||
@@ -272,11 +279,13 @@
|
||||
</div>
|
||||
|
||||
<!-- No Data State -->
|
||||
<div v-else class="state-card redirect-card">
|
||||
<div v-else class="bg-white border border-gray-300 p-12 text-center shadow-sm max-w-md w-full">
|
||||
<div class="flex flex-col items-center gap-6">
|
||||
<div class="spinner"></div>
|
||||
<p>Redirecting to login...</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -463,443 +472,5 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.profile-container {
|
||||
min-height: 100vh;
|
||||
padding: 2rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.state-card {
|
||||
background: white;
|
||||
border: 1px solid #e0e0e0;
|
||||
padding: 3rem;
|
||||
text-align: center;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.loading-card, .redirect-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 3px solid #f0f0f0;
|
||||
border-top: 3px solid #000;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.error-card {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.error-card .icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin: 0 auto 1rem;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.error-card h3 {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.error-card p {
|
||||
color: #666;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.retry-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.75rem 1.5rem;
|
||||
background: #000;
|
||||
color: white;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
font-weight: 500;
|
||||
transition: background 0.2s;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.retry-btn:hover {
|
||||
background: #333;
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.profile-card {
|
||||
background: white;
|
||||
border: 1px solid #e0e0e0;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
max-width: 900px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.profile-header {
|
||||
background: #000;
|
||||
padding: 3rem 2rem 2rem;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
color: white;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.avatar-container {
|
||||
margin-bottom: 1.5rem;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.avatar, .avatar-placeholder {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border: 3px solid white;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.avatar-placeholder {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 2.5rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.edit-avatar-btn {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
background: white;
|
||||
border: 2px solid #000;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.edit-avatar-btn:hover {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.edit-avatar-btn svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.profile-name {
|
||||
font-size: 2rem;
|
||||
font-weight: 600;
|
||||
margin: 0 0 0.5rem;
|
||||
}
|
||||
|
||||
.profile-nickname {
|
||||
font-size: 1rem;
|
||||
opacity: 0.8;
|
||||
margin: 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.coins-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
background: white;
|
||||
color: #000;
|
||||
padding: 0.5rem 1rem;
|
||||
margin-top: 1.5rem;
|
||||
font-weight: 500;
|
||||
font-size: 1rem;
|
||||
border: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.coin-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.profile-body {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.tab {
|
||||
flex: 1;
|
||||
padding: 1rem;
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 2px solid transparent;
|
||||
cursor: pointer;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.tab:hover {
|
||||
background: #f0f0f0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.tab.active {
|
||||
border-bottom-color: #000;
|
||||
color: #000;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.info-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.info-card {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 1rem;
|
||||
padding: 1.25rem;
|
||||
background: white;
|
||||
border: 1px solid #e0e0e0;
|
||||
transition: box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.info-card:hover {
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.info-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.info-icon svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
stroke-width: 1.5;
|
||||
}
|
||||
|
||||
.info-content {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.info-content label {
|
||||
display: block;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: #999;
|
||||
margin-bottom: 0.25rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.info-content p {
|
||||
font-size: 0.95rem;
|
||||
color: #000;
|
||||
margin: 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
display: inline-block;
|
||||
padding: 0.25rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
border: 1px solid;
|
||||
}
|
||||
|
||||
.status-badge.active {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
border-color: #000;
|
||||
}
|
||||
|
||||
.status-badge.blocked {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
border-color: #000;
|
||||
}
|
||||
|
||||
.edit-form {
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.form-group input {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid #e0e0e0;
|
||||
font-size: 1rem;
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
|
||||
.form-group input:focus {
|
||||
outline: none;
|
||||
border-color: #000;
|
||||
}
|
||||
|
||||
.form-group input:disabled {
|
||||
background: #f5f5f5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.form-group small {
|
||||
display: block;
|
||||
margin-top: 0.25rem;
|
||||
font-size: 0.75rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.btn-primary, .btn-secondary {
|
||||
padding: 0.75rem 1.5rem;
|
||||
border: 1px solid #000;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #000;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover:not(:disabled) {
|
||||
background: #333;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: white;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-secondary:hover:not(:disabled) {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.btn-primary:disabled, .btn-secondary:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.message {
|
||||
margin-top: 1rem;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.message.success {
|
||||
background: #f0f9ff;
|
||||
border-color: #000;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.message.error {
|
||||
background: #fff5f5;
|
||||
border-color: #000;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.profile-container {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.profile-header {
|
||||
padding: 2rem 1rem 1.5rem;
|
||||
}
|
||||
|
||||
.profile-name {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.info-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.avatar, .avatar-placeholder {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tab {
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
border-left: 2px solid transparent;
|
||||
}
|
||||
|
||||
.tab.active {
|
||||
border-bottom-color: #e0e0e0;
|
||||
border-left-color: #000;
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
@import './UserPage.css';
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user