feat: add clinic management and financial reporting features

- Implemented ClinicFormPage for adding new clinics with validation.
- Created MyFinancialPage to display financial summaries and charts.
- Developed MyPatientsPage for managing patient data with search and pagination.
- Added PreRegistrationsPage for handling pre-registration requests with approval and rejection functionalities.
- Introduced database migration for pre_registrations table.
- Built PreRegistrationController for managing pre-registration logic, including submission, approval, and rejection.
- Created PreRegistration entity and repository for handling pre-registration data.
This commit is contained in:
hamed
2026-06-12 12:31:27 +03:30
parent 92cb834c22
commit 8ad983310c
14 changed files with 1772 additions and 469 deletions
+12
View File
@@ -29,6 +29,10 @@ import SecretariesPage from './pages/SecretariesPage';
import MyClinicPage from './pages/MyClinicPage'; import MyClinicPage from './pages/MyClinicPage';
import SettingsPage from './pages/SettingsPage'; import SettingsPage from './pages/SettingsPage';
import DoctorProfilePage from './pages/DoctorProfilePage'; import DoctorProfilePage from './pages/DoctorProfilePage';
import MyPatientsPage from './pages/MyPatientsPage';
import MyFinancialPage from './pages/MyFinancialPage';
import ClinicFormPage from './pages/ClinicFormPage';
import PreRegistrationsPage from './pages/PreRegistrationsPage';
// ── Guards ────────────────────────────────────────────────────────────────── // ── Guards ──────────────────────────────────────────────────────────────────
@@ -134,6 +138,14 @@ export default function App() {
<Route path="doctors/new" element={<RoleRoute roles={['admin']}><DoctorFormPage /></RoleRoute>} /> <Route path="doctors/new" element={<RoleRoute roles={['admin']}><DoctorFormPage /></RoleRoute>} />
<Route path="doctors/:uuid" element={<RoleRoute roles={['admin', 'doctor']}><DoctorDetailPage /></RoleRoute>} /> <Route path="doctors/:uuid" element={<RoleRoute roles={['admin', 'doctor']}><DoctorDetailPage /></RoleRoute>} />
<Route path="profile" element={<RoleRoute roles={['doctor']}><DoctorProfilePage /></RoleRoute>} /> <Route path="profile" element={<RoleRoute roles={['doctor']}><DoctorProfilePage /></RoleRoute>} />
{/* دکتر / منشی / کلینیک */}
<Route path="my-patients" element={<RoleRoute roles={['doctor', 'secretary', 'clinic']}><MyPatientsPage /></RoleRoute>} />
<Route path="my-financial" element={<RoleRoute roles={['doctor', 'secretary', 'clinic']}><MyFinancialPage /></RoleRoute>} />
{/* فقط ادمین */}
<Route path="clinics/new" element={<RoleRoute roles={['admin']}><ClinicFormPage /></RoleRoute>} />
<Route path="pre-registrations" element={<RoleRoute roles={['admin']}><PreRegistrationsPage /></RoleRoute>} />
</Route> </Route>
<Route path="*" element={<Navigate to="/admin/dashboard" replace />} /> <Route path="*" element={<Navigate to="/admin/dashboard" replace />} />
@@ -3,6 +3,7 @@ import {
ArrowsRightLeftIcon, ArrowsRightLeftIcon,
BanknotesIcon, BanknotesIcon,
BuildingOffice2Icon, BuildingOffice2Icon,
ClipboardDocumentCheckIcon,
Cog6ToothIcon, Cog6ToothIcon,
CalendarDaysIcon, CalendarDaysIcon,
ChartBarIcon, ChartBarIcon,
@@ -43,6 +44,7 @@ function buildSections(primaryRole: string | null, dbUuid: string | null): Secti
{ to: '/admin/appointments', icon: CalendarDaysIcon, label: 'نوبت‌ها' }, { to: '/admin/appointments', icon: CalendarDaysIcon, label: 'نوبت‌ها' },
{ to: '/admin/payments', icon: CreditCardIcon, label: 'پرداخت‌ها' }, { to: '/admin/payments', icon: CreditCardIcon, label: 'پرداخت‌ها' },
{ to: '/admin/settlements', icon: BanknotesIcon, label: 'تسویه‌حساب' }, { to: '/admin/settlements', icon: BanknotesIcon, label: 'تسویه‌حساب' },
{ to: '/admin/pre-registrations', icon: ClipboardDocumentCheckIcon, label: 'درخواست‌های ثبت‌نام' },
], ],
}, },
{ {
+83
View File
@@ -0,0 +1,83 @@
import React from 'react';
import { useNavigate } from 'react-router-dom';
import { useMutation } from '@tanstack/react-query';
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { z } from 'zod';
import { ArrowRightIcon, BuildingOffice2Icon } from '@heroicons/react/24/outline';
import { toast } from 'sonner';
import { api } from '../lib/api';
import type { ApiResponse } from '../lib/api';
const schema = z.object({
owner_mobile: z.string().min(10, 'شماره موبایل معتبر نیست').max(15),
name: z.string().min(2, 'نام کلینیک حداقل ۲ کاراکتر'),
telephone: z.string().max(20).optional().or(z.literal('')),
address: z.string().max(500).optional().or(z.literal('')),
info: z.string().max(2000).optional().or(z.literal('')),
});
type FormValues = z.infer<typeof schema>;
interface ClinicCreated { uuid: string; name: string; is_active: boolean }
export default function ClinicFormPage() {
const navigate = useNavigate();
const { register, handleSubmit, formState: { errors, isSubmitting } } = useForm<FormValues>({ resolver: zodResolver(schema) });
const mutation = useMutation<ApiResponse<ClinicCreated>, Error, FormValues>({
mutationFn: (body) => api.post('/api/v1/admin/clinic', body),
onSuccess: (res) => {
toast.success(`کلینیک "${res?.data?.name}" ایجاد شد`);
navigate('/admin/clinics');
},
onError: (err) => toast.error(err.message ?? 'خطا در ایجاد کلینیک'),
});
return (
<div className="page" style={{ maxWidth: 640 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 28 }}>
<button className="btn ghost sm" onClick={() => navigate('/admin/clinics')}>
<ArrowRightIcon style={{ width: 16, height: 16 }} />بازگشت
</button>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<BuildingOffice2Icon style={{ width: 22, height: 22, color: 'var(--primary)' }} />
<h1 style={{ margin: 0, fontSize: 20, fontWeight: 700 }}>افزودن کلینیک جدید</h1>
</div>
</div>
<div className="card">
<form onSubmit={handleSubmit((v) => mutation.mutate(v))} style={{ display: 'flex', flexDirection: 'column', gap: 20 }}>
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
<label style={{ fontSize: 13, fontWeight: 600 }}>شماره موبایل صاحب کلینیک <span style={{ color: 'var(--red)' }}>*</span></label>
<input className="field" placeholder="09xxxxxxxxx" dir="ltr" {...register('owner_mobile')} />
{errors.owner_mobile && <span style={{ color: 'var(--red)', fontSize: 12 }}>{errors.owner_mobile.message}</span>}
<span style={{ fontSize: 11, color: 'var(--text-3)' }}>اگر این موبایل در سیستم نباشد، کاربر جدید ساخته میشود</span>
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
<label style={{ fontSize: 13, fontWeight: 600 }}>نام کلینیک <span style={{ color: 'var(--red)' }}>*</span></label>
<input className="field" placeholder="مثال: کلینیک تخصصی پارسیان" {...register('name')} />
{errors.name && <span style={{ color: 'var(--red)', fontSize: 12 }}>{errors.name.message}</span>}
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
<label style={{ fontSize: 13, fontWeight: 600 }}>تلفن ثابت</label>
<input className="field" placeholder="02xxxxxxxx" dir="ltr" {...register('telephone')} />
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
<label style={{ fontSize: 13, fontWeight: 600 }}>آدرس</label>
<input className="field" placeholder="آدرس کلینیک" {...register('address')} />
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
<label style={{ fontSize: 13, fontWeight: 600 }}>توضیحات</label>
<textarea className="field" rows={3} placeholder="درباره کلینیک..." {...register('info')} style={{ resize: 'vertical' }} />
</div>
<div style={{ display: 'flex', gap: 12, justifyContent: 'flex-end', paddingTop: 8 }}>
<button type="button" className="btn ghost" onClick={() => navigate('/admin/clinics')}>انصراف</button>
<button type="submit" className="btn primary" disabled={isSubmitting || mutation.isPending}>
{mutation.isPending ? 'در حال ذخیره...' : 'ایجاد کلینیک'}
</button>
</div>
</form>
</div>
</div>
);
}
+83
View File
@@ -0,0 +1,83 @@
import React from 'react';
import { useQuery } from '@tanstack/react-query';
import { api } from '../lib/api';
import type { ApiResponse } from '../lib/api';
import { formatRial } from '../lib/utils';
import PageHeader from '../components/ui/PageHeader';
interface MonthlyEntry {
month: string;
paid: number;
count: number;
}
interface FinancialSummary {
total_paid: number;
total_pending: number;
total_refunded: number;
count_paid: number;
monthly_chart: MonthlyEntry[];
}
function KpiCard({ label, value, color }: { label: string; value: string; color: string }) {
return (
<div className="card" style={{ flex: '1 1 200px', minWidth: 0 }}>
<div style={{ color: 'var(--text-3)', fontSize: 13, marginBottom: 6 }}>{label}</div>
<div style={{ fontSize: 22, fontWeight: 700, color }}>{value}</div>
</div>
);
}
const BAR_MAX_HEIGHT = 120;
export default function MyFinancialPage() {
const { data, isLoading } = useQuery<ApiResponse<FinancialSummary>>({
queryKey: ['my-financial-summary'],
queryFn: () => api.get('/api/v1/my/financial-summary'),
});
const summary = data?.data;
const maxPaid = summary?.monthly_chart?.reduce((m, e) => Math.max(m, e.paid), 1) ?? 1;
return (
<div className="page">
<PageHeader title="گزارش مالی" description="خلاصه پرداخت‌های بیماران" />
{isLoading ? (
<div style={{ padding: 40, textAlign: 'center', color: 'var(--text-3)' }}>در حال بارگذاری...</div>
) : (
<>
<div style={{ display: 'flex', gap: 16, flexWrap: 'wrap', marginBottom: 24 }}>
<KpiCard label="مجموع پرداخت شده" value={formatRial(summary?.total_paid ?? 0)} color="var(--green)" />
<KpiCard label="در انتظار پرداخت" value={formatRial(summary?.total_pending ?? 0)} color="var(--orange)" />
<KpiCard label="مجموع استرداد" value={formatRial(summary?.total_refunded ?? 0)} color="var(--red)" />
<KpiCard label="تعداد پرداخت موفق" value={String(summary?.count_paid ?? 0)} color="var(--primary)" />
</div>
<div className="card">
<div style={{ fontWeight: 600, marginBottom: 20 }}>نمودار ۶ ماه اخیر</div>
{summary?.monthly_chart?.length ? (
<div style={{ display: 'flex', alignItems: 'flex-end', gap: 12, height: BAR_MAX_HEIGHT + 40 }}>
{summary.monthly_chart.map((entry) => {
const barH = Math.max(4, Math.round((entry.paid / maxPaid) * BAR_MAX_HEIGHT));
return (
<div key={entry.month} style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 6 }}>
<div style={{ fontSize: 11, color: 'var(--text-3)' }}>{formatRial(entry.paid)}</div>
<div
style={{ width: '100%', height: barH, borderRadius: 6, background: 'linear-gradient(to top, var(--primary), oklch(0.72 0.16 256))', transition: 'height 0.3s ease' }}
title={`${entry.month}: ${formatRial(entry.paid)}${entry.count} پرداخت`}
/>
<div style={{ fontSize: 11, color: 'var(--text-2)', whiteSpace: 'nowrap' }}>{entry.month}</div>
</div>
);
})}
</div>
) : (
<div style={{ textAlign: 'center', color: 'var(--text-3)', padding: 32 }}>دادهای برای نمایش وجود ندارد</div>
)}
</div>
</>
)}
</div>
);
}
+86
View File
@@ -0,0 +1,86 @@
import React, { useState } from 'react';
import { useQuery } from '@tanstack/react-query';
import { PhoneIcon } from '@heroicons/react/24/outline';
import { api } from '../lib/api';
import type { PaginatedResponse } from '../lib/api';
import { formatDate, formatNumber } from '../lib/utils';
import DataTable, { type Column } from '../components/ui/DataTable';
import Pagination from '../components/ui/Pagination';
import PageHeader from '../components/ui/PageHeader';
interface Patient {
uuid: string;
name: string;
mobile: string;
total_appointments: number;
last_appointment: number | null;
}
const EMPTY: Patient[] = [];
export default function MyPatientsPage() {
const [page, setPage] = useState(1);
const [search, setSearch] = useState('');
const limit = 20;
const { data, isLoading } = useQuery<PaginatedResponse<Patient>>({
queryKey: ['my-patients', page, search],
queryFn: () => api.get(`/api/v1/my/patients?page=${page}&limit=${limit}&search=${encodeURIComponent(search)}`),
});
const patients = data?.data ?? EMPTY;
const total = data?.meta?.totalRecords ?? 0;
const columns: Column<Patient>[] = [
{
key: 'name',
header: 'نام بیمار',
render: (p) => (
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<div className="avatar sm" style={{ background: 'linear-gradient(145deg, oklch(0.62 0.15 256), oklch(0.48 0.16 256))', flexShrink: 0 }}>
{(p.name || '؟').charAt(0)}
</div>
<span>{p.name || '—'}</span>
</div>
),
},
{
key: 'mobile',
header: 'موبایل',
render: (p) => (
<div style={{ display: 'flex', alignItems: 'center', gap: 6, direction: 'ltr' }}>
<PhoneIcon style={{ width: 14, height: 14, color: 'var(--text-3)' }} />
<span>{p.mobile}</span>
</div>
),
},
{
key: 'total_appointments',
header: 'تعداد نوبت',
render: (p) => <span className="badge blue">{formatNumber(p.total_appointments)}</span>,
},
{
key: 'last_appointment',
header: 'آخرین نوبت',
render: (p) => p.last_appointment ? formatDate(String(p.last_appointment)) : '—',
},
];
return (
<div className="page">
<PageHeader title="بیماران من" description={`${formatNumber(total)} بیمار`} />
<DataTable
columns={columns}
data={patients}
loading={isLoading}
searchValue={search}
onSearchChange={(v) => { setSearch(v); setPage(1); }}
searchPlaceholder="جستجوی نام یا موبایل..."
emptyMessage="بیماری یافت نشد"
/>
<Pagination page={page} total={total} limit={limit} onPageChange={setPage} />
</div>
);
}
+238
View File
@@ -0,0 +1,238 @@
import React, { useState } from 'react';
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import { CheckIcon, XMarkIcon, PhoneIcon } from '@heroicons/react/24/outline';
import { toast } from 'sonner';
import { api } from '../lib/api';
import type { PaginatedResponse } from '../lib/api';
import { formatDate } from '../lib/utils';
import PageHeader from '../components/ui/PageHeader';
import Pagination from '../components/ui/Pagination';
import ConfirmDialog from '../components/ui/ConfirmDialog';
interface PreRegistration {
uuid: string;
type: 'independent_doctor' | 'doctor_with_clinic' | 'clinic_manager';
name: string;
mobile: string;
info: string | null;
status: 'pending' | 'approved' | 'rejected';
admin_note: string | null;
created_at: number;
}
const EMPTY: PreRegistration[] = [];
const TYPE_META: Record<string, { label: string; color: string }> = {
independent_doctor: { label: 'دکتر', color: 'blue' },
doctor_with_clinic: { label: 'دکتر + کلینیک', color: 'purple' },
clinic_manager: { label: 'مدیر کلینیک', color: 'orange' },
};
const STATUS_META: Record<string, { label: string; color: string }> = {
pending: { label: 'در انتظار', color: 'yellow' },
approved: { label: 'تأیید شده', color: 'green' },
rejected: { label: 'رد شده', color: 'red' },
};
const STATUS_TABS = [
{ value: 'pending', label: 'در انتظار' },
{ value: 'approved', label: 'تأیید شده' },
{ value: 'rejected', label: 'رد شده' },
{ value: 'all', label: 'همه' },
];
export default function PreRegistrationsPage() {
const qc = useQueryClient();
const [page, setPage] = useState(1);
const [statusFilter, setStatusFilter] = useState('pending');
const [approveTarget, setApproveTarget] = useState<PreRegistration | null>(null);
const [rejectTarget, setRejectTarget] = useState<PreRegistration | null>(null);
const [rejectNote, setRejectNote] = useState('');
const limit = 20;
const { data, isLoading } = useQuery<PaginatedResponse<PreRegistration>>({
queryKey: ['pre-registrations', page, statusFilter],
queryFn: () => api.get(`/api/v1/admin/pre-registrations?page=${page}&limit=${limit}&status=${statusFilter}`),
});
const items = data?.data ?? EMPTY;
const total = data?.meta?.totalRecords ?? 0;
const approveMutation = useMutation({
mutationFn: (uuid: string) => api.post(`/api/v1/admin/pre-registrations/${uuid}/approve`, {}),
onSuccess: () => {
toast.success('درخواست تأیید شد و اطلاعات ورود ارسال گردید');
setApproveTarget(null);
qc.invalidateQueries({ queryKey: ['pre-registrations'] });
},
onError: (err: Error) => toast.error(err.message),
});
const rejectMutation = useMutation({
mutationFn: ({ uuid, note }: { uuid: string; note: string }) =>
api.post(`/api/v1/admin/pre-registrations/${uuid}/reject`, { note: note || undefined }),
onSuccess: () => {
toast.success('درخواست رد شد');
setRejectTarget(null);
setRejectNote('');
qc.invalidateQueries({ queryKey: ['pre-registrations'] });
},
onError: (err: Error) => toast.error(err.message),
});
return (
<div className="page">
<PageHeader title="درخواست‌های ثبت‌نام" description={`${total} درخواست`} />
{/* Tabs */}
<div className="seg" style={{ marginBottom: 20, width: 'fit-content' }}>
{STATUS_TABS.map((tab) => (
<button
key={tab.value}
className={statusFilter === tab.value ? 'active' : ''}
onClick={() => { setStatusFilter(tab.value); setPage(1); }}
>
{tab.label}
</button>
))}
</div>
<div className="card" style={{ padding: 0, overflow: 'hidden' }}>
<table className="t">
<thead>
<tr>
<th>نام</th>
<th>موبایل</th>
<th>نوع حساب</th>
<th>توضیحات</th>
<th>وضعیت</th>
<th>تاریخ درخواست</th>
{statusFilter === 'pending' && <th />}
</tr>
</thead>
<tbody>
{isLoading
? Array.from({ length: 8 }).map((_, i) => (
<tr key={i}>
{Array.from({ length: 6 }).map((_, j) => (
<td key={j}><div className="skeleton" style={{ height: 16, borderRadius: 6 }} /></td>
))}
</tr>
))
: items.length === 0
? (
<tr>
<td colSpan={7} style={{ textAlign: 'center', padding: 48, color: 'var(--text-3)' }}>
درخواستی یافت نشد
</td>
</tr>
)
: items.map((item) => {
const typeMeta = TYPE_META[item.type] ?? { label: item.type, color: 'gray' };
const statusMeta = STATUS_META[item.status] ?? { label: item.status, color: 'gray' };
return (
<tr key={item.uuid}>
<td>
<div style={{ fontWeight: 600 }}>{item.name}</div>
</td>
<td>
<div style={{ display: 'flex', alignItems: 'center', gap: 6, direction: 'ltr' }}>
<PhoneIcon style={{ width: 13, height: 13, color: 'var(--text-3)' }} />
<span style={{ fontSize: 13 }}>{item.mobile}</span>
</div>
</td>
<td>
<span className={`badge ${typeMeta.color}`}>
<span className="bdot" />{typeMeta.label}
</span>
</td>
<td style={{ maxWidth: 200 }}>
<span style={{ fontSize: 12, color: 'var(--text-2)', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden' }}>
{item.info || '—'}
</span>
</td>
<td>
<span className={`badge ${statusMeta.color}`}>
<span className="bdot" />{statusMeta.label}
</span>
{item.admin_note && (
<div style={{ fontSize: 11, color: 'var(--text-3)', marginTop: 3 }}>{item.admin_note}</div>
)}
</td>
<td style={{ fontSize: 13 }}>{formatDate(String(item.created_at))}</td>
{statusFilter === 'pending' && (
<td>
<div className="row-actions">
<button
className="mini-btn"
title="تأیید"
style={{ color: 'var(--green)' }}
onClick={() => setApproveTarget(item)}
>
<CheckIcon style={{ width: 16, height: 16 }} />
</button>
<button
className="mini-btn"
title="رد"
style={{ color: 'var(--red)' }}
onClick={() => { setRejectTarget(item); setRejectNote(''); }}
>
<XMarkIcon style={{ width: 16, height: 16 }} />
</button>
</div>
</td>
)}
</tr>
);
})}
</tbody>
</table>
</div>
<Pagination page={page} total={total} limit={limit} onPageChange={setPage} />
{/* Approve Dialog */}
<ConfirmDialog
open={!!approveTarget}
title="تأیید درخواست"
message={`آیا درخواست "${approveTarget?.name}" را تأیید می‌کنید؟ اطلاعات ورود از طریق SMS ارسال خواهد شد.`}
confirmLabel="تأیید و ارسال SMS"
loading={approveMutation.isPending}
onConfirm={() => approveTarget && approveMutation.mutate(approveTarget.uuid)}
onCancel={() => setApproveTarget(null)}
/>
{/* Reject Dialog */}
{rejectTarget && (
<div className="overlay" onClick={() => setRejectTarget(null)}>
<div className="modal" style={{ maxWidth: 420 }} onClick={(e) => e.stopPropagation()}>
<div className="modal-head">
<b>رد درخواست {rejectTarget.name}</b>
</div>
<div className="modal-body" style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
<p style={{ margin: 0, fontSize: 13, color: 'var(--text-2)' }}>در صورت تمایل دلیل رد را وارد کنید (اختیاری)</p>
<textarea
className="field"
rows={3}
placeholder="دلیل رد..."
value={rejectNote}
onChange={(e) => setRejectNote(e.target.value)}
style={{ resize: 'vertical' }}
/>
</div>
<div className="modal-foot">
<button className="btn ghost sm" onClick={() => setRejectTarget(null)}>انصراف</button>
<button
className="btn danger sm"
disabled={rejectMutation.isPending}
onClick={() => rejectMutation.mutate({ uuid: rejectTarget.uuid, note: rejectNote })}
>
{rejectMutation.isPending ? 'در حال رد...' : 'رد درخواست'}
</button>
</div>
</div>
</div>
)}
</div>
);
}
+1 -1
View File
@@ -33,7 +33,7 @@ security:
provider: api_doc_provider provider: api_doc_provider
public_endpoints: public_endpoints:
pattern: ^/(api/v1/user/(send-code|verify-code|register)|oauth/token$|session/token|api/v1/categorys/|api/v1/doctors$|api/v1/clinics$|api/v1/clinic/doctor-list/|api/v1/clinic-pro/doctor-addresses/|api/v1/appointment-slots|api/v1/comments/|api/v1/rate/|api/v1/blogs$|api/v1/clinic-invitation/) pattern: ^/(api/v1/user/(send-code|verify-code|register)|oauth/token$|session/token|api/v1/categorys/|api/v1/doctors$|api/v1/clinics$|api/v1/clinic/doctor-list/|api/v1/clinic-pro/doctor-addresses/|api/v1/appointment-slots|api/v1/comments/|api/v1/rate/|api/v1/blogs$|api/v1/clinic-invitation/|api/v1/pre-registration$)
stateless: true stateless: true
security: false security: false
+70
View File
@@ -801,3 +801,73 @@ Update one or more settings. Unknown keys are silently ignored.
- `commission_enabled``"1"` = active, `"0"` = inactive - `commission_enabled``"1"` = active, `"0"` = inactive
- `commission_percent` — integer string, `0``100` - `commission_percent` — integer string, `0``100`
- Commission applies only to regular users (`booked_by = user`); secretaries are exempt - Commission applies only to regular users (`booked_by = user`); secretaries are exempt
---
## Pre-Registration Management
### GET `/api/v1/admin/pre-registrations`
List pre-registration requests. **Permission:** `ROLE_ADMIN`
**Query params:**
| Param | Default | Notes |
|-------|---------|-------|
| `page` | 1 | |
| `limit` | 20 | max 50 |
| `status` | `pending` | `pending` \| `approved` \| `rejected` \| `all` |
**Response `200`** (paginated):
```json
{
"success": true,
"data": [
{
"uuid": "...",
"type": "independent_doctor",
"name": "دکتر احمدی",
"mobile": "09121234567",
"info": "متخصص داخلی",
"status": "pending",
"admin_note": null,
"created_at": 1718000000
}
],
"meta": { "totalRecords": 5, "totalPages": 1, "currentPage": 1 }
}
```
---
### POST `/api/v1/admin/pre-registrations/{uuid}/approve`
Approve a pending request. Creates User + Doctor/Clinic entity based on `type`, resets password, sends SMS. **Permission:** `ROLE_ADMIN`
**Response `200`:**
```json
{ "success": true, "data": { "message": "تأیید شد و اطلاعات ورود ارسال گردید" } }
```
**Error Codes:**
| Code | HTTP | Meaning |
|------|------|---------|
| `NOT_FOUND` | 404 | UUID not found |
| `ALREADY_PROCESSED` | 409 | Status is not pending |
---
### POST `/api/v1/admin/pre-registrations/{uuid}/reject`
Reject a pending request. **Permission:** `ROLE_ADMIN`
**Request body** (optional):
```json
{ "note": "مدارک ناقص است" }
```
**Response `200`:**
```json
{ "success": true, "data": { "message": "درخواست رد شد" } }
```
+47
View File
@@ -507,3 +507,50 @@ Invalidate the refresh token (stored in Redis).
} }
} }
``` ```
---
## POST `/api/v1/pre-registration`
Submit a pre-registration request (doctor or clinic). Public endpoint — no auth required.
**Permission:** Public
### Request Body
```json
{
"type": "independent_doctor",
"name": "دکتر علی احمدی",
"mobile": "09121234567",
"info": "متخصص داخلی، ۱۰ سال سابقه"
}
```
| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `type` | string | ✅ | `independent_doctor` \| `doctor_with_clinic` \| `clinic_manager` |
| `name` | string | ✅ | min 2 chars |
| `mobile` | string | ✅ | 1015 chars |
| `info` | string | ❌ | specialty, address, etc. |
**Type meanings:**
| Value | Roles granted on approval | Entities created |
|-------|--------------------------|-----------------|
| `independent_doctor` | `ROLE_DOCTOR` | Doctor |
| `doctor_with_clinic` | `ROLE_DOCTOR` + `ROLE_CLINIC` | Doctor + Clinic |
| `clinic_manager` | `ROLE_CLINIC` | Clinic |
### Response `200`
```json
{
"success": true,
"data": { "uuid": "...", "status": "pending" }
}
```
### Error Codes
| Code | HTTP | Meaning |
|------|------|---------|
| `VALIDATION_ERROR` | 422 | Invalid type / mobile / name |
| `DUPLICATE_REQUEST` | 409 | Pending request already exists for this mobile |
+31
View File
@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260612081739 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE pre_registrations (id INT AUTO_INCREMENT NOT NULL, uuid VARCHAR(36) NOT NULL, type VARCHAR(30) NOT NULL, name VARCHAR(255) NOT NULL, mobile VARCHAR(20) NOT NULL, info LONGTEXT DEFAULT NULL, status VARCHAR(20) NOT NULL, admin_note LONGTEXT DEFAULT NULL, created_at INT NOT NULL, updated_at INT NOT NULL, UNIQUE INDEX UNIQ_A9113AD2D17F50A6 (uuid), INDEX idx_prereg_mobile (mobile), INDEX idx_prereg_status (status), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE pre_registrations');
}
}
@@ -0,0 +1,188 @@
<?php
namespace App\Auth\Controller;
use App\Auth\Entity\PreRegistration;
use App\Auth\Entity\User;
use App\Auth\Repository\PreRegistrationRepository;
use App\Auth\Repository\UserRepository;
use App\Clinic\Entity\Clinic;
use App\Clinic\Repository\ClinicRepository;
use App\Doctor\Entity\Doctor;
use App\Doctor\Repository\DoctorRepository;
use App\Shared\Constant\ErrorCodes;
use App\Shared\Controller\BaseController;
use App\Sms\Service\SmsService;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class PreRegistrationController extends BaseController
{
public function __construct(
private readonly EntityManagerInterface $em,
private readonly PreRegistrationRepository $preRegRepo,
private readonly UserRepository $userRepo,
private readonly DoctorRepository $doctorRepo,
private readonly ClinicRepository $clinicRepo,
private readonly UserPasswordHasherInterface $hasher,
private readonly SmsService $sms,
private readonly LoggerInterface $logger,
) {}
#[Route('/api/v1/pre-registration', methods: ['POST'])]
public function submit(Request $request): JsonResponse
{
$data = json_decode($request->getContent(), true) ?? [];
$type = trim($data['type'] ?? '');
$name = trim($data['name'] ?? '');
$mobile = trim($data['mobile'] ?? '');
$info = trim($data['info'] ?? '') ?: null;
$validTypes = [
PreRegistration::TYPE_INDEPENDENT_DOCTOR,
PreRegistration::TYPE_DOCTOR_WITH_CLINIC,
PreRegistration::TYPE_CLINIC_MANAGER,
];
if (!in_array($type, $validTypes, true)) {
return $this->error(ErrorCodes::ERR_VALIDATION_001, 'نوع حساب معتبر نیست', 422);
}
if (mb_strlen($mobile) < 10 || mb_strlen($mobile) > 15) {
return $this->error(ErrorCodes::ERR_VALIDATION_001, 'شماره موبایل معتبر نیست', 422);
}
if (mb_strlen($name) < 2) {
return $this->error(ErrorCodes::ERR_VALIDATION_001, 'نام الزامی است', 422);
}
if ($this->preRegRepo->hasPendingForMobile($mobile)) {
return $this->error('DUPLICATE_REQUEST', 'درخواست ثبت‌نام شما در حال بررسی است', 409);
}
$preReg = new PreRegistration($type, $name, $mobile, $info);
$this->em->persist($preReg);
$this->em->flush();
return $this->success(['uuid' => $preReg->getUuid(), 'status' => $preReg->getStatus()]);
}
#[Route('/api/v1/admin/pre-registrations', methods: ['GET'])]
#[IsGranted('ROLE_ADMIN')]
public function list(Request $request): JsonResponse
{
$page = max(1, (int) $request->query->get('page', 1));
$limit = min(50, max(1, (int) $request->query->get('limit', 20)));
$status = $request->query->get('status', 'pending');
$qb = $this->em->createQueryBuilder()
->select('p.uuid, p.type, p.name, p.mobile, p.info, p.status, p.adminNote AS admin_note, p.createdAt AS created_at')
->from(PreRegistration::class, 'p');
if ($status !== 'all') {
$qb->where('p.status = :status')->setParameter('status', $status);
}
$total = (clone $qb)->select('COUNT(p.id)')->getQuery()->getSingleScalarResult();
$items = $qb
->orderBy('p.createdAt', 'DESC')
->setFirstResult(($page - 1) * $limit)
->setMaxResults($limit)
->getQuery()
->getArrayResult();
return $this->paginated($items, (int) $total, $page, $limit);
}
#[Route('/api/v1/admin/pre-registrations/{uuid}/approve', methods: ['POST'])]
#[IsGranted('ROLE_ADMIN')]
public function approve(string $uuid): JsonResponse
{
$preReg = $this->preRegRepo->findOneBy(['uuid' => $uuid]);
if (!$preReg) {
return $this->error(ErrorCodes::ERR_NOT_FOUND_001, 'درخواست یافت نشد', 404);
}
if (!$preReg->isPending()) {
return $this->error(ErrorCodes::ERR_CONFLICT_001, 'این درخواست قبلاً پردازش شده است', 409);
}
$password = bin2hex(random_bytes(4));
$user = $this->userRepo->findOneBy(['mobileNumber' => $preReg->getMobile()]);
if (!$user) {
$user = new User($preReg->getMobile());
}
$user->setPasswordHash($this->hasher->hashPassword($user, $password));
$user->setRealName($preReg->getName());
$this->em->persist($user);
$type = $preReg->getType();
$doctor = null;
if ($type === PreRegistration::TYPE_INDEPENDENT_DOCTOR || $type === PreRegistration::TYPE_DOCTOR_WITH_CLINIC) {
$user->addRole('ROLE_DOCTOR');
$doctor = $this->doctorRepo->findOneBy(['user' => $user]);
if (!$doctor) {
$doctor = new Doctor($user, $preReg->getName());
$doctor->setMobileNumber($preReg->getMobile());
$this->em->persist($doctor);
}
}
if ($type === PreRegistration::TYPE_DOCTOR_WITH_CLINIC || $type === PreRegistration::TYPE_CLINIC_MANAGER) {
$user->addRole('ROLE_CLINIC');
if (!$this->clinicRepo->findOneBy(['user' => $user])) {
$clinic = new Clinic($user);
$clinic->setName($preReg->getName());
$clinic->setTelephone($preReg->getMobile());
$clinic->setNotificationMobile($preReg->getMobile());
if ($doctor !== null) {
$clinic->getDoctors()->add($doctor);
}
$this->em->persist($clinic);
}
}
$preReg->approve();
$this->em->flush();
try {
$this->sms->dispatchAsync(
$preReg->getMobile(),
sprintf(
'به کلینیک پرو خوش آمدید! شماره‌کاربری: %s | رمز عبور: %s | لینک ورود: https://clinic-pro.ddev.site/admin',
$preReg->getMobile(),
$password
)
);
} catch (\Throwable $e) {
$this->logger->warning('PreRegistration SMS failed', ['uuid' => $uuid, 'error' => $e->getMessage()]);
}
return $this->success(['message' => 'تأیید شد و اطلاعات ورود ارسال گردید']);
}
#[Route('/api/v1/admin/pre-registrations/{uuid}/reject', methods: ['POST'])]
#[IsGranted('ROLE_ADMIN')]
public function reject(string $uuid, Request $request): JsonResponse
{
$preReg = $this->preRegRepo->findOneBy(['uuid' => $uuid]);
if (!$preReg) {
return $this->error(ErrorCodes::ERR_NOT_FOUND_001, 'درخواست یافت نشد', 404);
}
if (!$preReg->isPending()) {
return $this->error(ErrorCodes::ERR_CONFLICT_001, 'این درخواست قبلاً پردازش شده است', 409);
}
$data = json_decode($request->getContent(), true) ?? [];
$preReg->reject($data['note'] ?? null);
$this->em->flush();
return $this->success(['message' => 'درخواست رد شد']);
}
}
+91
View File
@@ -0,0 +1,91 @@
<?php
namespace App\Auth\Entity;
use App\Auth\Repository\PreRegistrationRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: PreRegistrationRepository::class)]
#[ORM\Table(name: 'pre_registrations')]
#[ORM\Index(columns: ['mobile'], name: 'idx_prereg_mobile')]
#[ORM\Index(columns: ['status'], name: 'idx_prereg_status')]
class PreRegistration
{
public const TYPE_INDEPENDENT_DOCTOR = 'independent_doctor';
public const TYPE_DOCTOR_WITH_CLINIC = 'doctor_with_clinic';
public const TYPE_CLINIC_MANAGER = 'clinic_manager';
public const STATUS_PENDING = 'pending';
public const STATUS_APPROVED = 'approved';
public const STATUS_REJECTED = 'rejected';
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;
#[ORM\Column(type: 'string', length: 36, unique: true)]
private string $uuid;
#[ORM\Column(type: 'string', length: 30)]
private string $type;
#[ORM\Column(type: 'string', length: 255)]
private string $name;
#[ORM\Column(type: 'string', length: 20)]
private string $mobile;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $info = null;
#[ORM\Column(type: 'string', length: 20)]
private string $status = self::STATUS_PENDING;
#[ORM\Column(name: 'admin_note', type: 'text', nullable: true)]
private ?string $adminNote = null;
#[ORM\Column(name: 'created_at', type: 'integer')]
private int $createdAt;
#[ORM\Column(name: 'updated_at', type: 'integer')]
private int $updatedAt;
public function __construct(string $type, string $name, string $mobile, ?string $info = null)
{
$this->uuid = Uuid::v4()->toRfc4122();
$this->type = $type;
$this->name = $name;
$this->mobile = $mobile;
$this->info = $info;
$this->createdAt = time();
$this->updatedAt = time();
}
public function getId(): ?int { return $this->id; }
public function getUuid(): string { return $this->uuid; }
public function getType(): string { return $this->type; }
public function getName(): string { return $this->name; }
public function getMobile(): string { return $this->mobile; }
public function getInfo(): ?string { return $this->info; }
public function getStatus(): string { return $this->status; }
public function getAdminNote(): ?string { return $this->adminNote; }
public function getCreatedAt(): int { return $this->createdAt; }
public function getUpdatedAt(): int { return $this->updatedAt; }
public function approve(): void
{
$this->status = self::STATUS_APPROVED;
$this->updatedAt = time();
}
public function reject(?string $note = null): void
{
$this->status = self::STATUS_REJECTED;
$this->adminNote = $note;
$this->updatedAt = time();
}
public function isPending(): bool { return $this->status === self::STATUS_PENDING; }
}
@@ -0,0 +1,28 @@
<?php
namespace App\Auth\Repository;
use App\Auth\Entity\PreRegistration;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
class PreRegistrationRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, PreRegistration::class);
}
public function hasPendingForMobile(string $mobile): bool
{
return (bool) $this->createQueryBuilder('p')
->select('1')
->where('p.mobile = :mobile')
->andWhere('p.status = :status')
->setParameter('mobile', $mobile)
->setParameter('status', PreRegistration::STATUS_PENDING)
->setMaxResults(1)
->getQuery()
->getOneOrNullResult();
}
}
+419 -75
View File
@@ -7,7 +7,9 @@
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin/> <link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"/> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"/>
{{ encore_entry_link_tags('home') }} {{ encore_entry_link_tags('home') }}
<script>document.documentElement.classList.add('js');</script> <script>
document.documentElement.classList.add('js');
</script>
</head> </head>
<body> <body>
@@ -15,7 +17,8 @@
<header class="site-header" id="header"> <header class="site-header" id="header">
<div class="wrap nav"> <div class="wrap nav">
<a class="brand" href="#hero" aria-label="کلینیک پرو"> <a class="brand" href="#hero" aria-label="کلینیک پرو">
<b>کلینیک پرو</b><span class="dot"></span> <b>کلینیک پرو</b>
<span class="dot"></span>
<small>مدیریت مطب</small> <small>مدیریت مطب</small>
</a> </a>
@@ -28,15 +31,11 @@
</nav> </nav>
<div class="nav-right"> <div class="nav-right">
<button class="nav-ico search" aria-label="جستجو">
<svg viewBox="0 0 24 24" fill="none"><circle cx="11" cy="11" r="7" stroke="currentColor" stroke-width="2"/><path d="m20 20-3.2-3.2" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
</button>
<button class="nav-burger nav-toggle" id="navToggle" aria-label="منو"> <button class="nav-burger nav-toggle" id="navToggle" aria-label="منو">
<svg viewBox="0 0 24 24" fill="none"><path d="M4 7h16M4 12h16M4 17h16" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"/></svg> <svg viewbox="0 0 24 24" fill="none"><path d="M4 7h16M4 12h16M4 17h16" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"/></svg>
</button> </button>
<a href="#download" class="nav-burger" aria-label="دانلود" style="text-decoration:none"> <button class="btn btn-ghost" id="openRegModal" style="font-size:13px;padding:8px 20px">ثبت نام</button>
<svg viewBox="0 0 24 24" fill="none"><path d="M12 3v12m0 0 4-4m-4 4-4-4M5 19h14" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg> <a href="/admin" class="btn btn-blue" style="font-size:13px;padding:8px 20px;text-decoration:none">ورود به پنل</a>
</a>
</div> </div>
</div> </div>
</header> </header>
@@ -49,22 +48,32 @@
<h1 class="reveal">نوبت، پرونده و حساب مطب،<br/>همه یک‌جا</h1> <h1 class="reveal">نوبت، پرونده و حساب مطب،<br/>همه یک‌جا</h1>
<p class="reveal d1">کلینیک پرو کارهای روزمره‌ی مطب را سر و سامان می‌دهد؛ از نوبت‌دهی و پرونده‌ی بیمار تا فاکتور و گزارش مالی. دیگر خبری از دفتر نوبت و کاغذبازی نیست.</p> <p class="reveal d1">کلینیک پرو کارهای روزمره‌ی مطب را سر و سامان می‌دهد؛ از نوبت‌دهی و پرونده‌ی بیمار تا فاکتور و گزارش مالی. دیگر خبری از دفتر نوبت و کاغذبازی نیست.</p>
<div class="hero-actions reveal d2"> <div class="hero-actions reveal d2">
<a href="#download" class="btn btn-coral">دانلود رایگان</a> <button class="btn btn-coral" id="openRegModal2">ثبت نام دکتر / کلینیک</button>
<a href="#contact" class="btn btn-blue">تماس با ما</a> <a href="#contact" class="btn btn-blue">تماس با ما</a>
</div> </div>
</div> </div>
<div class="hero-art reveal d1"> <div class="hero-art reveal d1">
<div class="art-chip chip-1"> <div class="art-chip chip-1">
<span class="ci"><svg viewBox="0 0 24 24" fill="none"><path d="M12 21s-7-4.3-7-9.5A4 4 0 0 1 12 8a4 4 0 0 1 7 3.5C19 16.7 12 21 12 21Z" stroke="currentColor" stroke-width="1.9" stroke-linejoin="round"/></svg></span> <span class="ci">
<div><b class="mono">۹۵٪</b><span>رضایت بیماران</span></div> <svg viewbox="0 0 24 24" fill="none"><path d="M12 21s-7-4.3-7-9.5A4 4 0 0 1 12 8a4 4 0 0 1 7 3.5C19 16.7 12 21 12 21Z" stroke="currentColor" stroke-width="1.9" stroke-linejoin="round"/></svg>
</span>
<div>
<b class="mono">۹۵٪</b>
<span>رضایت بیماران</span>
</div>
</div> </div>
<div class="art-chip chip-2"> <div class="art-chip chip-2">
<span class="ci"><svg viewBox="0 0 24 24" fill="none"><path d="M8 7V5m8 2V5M4 9h16M5 7h14v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V7Z" stroke="currentColor" stroke-width="1.9"/></svg></span> <span class="ci">
<div><b class="mono">۳۸</b><span>نوبت امروز</span></div> <svg viewbox="0 0 24 24" fill="none"><path d="M8 7V5m8 2V5M4 9h16M5 7h14v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V7Z" stroke="currentColor" stroke-width="1.9"/></svg>
</span>
<div>
<b class="mono">۳۸</b>
<span>نوبت امروز</span>
</div>
</div> </div>
<svg viewBox="0 0 600 480" role="img" aria-label="تصویر مدیریت مطب"> <svg viewbox="0 0 600 480" role="img" aria-label="تصویر مدیریت مطب">
<ellipse cx="300" cy="438" rx="250" ry="30" fill="#e2e9fb"/> <ellipse cx="300" cy="438" rx="250" ry="30" fill="#e2e9fb"/>
<circle cx="300" cy="244" r="184" fill="#eaeffb"/> <circle cx="300" cy="244" r="184" fill="#eaeffb"/>
<g fill="#dbe4fb"><ellipse cx="138" cy="150" rx="42" ry="20"/><ellipse cx="476" cy="120" rx="48" ry="22"/><ellipse cx="508" cy="250" rx="30" ry="15"/></g> <g fill="#dbe4fb"><ellipse cx="138" cy="150" rx="42" ry="20"/><ellipse cx="476" cy="120" rx="48" ry="22"/><ellipse cx="508" cy="250" rx="30" ry="15"/></g>
@@ -133,22 +142,30 @@
<div class="fcol reveal"> <div class="fcol reveal">
<h3>پرونده‌ی بیمار</h3> <h3>پرونده‌ی بیمار</h3>
<p>سابقه، نسخه و آزمایش هر بیمار جای خودش است و هر وقت لازم شد، چند ثانیه‌ای پیدایش می‌کنید.</p> <p>سابقه، نسخه و آزمایش هر بیمار جای خودش است و هر وقت لازم شد، چند ثانیه‌ای پیدایش می‌کنید.</p>
<a href="#why" class="readmore">بیشتر بدانید <svg viewBox="0 0 24 24" fill="none"><path d="M14 6l-6 6 6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg></a> <a href="#why" class="readmore">بیشتر بدانید
<svg viewbox="0 0 24 24" fill="none"><path d="M14 6l-6 6 6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</a>
</div> </div>
<div class="fcol reveal d1"> <div class="fcol reveal d1">
<h3>نوبت‌دهی آنلاین</h3> <h3>نوبت‌دهی آنلاین</h3>
<p>بیمار خودش آنلاین نوبت می‌گیرد و پیامک یادآوری برایش می‌رود؛ نوبت‌های فراموش‌شده کمتر می‌شود.</p> <p>بیمار خودش آنلاین نوبت می‌گیرد و پیامک یادآوری برایش می‌رود؛ نوبت‌های فراموش‌شده کمتر می‌شود.</p>
<a href="#why" class="readmore">بیشتر بدانید <svg viewBox="0 0 24 24" fill="none"><path d="M14 6l-6 6 6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg></a> <a href="#why" class="readmore">بیشتر بدانید
<svg viewbox="0 0 24 24" fill="none"><path d="M14 6l-6 6 6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</a>
</div> </div>
<div class="fcol reveal d2"> <div class="fcol reveal d2">
<h3>حساب و کتاب</h3> <h3>حساب و کتاب</h3>
<p>فاکتور صادر کنید، درآمد و خرج را ثبت کنید و آخر ماه دقیق بدانید مطب چه‌قدر کار کرده است.</p> <p>فاکتور صادر کنید، درآمد و خرج را ثبت کنید و آخر ماه دقیق بدانید مطب چه‌قدر کار کرده است.</p>
<a href="#why" class="readmore">بیشتر بدانید <svg viewBox="0 0 24 24" fill="none"><path d="M14 6l-6 6 6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg></a> <a href="#why" class="readmore">بیشتر بدانید
<svg viewbox="0 0 24 24" fill="none"><path d="M14 6l-6 6 6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</a>
</div> </div>
<div class="fcol reveal d3"> <div class="fcol reveal d3">
<h3>+۵۰۰ مطب</h3> <h3>+۵۰۰ مطب</h3>
<p>همین حالا بیش از ۵۰۰ پزشک و کلینیک در شهرهای مختلف هر روز کارشان را با کلینیک پرو پیش می‌برند.</p> <p>همین حالا بیش از ۵۰۰ پزشک و کلینیک در شهرهای مختلف هر روز کارشان را با کلینیک پرو پیش می‌برند.</p>
<a href="#why" class="readmore">بیشتر بدانید <svg viewBox="0 0 24 24" fill="none"><path d="M14 6l-6 6 6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg></a> <a href="#why" class="readmore">بیشتر بدانید
<svg viewbox="0 0 24 24" fill="none"><path d="M14 6l-6 6 6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</a>
</div> </div>
</div> </div>
</section> </section>
@@ -158,22 +175,30 @@
<div class="icons" id="why"> <div class="icons" id="why">
<div class="wrap icon-grid"> <div class="wrap icon-grid">
<div class="icon-cell reveal"> <div class="icon-cell reveal">
<div class="ic-circ"><svg viewBox="0 0 24 24" fill="none"><path d="M4 5h16a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H9l-4 4v-4H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Z" stroke="currentColor" stroke-linejoin="round"/><path d="M8.5 10.5h7M8.5 13h4" stroke="currentColor" stroke-linecap="round"/></svg></div> <div class="ic-circ">
<svg viewbox="0 0 24 24" fill="none"><path d="M4 5h16a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H9l-4 4v-4H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Z" stroke="currentColor" stroke-linejoin="round"/><path d="M8.5 10.5h7M8.5 13h4" stroke="currentColor" stroke-linecap="round"/></svg>
</div>
<h3>راه‌اندازی با شما</h3> <h3>راه‌اندازی با شما</h3>
<p>اول کار تنهای‌تان نمی‌گذاریم؛ تنظیمات اولیه و انتقال اطلاعات را با هم انجام می‌دهیم.</p> <p>اول کار تنهای‌تان نمی‌گذاریم؛ تنظیمات اولیه و انتقال اطلاعات را با هم انجام می‌دهیم.</p>
</div> </div>
<div class="icon-cell reveal d1"> <div class="icon-cell reveal d1">
<div class="ic-circ"><svg viewBox="0 0 24 24" fill="none"><path d="M4 13v-1a8 8 0 0 1 16 0v1" stroke="currentColor" stroke-linecap="round"/><rect x="3" y="13" width="4" height="7" rx="2" stroke="currentColor"/><rect x="17" y="13" width="4" height="7" rx="2" stroke="currentColor"/><path d="M20 19v1a3 3 0 0 1-3 3h-3" stroke="currentColor" stroke-linecap="round"/></svg></div> <div class="ic-circ">
<svg viewbox="0 0 24 24" fill="none"><path d="M4 13v-1a8 8 0 0 1 16 0v1" stroke="currentColor" stroke-linecap="round"/><rect x="3" y="13" width="4" height="7" rx="2" stroke="currentColor"/><rect x="17" y="13" width="4" height="7" rx="2" stroke="currentColor"/><path d="M20 19v1a3 3 0 0 1-3 3h-3" stroke="currentColor" stroke-linecap="round"/></svg>
</div>
<h3>پشتیبانی همیشگی</h3> <h3>پشتیبانی همیشگی</h3>
<p>هر ساعت از شبانه‌روز که جایی گیر کردید، یک تماس یا پیام کافی است تا کنارتان باشیم.</p> <p>هر ساعت از شبانه‌روز که جایی گیر کردید، یک تماس یا پیام کافی است تا کنارتان باشیم.</p>
</div> </div>
<div class="icon-cell reveal d2"> <div class="icon-cell reveal d2">
<div class="ic-circ"><svg viewBox="0 0 24 24" fill="none"><path d="M7 11v9H4a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h3Z" stroke="currentColor" stroke-linejoin="round"/><path d="M7 11l4.5-7a2 2 0 0 1 3.5 1.3V9h4.2a2 2 0 0 1 2 2.4l-1.3 7A2 2 0 0 1 17.9 20H7" stroke="currentColor" stroke-linejoin="round"/></svg></div> <div class="ic-circ">
<svg viewbox="0 0 24 24" fill="none"><path d="M7 11v9H4a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h3Z" stroke="currentColor" stroke-linejoin="round"/><path d="M7 11l4.5-7a2 2 0 0 1 3.5 1.3V9h4.2a2 2 0 0 1 2 2.4l-1.3 7A2 2 0 0 1 17.9 20H7" stroke="currentColor" stroke-linejoin="round"/></svg>
</div>
<h3>متناسب با مطب ایرانی</h3> <h3>متناسب با مطب ایرانی</h3>
<p>امکانات را طوری چیده‌ایم که با روال واقعی کار مطب‌ها در ایران جور دربیاید.</p> <p>امکانات را طوری چیده‌ایم که با روال واقعی کار مطب‌ها در ایران جور دربیاید.</p>
</div> </div>
<div class="icon-cell reveal d3"> <div class="icon-cell reveal d3">
<div class="ic-circ"><svg viewBox="0 0 24 24" fill="none"><path d="M12 3a9 9 0 1 0 9 9h-9V3Z" stroke="currentColor" stroke-linejoin="round"/><path d="M14 3.5a8 8 0 0 1 6.5 6.5H14V3.5Z" stroke="currentColor" stroke-linejoin="round"/></svg></div> <div class="ic-circ">
<svg viewbox="0 0 24 24" fill="none"><path d="M12 3a9 9 0 1 0 9 9h-9V3Z" stroke="currentColor" stroke-linejoin="round"/><path d="M14 3.5a8 8 0 0 1 6.5 6.5H14V3.5Z" stroke="currentColor" stroke-linejoin="round"/></svg>
</div>
<h3>گزارش‌گیری دقیق</h3> <h3>گزارش‌گیری دقیق</h3>
<p>تحلیل عملکرد مطب با نمودارهای روشن، کاربردی و قابل‌فهم.</p> <p>تحلیل عملکرد مطب با نمودارهای روشن، کاربردی و قابل‌فهم.</p>
</div> </div>
@@ -189,7 +214,7 @@
<a href="#download" class="btn btn-coral" style="margin-top:30px">بیشتر بدانید</a> <a href="#download" class="btn btn-coral" style="margin-top:30px">بیشتر بدانید</a>
</div> </div>
<div class="devices-art reveal d1"> <div class="devices-art reveal d1">
<svg viewBox="0 0 520 420" role="img" aria-label="کار روی همه دستگاه‌ها"> <svg viewbox="0 0 520 420" role="img" aria-label="کار روی همه دستگاه‌ها">
<ellipse cx="260" cy="384" rx="220" ry="26" fill="#e2e9fb"/> <ellipse cx="260" cy="384" rx="220" ry="26" fill="#e2e9fb"/>
<circle cx="300" cy="120" r="22" fill="#fff" stroke="#cdd6f4" stroke-width="3"/> <circle cx="300" cy="120" r="22" fill="#fff" stroke="#cdd6f4" stroke-width="3"/>
<path d="M294 120l4 4 8-9" stroke="#5666e0" stroke-width="3" fill="none" stroke-linecap="round" stroke-linejoin="round"/> <path d="M294 120l4 4 8-9" stroke="#5666e0" stroke-width="3" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
@@ -254,46 +279,58 @@
<div class="specs-grid"> <div class="specs-grid">
<div class="spec-card reveal"> <div class="spec-card reveal">
<div class="av"> <div class="av">
<svg viewBox="0 0 116 116"><circle cx="58" cy="58" r="58" fill="#e7ecfb"/><g><path d="M30 116 q0 -34 28 -34 q28 0 28 34z" fill="#fff"/><path d="M44 86 l14 18 14 -18 -6 -8 -8 6 -8 -6z" fill="#eef2fd"/><circle cx="58" cy="58" r="20" fill="#f3c6a5"/><path d="M37 58 q-2 -30 21 -29 q22 0 20 28 q-10 -14 -22 -9 q-13 4 -19 10z" fill="#3a3a7d"/><path d="M50 86 q-10 26 8 36" fill="none" stroke="#5666e0" stroke-width="2.4"/><circle cx="59" cy="120" r="4" fill="#5666e0"/></g></svg> <svg viewbox="0 0 116 116"><circle cx="58" cy="58" r="58" fill="#e7ecfb"/><g><path d="M30 116 q0 -34 28 -34 q28 0 28 34z" fill="#fff"/><path d="M44 86 l14 18 14 -18 -6 -8 -8 6 -8 -6z" fill="#eef2fd"/><circle cx="58" cy="58" r="20" fill="#f3c6a5"/><path d="M37 58 q-2 -30 21 -29 q22 0 20 28 q-10 -14 -22 -9 q-13 4 -19 10z" fill="#3a3a7d"/><path d="M50 86 q-10 26 8 36" fill="none" stroke="#5666e0" stroke-width="2.4"/><circle cx="59" cy="120" r="4" fill="#5666e0"/></g>
</svg>
</div> </div>
<h3>پزشک عمومی</h3> <h3>پزشک عمومی</h3>
<div class="role">GENERAL</div> <div class="role">GENERAL</div>
<ul class="feats"> <ul class="feats">
<li><svg viewBox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>پرونده‌ی بیمار</li> <li>
<li><svg viewBox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>نسخه‌نویسی سریع</li> <svg viewbox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>پرونده‌ی بیمار</li>
<li>
<svg viewbox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>نسخه‌نویسی سریع</li>
</ul> </ul>
</div> </div>
<div class="spec-card reveal d1"> <div class="spec-card reveal d1">
<div class="av"> <div class="av">
<svg viewBox="0 0 116 116"><circle cx="58" cy="58" r="58" fill="#fdeae6"/><g><path d="M30 116 q0 -34 28 -34 q28 0 28 34z" fill="#fff"/><circle cx="58" cy="58" r="20" fill="#f3c6a5"/><path d="M37 56 q-2 -28 21 -28 q23 0 20 30 q-6 -10 -10 -10 l-2 8 -6 -10 q-12 2 -23 10z" fill="#5a3b2e"/><path d="M40 116 q2 -18 18 -18 q16 0 18 18z" fill="#fde3df"/></g></svg> <svg viewbox="0 0 116 116"><circle cx="58" cy="58" r="58" fill="#fdeae6"/><g><path d="M30 116 q0 -34 28 -34 q28 0 28 34z" fill="#fff"/><circle cx="58" cy="58" r="20" fill="#f3c6a5"/><path d="M37 56 q-2 -28 21 -28 q23 0 20 30 q-6 -10 -10 -10 l-2 8 -6 -10 q-12 2 -23 10z" fill="#5a3b2e"/><path d="M40 116 q2 -18 18 -18 q16 0 18 18z" fill="#fde3df"/></g>
</svg>
</div> </div>
<h3>دندان‌پزشک</h3> <h3>دندان‌پزشک</h3>
<div class="role">DENTAL</div> <div class="role">DENTAL</div>
<ul class="feats"> <ul class="feats">
<li><svg viewBox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>نقشه‌ی دندان</li> <li>
<li><svg viewBox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>طرح درمان</li> <svg viewbox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>نقشه‌ی دندان</li>
<li>
<svg viewbox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>طرح درمان</li>
</ul> </ul>
</div> </div>
<div class="spec-card reveal d2"> <div class="spec-card reveal d2">
<div class="av"> <div class="av">
<svg viewBox="0 0 116 116"><circle cx="58" cy="58" r="58" fill="#e7ecfb"/><g><path d="M30 116 q0 -34 28 -34 q28 0 28 34z" fill="#fff"/><circle cx="58" cy="58" r="20" fill="#f3c6a5"/><path d="M36 60 q-2 -32 22 -31 q24 1 22 31 q-6 -8 -10 -8 q-2 -10 -12 -8 q-14 2 -22 16z" fill="#1f2452"/><path d="M40 116 q2 -18 18 -18 q16 0 18 18z" fill="#e7ecfb"/></g></svg> <svg viewbox="0 0 116 116"><circle cx="58" cy="58" r="58" fill="#e7ecfb"/><g><path d="M30 116 q0 -34 28 -34 q28 0 28 34z" fill="#fff"/><circle cx="58" cy="58" r="20" fill="#f3c6a5"/><path d="M36 60 q-2 -32 22 -31 q24 1 22 31 q-6 -8 -10 -8 q-2 -10 -12 -8 q-14 2 -22 16z" fill="#1f2452"/><path d="M40 116 q2 -18 18 -18 q16 0 18 18z" fill="#e7ecfb"/></g>
</svg>
</div> </div>
<h3>متخصص پوست</h3> <h3>متخصص پوست</h3>
<div class="role">DERMATOLOGY</div> <div class="role">DERMATOLOGY</div>
<ul class="feats"> <ul class="feats">
<li><svg viewBox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>گالری تصاویر</li> <li>
<li><svg viewBox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>پیگیری درمان</li> <svg viewbox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>گالری تصاویر</li>
<li>
<svg viewbox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>پیگیری درمان</li>
</ul> </ul>
</div> </div>
<div class="spec-card reveal d3"> <div class="spec-card reveal d3">
<div class="av"> <div class="av">
<svg viewBox="0 0 116 116"><circle cx="58" cy="58" r="58" fill="#fdeae6"/><g><path d="M30 116 q0 -34 28 -34 q28 0 28 34z" fill="#fff"/><circle cx="58" cy="58" r="20" fill="#f3c6a5"/><path d="M36 58 q-2 -30 22 -29 q24 1 21 29 q-10 -12 -21 -8 q-13 4 -22 8z" fill="#7a4a2e"/><path d="M48 84 q-8 24 10 34" fill="none" stroke="#f17a6b" stroke-width="2.4"/><circle cx="59" cy="119" r="4" fill="#f17a6b"/></g></svg> <svg viewbox="0 0 116 116"><circle cx="58" cy="58" r="58" fill="#fdeae6"/><g><path d="M30 116 q0 -34 28 -34 q28 0 28 34z" fill="#fff"/><circle cx="58" cy="58" r="20" fill="#f3c6a5"/><path d="M36 58 q-2 -30 22 -29 q24 1 21 29 q-10 -12 -21 -8 q-13 4 -22 8z" fill="#7a4a2e"/><path d="M48 84 q-8 24 10 34" fill="none" stroke="#f17a6b" stroke-width="2.4"/><circle cx="59" cy="119" r="4" fill="#f17a6b"/></g>
</svg>
</div> </div>
<h3>متخصص اطفال</h3> <h3>متخصص اطفال</h3>
<div class="role">PEDIATRICS</div> <div class="role">PEDIATRICS</div>
<ul class="feats"> <ul class="feats">
<li><svg viewBox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>نمودار رشد</li> <li>
<li><svg viewBox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>یادآور واکسن</li> <svg viewbox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>نمودار رشد</li>
<li>
<svg viewbox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>یادآور واکسن</li>
</ul> </ul>
</div> </div>
</div> </div>
@@ -304,7 +341,7 @@
<section class="appcta" id="download"> <section class="appcta" id="download">
<div class="wrap appcta-grid"> <div class="wrap appcta-grid">
<div class="appcta-art reveal"> <div class="appcta-art reveal">
<svg viewBox="0 0 440 360" role="img" aria-label="نرم‌افزار دسکتاپ کلینیک پرو برای مک و ویندوز"> <svg viewbox="0 0 440 360" role="img" aria-label="نرم‌افزار دسکتاپ کلینیک پرو برای مک و ویندوز">
<ellipse cx="220" cy="322" rx="180" ry="24" fill="#e2e9fb"/> <ellipse cx="220" cy="322" rx="180" ry="24" fill="#e2e9fb"/>
<circle cx="220" cy="158" r="150" fill="#eef2fd"/> <circle cx="220" cy="158" r="150" fill="#eef2fd"/>
@@ -379,23 +416,230 @@
<h2 class="reveal d1">روی کامپیوتر مطب،<br/>سریع و بی‌دردسر</h2> <h2 class="reveal d1">روی کامپیوتر مطب،<br/>سریع و بی‌دردسر</h2>
<p class="reveal d2">نسخه‌ی دسکتاپ کلینیک پرو را برای مک یا ویندوز نصب کنید؛ نوبت‌ها، پرونده‌ها و حساب مطب همه روی سیستم خودتان و در دسترس‌اند.</p> <p class="reveal d2">نسخه‌ی دسکتاپ کلینیک پرو را برای مک یا ویندوز نصب کنید؛ نوبت‌ها، پرونده‌ها و حساب مطب همه روی سیستم خودتان و در دسترس‌اند.</p>
<div class="dl-trust reveal d2"> <div class="dl-trust reveal d2">
<span><svg viewBox="0 0 24 24" fill="none"><path d="M12 3 4 6v5c0 5 3.5 8.5 8 10 4.5-1.5 8-5 8-10V6l-8-3Z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/><path d="m9 12 2 2 4-4" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/></svg>کاملاً ایمن</span> <span>
<span><svg viewBox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>نصب آسان</span> <svg viewbox="0 0 24 24" fill="none"><path d="M12 3 4 6v5c0 5 3.5 8.5 8 10 4.5-1.5 8-5 8-10V6l-8-3Z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/><path d="m9 12 2 2 4-4" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/></svg>کاملاً ایمن</span>
<span><svg viewBox="0 0 24 24" fill="none"><path d="M4 17V9m5 8V5m5 12v-6m5 6V8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>آپدیت رایگان</span> <span>
<svg viewbox="0 0 24 24" fill="none"><path d="m5 13 4 4L19 7" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>نصب آسان</span>
<span>
<svg viewbox="0 0 24 24" fill="none"><path d="M4 17V9m5 8V5m5 12v-6m5 6V8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>آپدیت رایگان</span>
</div> </div>
<div class="store-badges reveal d3"> <div class="store-badges reveal d3">
<a class="store-badge" href="#"> <a class="store-badge" href="#">
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M16.4 12.6c0-2.3 1.9-3.4 2-3.5-1.1-1.6-2.8-1.8-3.4-1.8-1.4-.1-2.8.9-3.5.9-.7 0-1.8-.8-3-.8-1.5 0-3 .9-3.7 2.3-1.6 2.8-.4 6.9 1.1 9.2.8 1.1 1.6 2.3 2.8 2.3 1.1 0 1.6-.7 2.9-.7 1.4 0 1.7.7 2.9.7 1.2 0 2-1.1 2.7-2.2.9-1.2 1.2-2.5 1.2-2.5s-2.3-.9-2.3-3.6ZM14.2 5.7c.6-.8 1-1.8.9-2.9-.9 0-2 .6-2.6 1.4-.6.7-1.1 1.7-.9 2.7 1 .1 2-.5 2.6-1.2Z"/></svg> <svg viewbox="0 0 24 24" fill="currentColor"><path d="M16.4 12.6c0-2.3 1.9-3.4 2-3.5-1.1-1.6-2.8-1.8-3.4-1.8-1.4-.1-2.8.9-3.5.9-.7 0-1.8-.8-3-.8-1.5 0-3 .9-3.7 2.3-1.6 2.8-.4 6.9 1.1 9.2.8 1.1 1.6 2.3 2.8 2.3 1.1 0 1.6-.7 2.9-.7 1.4 0 1.7.7 2.9.7 1.2 0 2-1.1 2.7-2.2.9-1.2 1.2-2.5 1.2-2.5s-2.3-.9-2.3-3.6ZM14.2 5.7c.6-.8 1-1.8.9-2.9-.9 0-2 .6-2.6 1.4-.6.7-1.1 1.7-.9 2.7 1 .1 2-.5 2.6-1.2Z"/></svg>
<span class="sb-t"><small>دانلود برای</small><b>مک · macOS</b></span> <span class="sb-t">
<small>دانلود برای</small>
<b>مک · macOS</b>
</span>
</a> </a>
<a class="store-badge" href="#"> <a class="store-badge" href="#">
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M3 5.5 10.5 4.4v7.1H3V5.5Zm0 13L10.5 19.6v-7H3v6Zm8.5 1.3L21 21V12.5h-9.5v7.3Zm0-15.6V11.5H21V3l-9.5 1.2Z"/></svg> <svg viewbox="0 0 24 24" fill="currentColor"><path d="M3 5.5 10.5 4.4v7.1H3V5.5Zm0 13L10.5 19.6v-7H3v6Zm8.5 1.3L21 21V12.5h-9.5v7.3Zm0-15.6V11.5H21V3l-9.5 1.2Z"/></svg>
<span class="sb-t"><small>دانلود برای</small><b>ویندوز</b></span> <span class="sb-t">
<small>دانلود برای</small>
<b>ویندوز</b>
</span>
</a> </a>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
<!-- ===================== Pre-Registration Modal ===================== -->
<div id="regOverlay" style="display:none;position:fixed;inset:0;background:oklch(0.2 0.05 285 / 0.55);z-index:900;backdrop-filter:blur(4px);overflow-y:auto;padding:24px 16px" onclick="if(event.target===this)closeRegModal()">
<div style="background:#fff;border-radius:20px;max-width:520px;margin:auto;padding:32px 28px;position:relative;box-shadow:0 24px 60px oklch(0.3 0.1 285 / 0.22)">
<button onclick="closeRegModal()" aria-label="بستن" style="position:absolute;top:16px;left:20px;background:none;border:none;cursor:pointer;font-size:22px;color:var(--text-2);line-height:1">×</button>
<h2 style="margin:0 0 6px;font-size:20px;font-weight:800;color:var(--ink)">ثبت نام در کلینیک پرو</h2>
<p style="margin:0 0 24px;font-size:13px;color:var(--text-2)">نوع حساب خود را انتخاب کنید</p>
<!-- Type Cards -->
<div id="typeCards" style="display:flex;flex-direction:column;gap:10px;margin-bottom:22px">
<label class="reg-card" data-type="independent_doctor" style="display:flex;align-items:center;gap:14px;padding:14px 16px;border:2px solid var(--border);border-radius:14px;cursor:pointer;transition:all .2s">
<input type="radio" name="regType" value="independent_doctor" style="display:none">
<span style="font-size:26px;flex-shrink:0">🩺</span>
<div>
<div style="font-weight:700;font-size:14px;color:var(--ink)">دکتر هستم</div>
<div style="font-size:12px;color:var(--text-2);margin-top:2px">مطب شخصی دارم، به تنهایی کار می‌کنم</div>
</div>
</label>
<label class="reg-card" data-type="doctor_with_clinic" style="display:flex;align-items:center;gap:14px;padding:14px 16px;border:2px solid var(--border);border-radius:14px;cursor:pointer;transition:all .2s">
<input type="radio" name="regType" value="doctor_with_clinic" style="display:none">
<span style="font-size:26px;flex-shrink:0">🏥</span>
<div>
<div style="font-weight:700;font-size:14px;color:var(--ink)">دکتر هستم و کلینیک دارم</div>
<div style="font-size:12px;color:var(--text-2);margin-top:2px">با چند دکتر در یک کلینیک همکاری می‌کنم</div>
</div>
</label>
<label class="reg-card" data-type="clinic_manager" style="display:flex;align-items:center;gap:14px;padding:14px 16px;border:2px solid var(--border);border-radius:14px;cursor:pointer;transition:all .2s">
<input type="radio" name="regType" value="clinic_manager" style="display:none">
<span style="font-size:26px;flex-shrink:0">🏢</span>
<div>
<div style="font-weight:700;font-size:14px;color:var(--ink)">مدیر کلینیک هستم</div>
<div style="font-size:12px;color:var(--text-2);margin-top:2px">مدیریت کلینیک را دارم، خودم دکتر نیستم</div>
</div>
</label>
</div>
<!-- Form Fields -->
<div id="regFields" style="display:flex;flex-direction:column;gap:14px">
<div>
<label style="display:block;font-size:13px;font-weight:600;margin-bottom:5px;color:var(--ink)">نام کامل
<span style="color:var(--coral)">*</span>
</label>
<input id="regName" type="text" placeholder="مثال: دکتر علی احمدی" style="width:100%;border:1.5px solid var(--border);border-radius:10px;padding:10px 14px;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;color:var(--ink)"/>
</div>
<div>
<label style="display:block;font-size:13px;font-weight:600;margin-bottom:5px;color:var(--ink)">شماره موبایل
<span style="color:var(--coral)">*</span>
</label>
<input id="regMobile" type="tel" placeholder="09xxxxxxxxx" dir="ltr" style="width:100%;border:1.5px solid var(--border);border-radius:10px;padding:10px 14px;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;color:var(--ink);text-align:right"/>
</div>
<div>
<label style="display:block;font-size:13px;font-weight:600;margin-bottom:5px;color:var(--ink)">توضیحات
<span style="font-weight:400;color:var(--text-2)">(اختیاری)</span>
</label>
<textarea id="regInfo" rows="3" placeholder="تخصص، آدرس، سابقه کاری، ..." style="width:100%;border:1.5px solid var(--border);border-radius:10px;padding:10px 14px;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;resize:vertical;color:var(--ink)"></textarea>
</div>
</div>
<!-- Error / Success -->
<div id="regMsg" style="display:none;margin-top:14px;padding:12px 16px;border-radius:10px;font-size:13px"></div>
<button id="regSubmitBtn" disabled onclick="submitReg()" style="margin-top:20px;width:100%;background:var(--blue);color:#fff;border:none;border-radius:12px;padding:13px;font-size:15px;font-weight:700;cursor:pointer;font-family:inherit;opacity:.45;transition:opacity .2s">
ارسال درخواست
</button>
<p style="text-align:center;font-size:12px;color:var(--text-2);margin:12px 0 0">پس از بررسی، اطلاعات ورود از طریق SMS ارسال می‌شود</p>
</div>
</div>
<style>
.reg-card:hover {
border-color: var(--blue) !important;
background: oklch(0.97 0.02 277);
}
.reg-card.selected {
border-color: var(--blue) !important;
background: oklch(0.96 0.03 277);
}
.reg-card.selected div > div:first-child {
color: var(--blue);
}
#regName:focus,
#regMobile:focus,
#regInfo:focus {
border-color: var(--blue);
box-shadow: 0 0 0 3px oklch(0.58 0.185 277 / 0.12);
}
</style>
<script>
(function () {
var overlay = document.getElementById('regOverlay');
var submitBtn = document.getElementById('regSubmitBtn');
var selectedType = null;
function openRegModal() {
overlay.style.display = 'block';
document.body.style.overflow = 'hidden';
}
window.closeRegModal = function () {
overlay.style.display = 'none';
document.body.style.overflow = '';
};
var btn1 = document.getElementById('openRegModal');
var btn2 = document.getElementById('openRegModal2');
if (btn1)
btn1.addEventListener('click', openRegModal);
if (btn2)
btn2.addEventListener('click', openRegModal);
document.querySelectorAll('.reg-card').forEach(function (card) {
card.addEventListener('click', function () {
document.querySelectorAll('.reg-card').forEach(function (c) {
c.classList.remove('selected');
});
card.classList.add('selected');
var radio = card.querySelector('input[type=radio]');
if (radio)
radio.checked = true;
selectedType = card.dataset.type;
submitBtn.disabled = false;
submitBtn.style.opacity = '1';
});
});
window.submitReg = function () {
var name = document.getElementById('regName').value.trim();
var mobile = document.getElementById('regMobile').value.trim();
var info = document.getElementById('regInfo').value.trim();
var msg = document.getElementById('regMsg');
if (! selectedType)
return;
if (! name) {
showMsg('نام را وارد کنید', 'error');
return;
}
if (! mobile || mobile.length < 10) {
showMsg('شماره موبایل معتبر نیست', 'error');
return;
}
submitBtn.disabled = true;
submitBtn.textContent = 'در حال ارسال...';
fetch('/api/v1/pre-registration', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(
{
type: selectedType,
name: name,
mobile: mobile,
info: info || null
}
)
}).then(function (r) {
return r.json();
}).then(function (data) {
if (data.success) {
showMsg('درخواست شما ثبت شد. پس از بررسی، اطلاعات ورود از طریق SMS ارسال می‌شود.', 'success');
submitBtn.textContent = 'ارسال شد ✓';
setTimeout(function() { closeRegModal(); }, 2200);
} else {
var errMsg = (data.errors && data.errors[0]) ? data.errors[0].message : 'خطایی رخ داد';
showMsg(errMsg, 'error');
submitBtn.disabled = false;
submitBtn.style.opacity = '1';
submitBtn.textContent = 'ارسال درخواست';
}
}).catch(function () {
showMsg('خطا در اتصال به سرور', 'error');
submitBtn.disabled = false;
submitBtn.style.opacity = '1';
submitBtn.textContent = 'ارسال درخواست';
});
};
function showMsg(text, type) {
var msg = document.getElementById('regMsg');
msg.textContent = text;
msg.style.display = 'block';
msg.style.background = type === 'success' ? '#dcfce7' : '#fef2f2';
msg.style.color = type === 'success' ? '#16a34a' : '#ef4444';
msg.style.border = type === 'success' ? '1px solid #bbf7d0' : '1px solid #fecaca';
}
})();
</script>
</main> </main>
<!-- ===================== Footer ===================== --> <!-- ===================== Footer ===================== -->
@@ -403,12 +647,21 @@
<div class="wrap"> <div class="wrap">
<div class="footer-grid"> <div class="footer-grid">
<div class="footer-col footer-brand"> <div class="footer-col footer-brand">
<a class="brand" href="#hero"><b>کلینیک پرو</b><span class="dot"></span></a> <a class="brand" href="#hero">
<b>کلینیک پرو</b>
<span class="dot"></span>
</a>
<p>کلینیک پرو را ساختیم تا پزشک‌ها به‌جای درگیری با دفتر و کاغذ، حواس‌شان به کار اصلی‌شان باشد: بیمار.</p> <p>کلینیک پرو را ساختیم تا پزشک‌ها به‌جای درگیری با دفتر و کاغذ، حواس‌شان به کار اصلی‌شان باشد: بیمار.</p>
<div class="foot-socials"> <div class="foot-socials">
<a href="#" aria-label="اینستاگرام"><svg viewBox="0 0 24 24" fill="none"><rect x="3" y="3" width="18" height="18" rx="5" stroke="currentColor" stroke-width="1.8"/><circle cx="12" cy="12" r="4" stroke="currentColor" stroke-width="1.8"/><circle cx="17.4" cy="6.6" r="1.2" fill="currentColor"/></svg></a> <a href="#" aria-label="اینستاگرام">
<a href="#" aria-label="تلگرام"><svg viewBox="0 0 24 24" fill="none"><path d="M21 4 3 11l5 2 2 6 3-4 5 4 3-15Z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg></a> <svg viewbox="0 0 24 24" fill="none"><rect x="3" y="3" width="18" height="18" rx="5" stroke="currentColor" stroke-width="1.8"/><circle cx="12" cy="12" r="4" stroke="currentColor" stroke-width="1.8"/><circle cx="17.4" cy="6.6" r="1.2" fill="currentColor"/></svg>
<a href="#" aria-label="واتساپ"><svg viewBox="0 0 24 24" fill="none"><path d="M4 20l1.4-4A8 8 0 1 1 9 18.6L4 20Z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg></a> </a>
<a href="#" aria-label="تلگرام">
<svg viewbox="0 0 24 24" fill="none"><path d="M21 4 3 11l5 2 2 6 3-4 5 4 3-15Z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg>
</a>
<a href="#" aria-label="واتساپ">
<svg viewbox="0 0 24 24" fill="none"><path d="M4 20l1.4-4A8 8 0 1 1 9 18.6L4 20Z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg>
</a>
</div> </div>
</div> </div>
@@ -425,9 +678,18 @@
<div class="footer-col"> <div class="footer-col">
<h4>اطلاعات تماس</h4> <h4>اطلاعات تماس</h4>
<div class="foot-contact"> <div class="foot-contact">
<div class="fl"><svg viewBox="0 0 24 24" fill="none"><path d="M12 21s-7-5.2-7-11a7 7 0 0 1 14 0c0 5.8-7 11-7 11Z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/><circle cx="12" cy="10" r="2.6" stroke="currentColor" stroke-width="1.7"/></svg><span>یاسوج، مهریان، خیابان شهید ستاره شیرازی، خیابان امام‌زاده احمد، پلاک ۸</span></div> <div class="fl">
<div class="fl"><svg viewBox="0 0 24 24" fill="none"><path d="M4 6.5C4 5 5 4 6.5 4h2c.6 0 1.1.4 1.3 1l1 3c.2.6 0 1.2-.5 1.6L9 11c1 2 2.5 3.5 4.5 4.5l1.4-1.3c.4-.4 1-.6 1.6-.4l3 1c.6.2 1 .7 1 1.3v2c0 1.5-1 2.5-2.5 2.4C10.5 20 4 13.5 4 6.5Z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg><a href="tel:07491012178" class="mono" dir="ltr">۰۷۴۹۱۰۱۲۱۷۸</a></div> <svg viewbox="0 0 24 24" fill="none"><path d="M12 21s-7-5.2-7-11a7 7 0 0 1 14 0c0 5.8-7 11-7 11Z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/><circle cx="12" cy="10" r="2.6" stroke="currentColor" stroke-width="1.7"/></svg>
<div class="fl"><svg viewBox="0 0 24 24" fill="none"><rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor" stroke-width="1.7"/><path d="m4 7 8 5 8-5" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg><a href="mailto:info@clinic-pro.ir" class="mono" dir="ltr">info@clinic-pro.ir</a></div> <span>یاسوج، مهریان، خیابان شهید ستاره شیرازی، خیابان امام‌زاده احمد، پلاک ۸</span>
</div>
<div class="fl">
<svg viewbox="0 0 24 24" fill="none"><path d="M4 6.5C4 5 5 4 6.5 4h2c.6 0 1.1.4 1.3 1l1 3c.2.6 0 1.2-.5 1.6L9 11c1 2 2.5 3.5 4.5 4.5l1.4-1.3c.4-.4 1-.6 1.6-.4l3 1c.6.2 1 .7 1 1.3v2c0 1.5-1 2.5-2.5 2.4C10.5 20 4 13.5 4 6.5Z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg>
<a href="tel:07491012178" class="mono" dir="ltr">۰۷۴۹۱۰۱۲۱۷۸</a>
</div>
<div class="fl">
<svg viewbox="0 0 24 24" fill="none"><rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor" stroke-width="1.7"/><path d="m4 7 8 5 8-5" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg>
<a href="mailto:info@clinic-pro.ir" class="mono" dir="ltr">info@clinic-pro.ir</a>
</div>
</div> </div>
</div> </div>
@@ -435,12 +697,18 @@
<h4>دانلود نرم‌افزار</h4> <h4>دانلود نرم‌افزار</h4>
<div class="foot-badges"> <div class="foot-badges">
<a class="store-badge" href="#" style="background:oklch(1 0 0 / 0.08)"> <a class="store-badge" href="#" style="background:oklch(1 0 0 / 0.08)">
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M16.4 12.6c0-2.3 1.9-3.4 2-3.5-1.1-1.6-2.8-1.8-3.4-1.8-1.4-.1-2.8.9-3.5.9-.7 0-1.8-.8-3-.8-1.5 0-3 .9-3.7 2.3-1.6 2.8-.4 6.9 1.1 9.2.8 1.1 1.6 2.3 2.8 2.3 1.1 0 1.6-.7 2.9-.7 1.4 0 1.7.7 2.9.7 1.2 0 2-1.1 2.7-2.2.9-1.2 1.2-2.5 1.2-2.5s-2.3-.9-2.3-3.6ZM14.2 5.7c.6-.8 1-1.8.9-2.9-.9 0-2 .6-2.6 1.4-.6.7-1.1 1.7-.9 2.7 1 .1 2-.5 2.6-1.2Z"/></svg> <svg viewbox="0 0 24 24" fill="currentColor"><path d="M16.4 12.6c0-2.3 1.9-3.4 2-3.5-1.1-1.6-2.8-1.8-3.4-1.8-1.4-.1-2.8.9-3.5.9-.7 0-1.8-.8-3-.8-1.5 0-3 .9-3.7 2.3-1.6 2.8-.4 6.9 1.1 9.2.8 1.1 1.6 2.3 2.8 2.3 1.1 0 1.6-.7 2.9-.7 1.4 0 1.7.7 2.9.7 1.2 0 2-1.1 2.7-2.2.9-1.2 1.2-2.5 1.2-2.5s-2.3-.9-2.3-3.6ZM14.2 5.7c.6-.8 1-1.8.9-2.9-.9 0-2 .6-2.6 1.4-.6.7-1.1 1.7-.9 2.7 1 .1 2-.5 2.6-1.2Z"/></svg>
<span class="sb-t"><small>دانلود برای</small><b>مک · macOS</b></span> <span class="sb-t">
<small>دانلود برای</small>
<b>مک · macOS</b>
</span>
</a> </a>
<a class="store-badge" href="#" style="background:oklch(1 0 0 / 0.08)"> <a class="store-badge" href="#" style="background:oklch(1 0 0 / 0.08)">
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M3 5.5 10.5 4.4v7.1H3V5.5Zm0 13L10.5 19.6v-7H3v6Zm8.5 1.3L21 21V12.5h-9.5v7.3Zm0-15.6V11.5H21V3l-9.5 1.2Z"/></svg> <svg viewbox="0 0 24 24" fill="currentColor"><path d="M3 5.5 10.5 4.4v7.1H3V5.5Zm0 13L10.5 19.6v-7H3v6Zm8.5 1.3L21 21V12.5h-9.5v7.3Zm0-15.6V11.5H21V3l-9.5 1.2Z"/></svg>
<span class="sb-t"><small>دانلود برای</small><b>ویندوز</b></span> <span class="sb-t">
<small>دانلود برای</small>
<b>ویندوز</b>
</span>
</a> </a>
</div> </div>
</div> </div>
@@ -452,54 +720,130 @@
<script> <script>
(function () { (function () {
'use strict'; 'use strict';
var FA = ['۰','۱','۲','۳','۴','۵','۶','۷','۸','۹']; var FA = [
function groupFa(n){ return String(n).replace(/\B(?=(\d{3})+(?!\d))/g,'،').replace(/\d/g,function(d){return FA[+d];}); } '۰',
'۱',
'۲',
'۳',
'۴',
'۵',
'۶',
'۷',
'۸',
'۹'
];
function groupFa(n) {
return String(n).replace(/\B(?=(\d{3})+(?!\d))/g, '،').replace(/\d/g, function (d) {
return FA[+ d];
});
}
var header = document.getElementById('header'); var header = document.getElementById('header');
function onScroll(){ header.classList.toggle('scrolled', window.scrollY > 12); } function onScroll() {
header.classList.toggle('scrolled', window.scrollY > 12);
}
window.addEventListener('scroll', onScroll, {passive: true}); window.addEventListener('scroll', onScroll, {passive: true});
onScroll(); onScroll();
var navToggle = document.getElementById('navToggle'); var navToggle = document.getElementById('navToggle');
var navLinks = document.getElementById('navLinks'); var navLinks = document.getElementById('navLinks');
if (navToggle) navToggle.addEventListener('click', function(){ if (navToggle)
navToggle.addEventListener('click', function () {
var open = navLinks.style.display === 'flex'; var open = navLinks.style.display === 'flex';
navLinks.style.display = open ? '' : 'flex'; navLinks.style.display = open ? '' : 'flex';
if (! open) { if (! open) {
navLinks.style.position='absolute'; navLinks.style.top='84px'; navLinks.style.insetInline='0'; navLinks.style.position = 'absolute';
navLinks.style.flexDirection='column'; navLinks.style.background='#fff'; navLinks.style.top = '84px';
navLinks.style.padding='20px 32px'; navLinks.style.gap='18px'; navLinks.style.insetInline = '0';
navLinks.style.flexDirection = 'column';
navLinks.style.background = '#fff';
navLinks.style.padding = '20px 32px';
navLinks.style.gap = '18px';
navLinks.style.boxShadow = '0 16px 30px oklch(0.4 0.08 285 / 0.1)'; navLinks.style.boxShadow = '0 16px 30px oklch(0.4 0.08 285 / 0.1)';
} }
}); });
var sections = ['hero','features','why','download','contact'];
var sections = [
'hero',
'features',
'why',
'download',
'contact'
];
var links = Array.prototype.slice.call(document.querySelectorAll('.nav-links a')); var links = Array.prototype.slice.call(document.querySelectorAll('.nav-links a'));
function syncActive() { function syncActive() {
var y = window.scrollY + 120, cur = 'hero'; var y = window.scrollY + 120,
sections.forEach(function(id){ var el=document.getElementById(id); if(el && el.offsetTop<=y) cur=id; }); cur = 'hero';
links.forEach(function(a){ a.classList.toggle('active', a.getAttribute('href')==='#'+cur); }); sections.forEach(function (id) {
var el = document.getElementById(id);
if (el && el.offsetTop <= y)
cur = id;
});
links.forEach(function (a) {
a.classList.toggle('active', a.getAttribute('href') === '#' + cur);
});
} }
window.addEventListener('scroll', syncActive, {passive: true}); window.addEventListener('scroll', syncActive, {passive: true});
syncActive(); syncActive();
var reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches; var reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var reveals = Array.prototype.slice.call(document.querySelectorAll('.reveal')); var reveals = Array.prototype.slice.call(document.querySelectorAll('.reveal'));
function inView(el){ var r=el.getBoundingClientRect(); return r.top < (window.innerHeight||document.documentElement.clientHeight)-30 && r.bottom > 0; } function inView(el) {
function reveal(el){ el.classList.add('in'); } var r = el.getBoundingClientRect();
return r.top<(window.innerHeight||document.documentElement.clientHeight)-30 && r.bottom> 0;
}
function reveal(el) {
el.classList.add('in');
}
if (reduce) { reveals.forEach(reveal); } if (reduce) {
else { reveals.forEach(reveal);
reveals.forEach(function(el){ if(inView(el)) reveal(el); }); } else {
reveals.forEach(function (el) {
if (inView(el))
reveal(el);
});
if ('IntersectionObserver' in window) { if ('IntersectionObserver' in window) {
var io = new IntersectionObserver(function(es){ es.forEach(function(e){ if(e.isIntersecting){ reveal(e.target); io.unobserve(e.target);} }); }, { threshold: 0.12, rootMargin: '0px 0px -40px 0px' }); var io = new IntersectionObserver(function (es) {
reveals.forEach(function(el){ if(!el.classList.contains('in')) io.observe(el); }); es.forEach(function (e) {
if (e.isIntersecting) {
reveal(e.target);
io.unobserve(e.target);
}
});
}, {
threshold: 0.12,
rootMargin: '0px 0px -40px 0px'
});
reveals.forEach(function (el) {
if (! el.classList.contains('in'))
io.observe(el);
});
} }
var ticking = false; var ticking = false;
function sweep(){ if(ticking) return; ticking=true; requestAnimationFrame(function(){ reveals.forEach(function(el){ if(inView(el)) reveal(el); }); ticking=false; }); } function sweep() {
if (ticking)
return;
ticking = true;
requestAnimationFrame(function () {
reveals.forEach(function (el) {
if (inView(el))
reveal(el);
});
ticking = false;
});
}
window.addEventListener('scroll', sweep, {passive: true}); window.addEventListener('scroll', sweep, {passive: true});
window.addEventListener('resize', sweep, {passive: true}); window.addEventListener('resize', sweep, {passive: true});
setTimeout(function(){ reveals.forEach(reveal); }, 2800); setTimeout(function () {
reveals.forEach(reveal);
}, 2800);
} }
})(); })();
</script> </script>