This commit is contained in:
MeysamMoghaddam
2025-10-07 00:39:38 +03:30
parent 8c03d00a4b
commit b26225d8a6
15 changed files with 646 additions and 179 deletions

View File

@@ -3,140 +3,229 @@
<PageTitle>صفحه اصلی</PageTitle>
<!-- Hero -->
<section id="hero" class="hero-section">
<MudContainer MaxWidth="MaxWidth.Large" Class="py-16">
<MudGrid Justify="Justify.Center" AlignItems="AlignItems.Center" Spacing="3">
<MudItem xs="12" md="6">
<!-- HERO -->
<section id="hero" class="hero-section">
<MudContainer MaxWidth="MaxWidth.Large" Class="py-16">
<MudGrid Justify="Justify.Center" AlignItems="AlignItems.Center" Spacing="3">
<MudItem xs="12" md="6">
<MudChip T="string" Color="Color.Primary" Variant="Variant.Filled" Class="mb-3">جدید</MudChip>
<MudText Typo="Typo.h2" Class="fw-700 lh-tight mb-2">
ساخت شبکه‌های هوشمند با فورسات
</MudText>
<MudText Typo="Typo.subtitle1" Class="muted mb-6">
پلن‌های باینری، شجره‌نامه و گزارش کارمزد ماهانه — همه در یک اپ بلazor.
</MudText>
<MudText Typo="Typo.h3" Class="fw-700 lh-tight mb-1 hero-title">
ساخت شبکه‌های هوشمند با فرصت
</MudText>
<MudText Typo="Typo.subtitle1" Class="muted mb-6">
پلن باینری، شجره‌نامه و گزارش‌های کارمزدی شفاف — همه در یک پنل بلِیزر.
</MudText>
<MudStack Row="true" Spacing="2" Class="mb-2">
<MudTextField @bind-Value="_email" For="@(() => _email)" Placeholder="ایمیل کاری شما" Variant="Variant.Outlined" Class="max-w-56" />
<MudButton Color="Color.Primary" OnClick="@JoinWaitlist">عضویت در لیست انتظار</MudButton>
<MudStack Row="true" Spacing="2" Class="mb-2">
<MudButton Color="Color.Primary" OnClick="@(() => Navigation.NavigateTo("#pricing"))">مشاهده قیمت‌ها</MudButton>
<MudButton Variant="Variant.Outlined" Color="Color.Inherit" OnClick="@(() => Navigation.NavigateTo("#features"))">معرفی پکیج‌ها</MudButton>
</MudStack>
</MudItem>
<MudItem xs="12" md="6">
<MudPaper Elevation="8" Class="pa-0 rounded-2xl hero-media">
<MudImage Src="https://images.unsplash.com/photo-1517245386807-bb43f82c33c4?q=80&w=1200&auto=format&fit=crop"
Alt="جلسه تیم فروش و شبکه‌سازی"
ObjectFit="ObjectFit.Cover"
ObjectPosition="ObjectPosition.Center"
Style="width:100%"
Class="rounded-2xl" />
<div class="hero-overlay"></div>
<div class="hero-badge px-2 pb-2">
<MudText Typo="Typo.subtitle2">نمای لحظه‌ای</MudText>
<MudText Typo="Typo.caption" Class="muted">۱۲۸۴ عضو فعال · $۴۸,۹۷۰‎ پرداختی ماه گذشته</MudText>
</div>
</MudPaper>
</MudItem>
</MudGrid>
</MudContainer>
</section>
<!-- STATS -->
<section class="stats-strip">
<MudContainer MaxWidth="MaxWidth.Large" Class="py-8">
<MudGrid Spacing="2" Justify="Justify.SpaceAround">
<MudItem xs="6" md="3">
<MudPaper Outlined="true" Class="pa-4 rounded-lg">
<MudText Typo="Typo.h4" Align="Align.Center" Class="fw-700">+۵۰٪</MudText>
<MudText Typo="Typo.caption" HtmlTag="div" Align="Align.Center" Color="Color.Info">رشد میانگین شبکه</MudText>
</MudPaper>
</MudItem>
<MudItem xs="6" md="3">
<MudPaper Outlined="true" Class="pa-4 rounded-lg text-center">
<MudText Typo="Typo.h4" Align="Align.Center" Class="fw-700">۹۹٫۹٪</MudText>
<MudText Typo="Typo.caption" HtmlTag="div" Align="Align.Center" Color="Color.Info">آپ‌تایم سرویس</MudText>
</MudPaper>
</MudItem>
<MudItem xs="6" md="3">
<MudPaper Outlined="true" Class="pa-4 rounded-lg text-center">
<MudText Typo="Typo.h4" Align="Align.Center" Class="fw-700">۳ روز</MudText>
<MudText Typo="Typo.caption" HtmlTag="div" Align="Align.Center" Color="Color.Info">میانگین زمان استقرار</MudText>
</MudPaper>
</MudItem>
<MudItem xs="6" md="3">
<MudPaper Outlined="true" Class="pa-4 rounded-lg text-center">
<MudText Typo="Typo.h4" Align="Align.Center" Class="fw-700">+۲۰ کشور</MudText>
<MudText Typo="Typo.caption" HtmlTag="div" Align="Align.Center" Color="Color.Info">پوشش ارسال کد</MudText>
</MudPaper>
</MudItem>
</MudGrid>
</MudContainer>
</section>
<!-- FEATURES: معرفی پکیج‌ها -->
<section id="features" class="py-14">
<MudContainer MaxWidth="MaxWidth.Large">
<MudText Typo="Typo.h4" Align="Align.Center" Class="mb-1 fw-700">پکیج‌ها و امکانات</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center" Class="muted mb-8">بر اساس اندازهٔ تیم خود انتخاب کنید.</MudText>
<MudGrid Spacing="3" Justify="Justify.Center" Class="stretch-grid">
@foreach (var p in _packs)
{
<MudItem xs="12" md="4" Class="d-flex">
<MudPaper Elevation="2" Class="rounded-2xl d-flex flex-column flex-grow-1 overflow-hidden">
<MudImage Src="@p.Image"
Alt="@p.Title"
Height="300"
ObjectFit="ObjectFit.Cover"
ObjectPosition="ObjectPosition.Center"
Class="feature-img" />
<div class="pa-5">
<MudText Typo="Typo.h6" Class="mb-1">@(p.Title)</MudText>
<MudText Typo="Typo.body2" Class="muted mb-2">@(p.Body)</MudText>
<MudList T="string" Dense="true">
@foreach (var item in p.Items)
{
<MudListItem T="string" Value="@item">
<MudIcon Icon="@Icons.Material.Filled.Verified" Size="Size.Small" Class="ml-2" />
@item
</MudListItem>
}
</MudList>
</div>
</MudPaper>
</MudItem>
}
</MudGrid>
</MudContainer>
</section>
<!-- PRICING -->
<section id="pricing" class="py-14">
<MudContainer MaxWidth="MaxWidth.Large">
<MudText Typo="Typo.h4" Align="Align.Center" Class="mb-1 fw-700">قیمت‌گذاری</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center" Class="muted mb-8">قیمت‌ها به تومان — بدون هزینهٔ پنهان.</MudText>
<MudGrid Spacing="3" Justify="Justify.Center">
@foreach (var p in _plans)
{
<MudItem xs="12" md="4" Class="d-flex">
<MudCard Class="rounded-2xl d-flex flex-column flex-grow-1">
<MudCardContent Class="pa-6">
<MudText Typo="Typo.overline" Class="muted">@(p.Name)</MudText>
<MudText Typo="Typo.h4" Class="fw-700 mb-2">@p.Price</MudText>
<MudList T="string" Dense="true">
@foreach (var item in p.Features)
{
<MudListItem T="string" Value="@item">
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Size="Size.Small" Class="ml-2" />
@(item)
</MudListItem>
}
</MudList>
</MudCardContent>
<MudCardActions Class="pa-4 pt-0 d-flex justify-center">
<MudButton Color="Color.Primary" FullWidth="true" Variant="@(p.Highlight ? Variant.Filled : Variant.Outlined)">انتخاب پکیج</MudButton>
</MudCardActions>
</MudCard>
</MudItem>
}
</MudGrid>
</MudContainer>
</section>
<!-- TESTIMONIALS -->
<section id="testimonials" class="py-14 testimonials">
<MudContainer MaxWidth="MaxWidth.Large">
<MudText Typo="Typo.h4" Align="Align.Center" Class="mb-1 fw-700">اعتماد مشتریان</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center" Class="muted mb-8">بخشی از تجربهٔ استفاده از «فرصت».</MudText>
<MudGrid Spacing="3" Justify="Justify.Center">
<MudItem xs="12" md="6">
<MudPaper Elevation="2" Class="rounded-2xl pa-5">
<MudStack Spacing="2">
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
<MudAvatar>
<MudImage ObjectFit="ObjectFit.Cover"
ObjectPosition="ObjectPosition.Center"
Src="https://images.unsplash.com/photo-1607746882042-944635dfe10e?q=80&w=256&auto=format&fit=crop"></MudImage>
</MudAvatar>
<div>
<MudText Typo="Typo.subtitle2">شرکت سینا نت</MudText>
<MudText Typo="Typo.overline" Class="mud-text-secondary">مدیر عملیات</MudText>
</div>
</MudStack>
<MudText Typo="Typo.caption" Class="muted">بدون اسپم؛ هر زمان بخواهید لغو کنید.</MudText>
</MudItem>
<MudItem xs="12" md="6">
<MudPaper Elevation="6" Class="p-4 rounded-2xl preview-card">
<MudStack Spacing="2">
<MudText Typo="Typo.h6">نمای لحظه‌ای</MudText>
<MudDivider />
<MudStack Row="true" Spacing="1" AlignItems="AlignItems.Center">
<MudAvatar Color="Color.Secondary" Icon="@Icons.Material.Filled.Groups" />
<MudText Typo="Typo.subtitle2">اعضای فعال</MudText>
<MudSpacer />
<MudText Typo="Typo.subtitle2" Class="fw-700">1,284</MudText>
</MudStack>
<MudProgressLinear Value="72" Color="Color.Primary" Class="my-1" />
<MudStack Row="true" Spacing="1" AlignItems="AlignItems.Center">
<MudAvatar Color="Color.Tertiary" Icon="@Icons.Material.Filled.Timeline" />
<MudText Typo="Typo.subtitle2">پرداختی ماهانه</MudText>
<MudSpacer />
<MudText Typo="Typo.subtitle2" Class="fw-700">$48,970</MudText>
</MudStack>
<MudProgressLinear Value="54" Color="Color.Secondary" Class="my-1" />
</MudStack>
</MudPaper>
</MudItem>
</MudGrid>
</MudContainer>
</section>
<!-- Features -->
<section id="features" class="py-14">
<MudContainer MaxWidth="MaxWidth.Large">
<MudText Typo="Typo.h4" Align="Align.Center" Class="mb-1 fw-700">هرچه نیاز دارید</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center" Class="muted mb-8">سریع، آماده تولید و زیبا از ابتدا.</MudText>
<MudGrid Spacing="3" Justify="Justify.Center" Class="stretch-grid">
@foreach (var f in _features)
{
<MudItem xs="12" md="4" Class="d-flex">
<MudPaper Elevation="2" Class="p-5 rounded-2xl d-flex flex-column flex-grow-1">
<MudStack Spacing="1">
<MudAvatar Color="@f.Color" Icon="@f.Icon" />
<MudText Typo="Typo.h6">@f.Title</MudText>
<MudText Typo="Typo.body2" Class="muted">@f.Body</MudText>
</MudStack>
</MudPaper>
</MudItem>
}
</MudGrid>
</MudContainer>
</section>
<!-- Pricing -->
<section id="pricing" class="py-14">
<MudContainer MaxWidth="MaxWidth.Large">
<MudText Typo="Typo.h4" Align="Align.Center" Class="mb-1 fw-700">قیمت‌گذاری ساده</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center" Class="muted mb-8">رایگان شروع کنید و در صورت نیاز ارتقا دهید.</MudText>
<MudGrid Spacing="3" Justify="Justify.Center">
@foreach (var p in _plans)
{
<MudItem xs="12" md="4" Class="d-flex">
<MudCard Class="rounded-2xl d-flex flex-column flex-grow-1">
<MudCardContent Class="p-6">
<MudText Typo="Typo.overline" Class="muted">@p.Name</MudText>
<MudText Typo="Typo.h4" Class="fw-700 mb-2">@p.Price</MudText>
<MudList T="string" Dense="true">
@foreach (var item in p.Features)
{
<MudListItem>
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Size="Size.Small" Class="ml-2" />
@item
</MudListItem>
}
</MudList>
</MudCardContent>
<MudCardActions Class="p-6 pt-0">
<MudButton Color="Color.Primary" Variant="@(p.Highlight ? Variant.Filled : Variant.Outlined)" Class="w-100">انتخاب پلن</MudButton>
</MudCardActions>
</MudCard>
</MudItem>
}
</MudGrid>
</MudContainer>
</section>
<!-- FAQ -->
<section id="faq" class="py-14">
<MudContainer MaxWidth="MaxWidth.Large">
<MudText Typo="Typo.h4" Align="Align.Center" Class="mb-1 fw-700">سوالات متداول</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center" Class="muted mb-8">پاسخ به سوالات رایج راه‌اندازی و صورتحساب.</MudText>
<MudGrid>
<MudItem xs="12" md="8" mdOffset="2">
<MudExpansionPanels Elevation="1" Square="false" Class="rounded-2xl">
@foreach (var q in _faqs)
{
<MudExpansionPanel Text="@q.Q">
<MudText Typo="Typo.body2">@q.A</MudText>
</MudExpansionPanel>
}
</MudExpansionPanels>
</MudItem>
</MudGrid>
</MudContainer>
</section>
<!-- CTA -->
<section id="contact" class="py-14">
<MudContainer MaxWidth="MaxWidth.Medium" Class="text-center">
<MudPaper Elevation="2" Class="p-8 rounded-2xl">
<MudText Typo="Typo.h5" Class="fw-700 mb-2">آماده‌ی راه‌اندازی هستید؟</MudText>
<MudText Typo="Typo.body1" Class="muted mb-4">ایمیل‌تان را بگذارید تا دسترسی زودهنگام بگیرید.</MudText>
<MudStack Row="true" Spacing="2" Justify="Justify.Center">
<MudTextField @bind-Value="_email" For="@(() => _email)" Placeholder="you@company.com" Variant="Variant.Outlined" Class="max-w-56" />
<MudButton Color="Color.Primary" OnClick="@JoinWaitlist">درخواست دسترسی</MudButton>
<MudText Typo="Typo.body2">
«با فرصت، محاسبهٔ کارمزدها و پایش تیم‌ها بدون اکسل و دردسر انجام می‌شود.»
</MudText>
</MudStack>
</MudPaper>
</MudContainer>
</section>
</MudItem>
<MudItem xs="12" md="6">
<MudPaper Elevation="2" Class="rounded-2xl pa-5">
<MudStack Spacing="2">
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
<MudAvatar>
<MudImage ObjectFit="ObjectFit.Cover"
ObjectPosition="ObjectPosition.Center"
Src="https://images.unsplash.com/photo-1544005313-94ddf0286df2?q=80&w=256&auto=format&fit=crop"></MudImage>
</MudAvatar>
<div>
<MudText Typo="Typo.subtitle2">هولدینگ آریانا</MudText>
<MudText Typo="Typo.overline" Class="mud-text-secondary">مدیر فروش</MudText>
</div>
</MudStack>
<MudText Typo="Typo.body2">
«شجره‌نامهٔ بصری و گزارش‌های دقیق باعث شد رشد تیم را لحظه‌ای ببینیم.»
</MudText>
</MudStack>
</MudPaper>
</MudItem>
</MudGrid>
</MudContainer>
</section>
<!-- FAQ -->
<section id="faq" class="py-14">
<MudContainer MaxWidth="MaxWidth.Large">
<MudText Typo="Typo.h4" Align="Align.Center" Class="mb-1 fw-700">سوالات متداول</MudText>
<MudText Typo="Typo.subtitle1" Align="Align.Center" Class="muted mb-8">پاسخ به سوالات رایج راه‌اندازی و صورتحساب.</MudText>
<div class="mx-auto max-w-800">
<MudExpansionPanels Elevation="1" Square="false" Class="rounded-2xl">
@foreach (var q in _faqs)
{
<MudExpansionPanel Text="@q.Q">
<MudText Typo="Typo.body2">@q.A</MudText>
</MudExpansionPanel>
}
</MudExpansionPanels>
</div>
</MudContainer>
</section>
<!-- CTA -->
<section id="contact" class="py-14">
<MudContainer MaxWidth="MaxWidth.Medium" Class="text-center">
<MudPaper Elevation="2" Class="pa-4 rounded-2xl">
<MudText Typo="Typo.h5" Class="fw-700 mb-2">آمادهٔ راه‌اندازی هستید؟</MudText>
<MudText Typo="Typo.body1" Class="muted mb-4">ایمیل‌تان را بگذارید تا دسترسی زودهنگام بگیرید.</MudText>
<MudStack Row="true" Spacing="2" Justify="Justify.Center">
<MudTextField @bind-Value="_email" For="@(() => _email)" Placeholder="you@company.com" Variant="Variant.Outlined" Class="max-w-56" />
<MudButton Color="Color.Primary" OnClick="@JoinWaitlist">درخواست دسترسی</MudButton>
</MudStack>
</MudPaper>
</MudContainer>
</section>

View File

@@ -1,49 +1,58 @@
using FrontOffice.Main.Utilities;
using FrontOffice.Main.Utilities;
using MudBlazor;
namespace FrontOffice.Main.Pages;
public partial class Index
{
private string? _email;
private void JoinWaitlist()
{
if (string.IsNullOrWhiteSpace(_email))
{
Snackbar.Add("Please enter a valid email.", Severity.Warning);
Snackbar.Add("لطفاً ایمیل معتبر وارد کنید.", Severity.Warning);
return;
}
Snackbar.Add("You're on the list. We'll be in touch!", Severity.Success);
Snackbar.Add("به لیست انتظار «فرصت» اضافه شدید.", Severity.Success);
_email = string.Empty;
}
// Data models
private record Feature(string Title, string Body, string Icon, Color Color);
private record Pack(string Title, string Body, IEnumerable<string> Items, string Image);
private record Plan(string Name, string Price, bool Highlight, IEnumerable<string> Features);
private record QA(string Q, string A);
// Sample data
private readonly List<Feature> _features = new()
private readonly List<Pack> _packs = new()
{
new("Binary Plan Engine", "Accurate volume pairing and capping with weekly cycles.", Icons.Material.Filled.AccountTree, Color.Primary),
new("Genealogy Viewer", "See left/right legs, depth, and spillover at a glance.", Icons.Material.Filled.DeviceHub, Color.Secondary),
new("Commission Reports", "Month-by-month breakdowns with exportable statements.", Icons.Material.Filled.Assessment, Color.Tertiary),
new("KYC & Security", "Role-based access, audit logs, and 2FA-ready flows.", Icons.Material.Filled.VerifiedUser, Color.Success),
new("Payments", "Wallets, withdrawals, and reconciliation dashboards.", Icons.Material.Filled.AccountBalanceWallet, Color.Info),
new("API & Webhooks", "Integrate with CRMs, bots, and third-party services.", Icons.Material.Filled.IntegrationInstructions, Color.Dark)
};
new("پکیج استارتر", "برای تیم‌های کوچک و شروع سریع.", new []{
"تا ۲۰۰ عضو فعال",
"نمایش شجره‌نامه پایه",
"گزارش‌های ماهانه"
}, "https://images.unsplash.com/photo-1517245386807-bb43f82c33c4?q=80&w=1200&auto=format&fit=crop"),
new("پکیج رشد", "برای تیم‌های در حال توسعه.", new []{
"تا ۵۰۰۰ عضو",
"موتور کارمزد پیشرفته",
"پشتیبانی اولویت‌دار"
}, "https://images.unsplash.com/photo-1551836022-4e32a88b5f16?q=80&w=1200&auto=format&fit=crop"),
new("پکیج اسکیل", "برای سازمان‌های بزرگ و حساس.", new []{
"اعضای نامحدود",
"قوانین سفارشی کارمزد",
"SLA و آن‌بوردینگ اختصاصی"
}, "https://images.unsplash.com/photo-1522075469751-3a6694fb2f61?q=80&w=1200&auto=format&fit=crop"),
};
private readonly List<Plan> _plans = new()
{
new("Starter", "$0", false, new []{ "Up to 200 members", "Basic genealogy", "Email support" }),
new("Growth", "$39/mo", true, new []{ "Up to 5,000 members", "Advanced genealogy", "Commission engine", "Priority support" }),
new("Scale", "Contact us", false, new []{ "Unlimited members", "Custom rules", "SLA & onboarding", "Dedicated success manager" }),
new("استارتر", "رایگان", false, new []{ "تا ۲۰۰ عضو", "شجره‌نامه پایه", "پشتیبانی ایمیلی" }),
new("رشد", "۳۹ دلار / ماه", true, new []{ "تا ۵۰۰۰ عضو", "شجره‌نامه پیشرفته", "موتور کارمزد", "پشتیبانی اولویت‌دار" }),
new("اسکیل", "تماس بگیرید", false, new []{ "نامحدود", "قوانین سفارشی", "SLA و آن‌بوردینگ", "مدیر موفقیت اختصاصی" }),
};
private readonly List<QA> _faqs = new()
{
new("Can I use my own domain?", "Yes, you can deploy behind your custom domain and SSL certificates."),
new("Does it work with self-hosted databases?", "Absolutely. We support SQL Server, PostgreSQL, and MySQL."),
new("What payment gateways are supported?", "You can integrate Stripe, PayPal, or your own gateway via webhooks."),
new("Can I export my data?", "Yes. Export to CSV/Excel at any time from your admin dashboard."),
new("دامنهٔ اختصاصی دارم؛ قابل اتصال است؟", "بله، پشت دامنه و گواهی SSL خودتان مستقر می‌شود."),
new("با دیتابیس خودم کار می‌کند؟", "کاملاً. SQL Server، PostgreSQL و MySQL پشتیبانی می‌شود."),
new("چه درگاه‌هایی پشتیبانی می‌شود؟", "Stripe و PayPal یا درگاه اختصاصی از طریق وب‌هوک‌ها."),
new("می‌توانم داده‌ها را خروجی بگیرم؟", "هر زمان از داشبورد ادمین خروجی CSV/Excel بگیرید."),
};
}

View File

@@ -1,4 +1,4 @@
@page "/"
@page "/"
@using Microsoft.AspNetCore.Components.Web
@namespace FrontOffice.Main.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@@ -22,17 +22,55 @@
<div id="blazor-error-ui">
<environment include="Staging,Production">
?? ??? ?? ???? ???. ??? ?????? ???? ??? ?? ???? ???????? ???? ?????? ?????.
یک خطا رخ داده است. این برنامه ممکن است تا زمان بارگذاری مجدد پاسخگو نباشد.
</environment>
<environment include="Development">
???? ??????????? ?? ????? ?????? ???. ???? ?????? ??????? ????? ????? (DevTools) ?????? ?? ????? ??????.
خطای مدیریت‌نشده ای اتفاق افتاده است. برای مشاهده جزئیات، ابزار توسعه (DevTools) مرورگر را بررسی نمایید.
</environment>
<a href="" class="reload">???????? ????</a>
<a class="dismiss">??</a>
<a href="" class="reload">بارگذاری مجدد</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.server.js"></script>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script>
// elementId: id نوار (مثلاً "top")
// containerSelector: کانتینری که اسکرول می‌خوره؛ برای MudLayout معمولا ".mud-main-content"
// threshold: آستانه پیکسل
function changeNavBgOnBodyScroll(elementId, containerSelector = null, threshold = 10) {
var navbar = document.getElementById(elementId);
if (!navbar) return;
var container = containerSelector ? document.querySelector(containerSelector) : window;
var getScrollTop = function () {
if (container === window) {
return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
}
return container.scrollTop || 0;
};
var update = function () {
var y = getScrollTop();
if (y >= threshold) {
navbar.classList.add("white", "mud-elevation-2");
} else {
navbar.classList.remove("white", "mud-elevation-2");
}
};
// گوش دادن به اسکرول روی کانتینر درست
(container === window ? window : container).addEventListener("scroll", update, { passive: true });
// برای بارگذاری اولیه / تغییر اندازه / بازگشت از تاریخچه
window.addEventListener("load", update);
window.addEventListener("resize", update);
window.addEventListener("pageshow", update);
// اجرای اولیه (حتی اگر کاربر اسکرول نکرده)
requestAnimationFrame(update);
}
</script>
</body>
</html>