first commit
This commit is contained in:
@@ -0,0 +1,326 @@
|
||||
<div class="settings-page max-w-3xl mx-auto px-4 py-8">
|
||||
<header class="settings-header mb-8">
|
||||
<h1 class="text-3xl font-semibold text-[var(--text-primary)] mb-1">تنظیمات</h1>
|
||||
<p class="text-sm text-[var(--text-muted)]">مدیریت FAQ و ترجیحات برنامه</p>
|
||||
</header>
|
||||
|
||||
<div
|
||||
class="settings-card bg-[var(--card-bg)] rounded-2xl overflow-hidden shadow-[0_10px_40px_rgba(0,0,0,0.08),_0_2px_10px_rgba(0,0,0,0.04)]"
|
||||
>
|
||||
<nav class="settings-tabs flex bg-[var(--sidebar-hover)]" role="tablist">
|
||||
<button
|
||||
type="button"
|
||||
class="tab-btn flex-1 flex items-center justify-center gap-2 px-4 py-3 text-sm font-medium text-[var(--text-muted)] transition-all duration-200 hover:text-[var(--text-primary)] relative"
|
||||
[class.tab-active]="activeTab() === 'faq'"
|
||||
(click)="selectTab('faq')"
|
||||
role="tab"
|
||||
[attr.aria-selected]="activeTab() === 'faq'"
|
||||
>
|
||||
<svg
|
||||
class="w-4 h-4 transition-colors duration-200"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
||||
<polyline points="17 8 12 3 7 8" />
|
||||
<line x1="12" y1="3" x2="12" y2="15" />
|
||||
</svg>
|
||||
<span>آپلود FAQ</span>
|
||||
@if (activeTab() === 'faq') {
|
||||
<span
|
||||
class="tab-indicator absolute bottom-0 left-1/2 -translate-x-1/2 w-6 h-0.5 bg-primary rounded-full"
|
||||
></span>
|
||||
}
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="tab-btn flex-1 flex items-center justify-center gap-2 px-4 py-3 text-sm font-medium text-[var(--text-muted)] transition-all duration-200 hover:text-[var(--text-primary)] relative"
|
||||
[class.tab-active]="activeTab() === 'app'"
|
||||
(click)="selectTab('app')"
|
||||
role="tab"
|
||||
[attr.aria-selected]="activeTab() === 'app'"
|
||||
>
|
||||
<svg
|
||||
class="w-4 h-4 transition-colors duration-200"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path
|
||||
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"
|
||||
/>
|
||||
</svg>
|
||||
<span>تنظیمات برنامه</span>
|
||||
@if (activeTab() === 'app') {
|
||||
<span
|
||||
class="tab-indicator absolute bottom-0 left-1/2 -translate-x-1/2 w-6 h-0.5 bg-primary rounded-full"
|
||||
></span>
|
||||
}
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<div class="settings-content p-6">
|
||||
@if (activeTab() === 'faq') {
|
||||
<section class="faq-section animate-fade-in">
|
||||
<div class="section-header mb-6">
|
||||
<h2
|
||||
class="text-xl font-semibold text-[var(--text-primary)] mb-1 flex items-center gap-2"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5 text-primary"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
||||
<polyline points="17 8 12 3 7 8" />
|
||||
<line x1="12" y1="3" x2="12" y2="15" />
|
||||
</svg>
|
||||
آپلود سند FAQ
|
||||
</h2>
|
||||
<p class="text-sm text-[var(--text-muted)]">
|
||||
فایلهای PDF، DOCX یا TXT خود را بکشید و رها کنید یا برای آپلود کلیک کنید.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="dropzone relative flex flex-col items-center justify-center gap-3 p-8 border-2 border-dashed border-[var(--text-muted)]/20 rounded-xl bg-[var(--dropzone-bg)] cursor-pointer transition-all duration-300 hover:border-primary/50 hover:bg-primary/5 hover:shadow-[0_10px_30px_rgba(59,130,246,0.15)]"
|
||||
[class.dropzone-active]="isDragging()"
|
||||
(dragover)="onDragOver($event)"
|
||||
(dragleave)="onDragLeave()"
|
||||
(drop)="onDrop($event)"
|
||||
(click)="fileInput.click()"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(keydown.enter)="fileInput.click()"
|
||||
(keydown.space)="$event.preventDefault(); fileInput.click()"
|
||||
>
|
||||
<input
|
||||
#fileInput
|
||||
id="faq-file-input"
|
||||
type="file"
|
||||
class="absolute inset-0 w-full h-full opacity-0 cursor-pointer"
|
||||
accept=".pdf,.docx,.doc,.txt"
|
||||
multiple
|
||||
(change)="onFileSelected($event)"
|
||||
/>
|
||||
|
||||
<div class="dropzone-icon-wrapper">
|
||||
<svg
|
||||
class="w-12 h-12 text-primary transition-transform duration-300"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="1.5"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
||||
<polyline points="17 8 12 3 7 8" />
|
||||
<line x1="12" y1="3" x2="12" y2="15" />
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="dropzone-text text-center">
|
||||
<p class="text-sm font-medium text-[var(--text-secondary)]">
|
||||
فایلها را اینجا رها کنید
|
||||
</p>
|
||||
<p class="text-xs text-[var(--text-muted)] mt-1">یا کلیک کنید برای انتخاب</p>
|
||||
<p class="text-xs text-[var(--text-muted)] mt-2">پشتیبانی: PDF، DOCX، TXT</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (fileCount > 0) {
|
||||
<div class="file-list mt-6 animate-slide-up">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h3 class="text-lg font-medium text-[var(--text-primary)] flex items-center gap-2">
|
||||
<svg
|
||||
class="w-5 h-5 text-primary"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
|
||||
<polyline points="14 2 14 8 20 8" />
|
||||
</svg>
|
||||
فایلهای انتخاب شده ({{ fileCount }})
|
||||
</h3>
|
||||
<button
|
||||
type="button"
|
||||
class="text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors duration-200"
|
||||
(click)="clearAllFiles()"
|
||||
>
|
||||
پاک کردن همه
|
||||
</button>
|
||||
</div>
|
||||
<ul class="space-y-2">
|
||||
@for (file of uploadedFiles(); track $index) {
|
||||
<li
|
||||
class="file-item flex items-center justify-between gap-3 p-4 bg-[var(--card-bg)] rounded-xl shadow-[0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 hover:shadow-[0_4px_16px_rgba(0,0,0,0.08)] hover:-translate-y-0.5"
|
||||
>
|
||||
<div class="flex items-center gap-3 min-w-0">
|
||||
<div class="file-icon-wrapper p-2 bg-primary/10 rounded-lg shrink-0">
|
||||
<svg
|
||||
class="w-5 h-5 text-primary"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
|
||||
<polyline points="14 2 14 8 20 8" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="flex flex-col min-w-0">
|
||||
<span class="text-sm font-medium text-[var(--text-secondary)] truncate">{{
|
||||
file.name
|
||||
}}</span>
|
||||
<span class="text-xs text-[var(--text-muted)]">{{
|
||||
formatFileSize(file.size)
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="file-remove-btn p-2 text-[var(--text-muted)] rounded-lg transition-all duration-200 hover:text-red-400 hover:bg-red-400/10 hover:scale-110 shrink-0"
|
||||
(click)="removeFile($index)"
|
||||
aria-label="حذف فایل {{ file.name }}"
|
||||
>
|
||||
<svg
|
||||
class="w-4 h-4"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<line x1="18" y1="6" x2="6" y2="18" />
|
||||
<line x1="6" y1="6" x2="18" y2="18" />
|
||||
</svg>
|
||||
</button>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (activeTab() === 'app') {
|
||||
<section class="app-section animate-fade-in">
|
||||
<div class="section-header mb-6">
|
||||
<h2
|
||||
class="text-xl font-semibold text-[var(--text-primary)] mb-1 flex items-center gap-2"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5 text-primary"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path
|
||||
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"
|
||||
/>
|
||||
</svg>
|
||||
تنظیمات کلی
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="settings-grid space-y-3">
|
||||
<div
|
||||
class="setting-item flex items-center justify-between gap-4 p-4 bg-[var(--card-bg)] rounded-xl shadow-[0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 hover:shadow-[0_4px_16px_rgba(0,0,0,0.08)] hover:-translate-y-0.5"
|
||||
>
|
||||
<div class="setting-info flex flex-col gap-1 min-w-0">
|
||||
<span class="text-sm font-medium text-[var(--text-secondary)]"
|
||||
>زبان رابط کاربری</span
|
||||
>
|
||||
<span class="text-xs text-[var(--text-muted)]"
|
||||
>زبان نمایش برنامه را انتخاب کنید</span
|
||||
>
|
||||
</div>
|
||||
<div class="setting-control shrink-0">
|
||||
<select
|
||||
class="form-select bg-[var(--input-bg)] text-[var(--text-secondary)] border border-[var(--input-border)] rounded-lg px-3 py-2 text-sm min-w-[140px] cursor-pointer transition-all duration-200 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 focus:shadow-[0_0_0_3px_var(--color-primary)/20]"
|
||||
[(ngModel)]="language"
|
||||
>
|
||||
<option value="fa">فارسی</option>
|
||||
<option value="en">English</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="setting-item flex items-center justify-between gap-4 p-4 bg-[var(--card-bg)] rounded-xl shadow-[0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 hover:shadow-[0_4px_16px_rgba(0,0,0,0.08)] hover:-translate-y-0.5"
|
||||
>
|
||||
<div class="setting-info flex flex-col gap-1 min-w-0">
|
||||
<span class="text-sm font-medium text-[var(--text-secondary)]">اعلانها</span>
|
||||
<span class="text-xs text-[var(--text-muted)]">دریافت اعلانهای برنامه</span>
|
||||
</div>
|
||||
<div class="setting-control shrink-0">
|
||||
<label class="toggle-switch" [class.toggle-active]="notificationsEnabled()">
|
||||
<input type="checkbox" [(ngModel)]="notificationsEnabled" />
|
||||
<span class="toggle-slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="setting-item flex items-center justify-between gap-4 p-4 bg-[var(--card-bg)] rounded-xl shadow-[0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 hover:shadow-[0_4px_16px_rgba(0,0,0,0.08)] hover:-translate-y-0.5"
|
||||
>
|
||||
<div class="setting-info flex flex-col gap-1 min-w-0">
|
||||
<span class="text-sm font-medium text-[var(--text-secondary)]">حالت تاریک</span>
|
||||
<span class="text-xs text-[var(--text-muted)]">تغییر ظاهر برنامه به حالت تیره</span>
|
||||
</div>
|
||||
<div class="setting-control shrink-0">
|
||||
<label class="toggle-switch" [class.toggle-active]="isDarkMode()">
|
||||
<input type="checkbox" [checked]="isDarkMode()" (change)="toggleDarkMode()" />
|
||||
<span class="toggle-slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="setting-item flex items-center justify-between gap-4 p-4 bg-[var(--card-bg)] rounded-xl shadow-[0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 hover:shadow-[0_4px_16px_rgba(0,0,0,0.08)] hover:-translate-y-0.5"
|
||||
>
|
||||
<div class="setting-info flex flex-col gap-1 min-w-0">
|
||||
<span class="text-sm font-medium text-[var(--text-secondary)]">حالت RTL</span>
|
||||
<span class="text-xs text-[var(--text-muted)]"
|
||||
>جهت متن راستبهچپ (فارسی/عربی)</span
|
||||
>
|
||||
</div>
|
||||
<div class="setting-control shrink-0">
|
||||
<label class="toggle-switch" [class.toggle-active]="isRTL()">
|
||||
<input type="checkbox" [checked]="isRTL()" (change)="toggleRTL()" />
|
||||
<span class="toggle-slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user