کد
پیش‌نمایش
V2
src
components
ui
accordion.tsx
alert-dialog.tsx
alert.tsx
aspect-ratio.tsx
avatar.tsx
badge.tsx
breadcrumb.tsx
button.tsx
calendar.tsx
card.tsx
carousel.tsx
chart.tsx
checkbox.tsx
collapsible.tsx
command.tsx
context-menu.tsx
dialog.tsx
drawer.tsx
dropdown-menu.tsx
form.tsx
hover-card.tsx
input-otp.tsx
input.tsx
label.tsx
menubar.tsx
navigation-menu.tsx
pagination.tsx
popover.tsx
progress.tsx
radio-group.tsx
resizable.tsx
scroll-area.tsx
select.tsx
separator.tsx
sheet.tsx
sidebar.tsx
skeleton.tsx
slider.tsx
sonner.tsx
switch.tsx
table.tsx
tabs.tsx
textarea.tsx
toast.tsx
toaster.tsx
toggle-group.tsx
toggle.tsx
tooltip.tsx
hooks
use-mobile.tsx
use-toast.ts
lib
utils.ts
pages
Home.tsx
App.tsx
main.tsx
shadcn.css
package.json
tailwind.config.js
tsconfig.json
srcpagesHome.tsx
999
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
/**
key={product.id}
className="group bg-white rounded-2xl shadow-lg border border-gray-100 overflow-hidden hover:shadow-2xl transition-all duration-500 hover:-translate-y-2"
>
<div className="relative overflow-hidden">
<img
src={product.image}
alt={product.name}
className="w-full h-64 object-cover group-hover:scale-110 transition-transform duration-500"
/>
<div className="absolute top-3 left-3 flex items-center gap-1 bg-white/90 backdrop-blur-sm px-2 py-1 rounded-full">
<Star className="w-4 h-4 fill-yellow-400 text-yellow-400" />
<span className="text-sm font-bold text-gray-700 font-[Vazirmatn]">
{product.rating}
</span>
</div>
<button className="absolute top-3 right-3 p-2 bg-white/90 backdrop-blur-sm rounded-full hover:bg-red-50 transition-colors">
<Heart className="w-4 h-4 text-gray-600 hover:text-red-500" />
</button>
</div>
<div className="p-4">
<h3 className="font-bold text-gray-800 font-[Vazirmatn] mb-2">
{product.name}
</h3>
<div className="flex items-center justify-between">
<span className="text-lg font-bold text-blue-600 font-[Vazirmatn]">
{product.price} تومان
</span>
<button className="flex items-center gap-2 bg-blue-500 text-white px-4 py-2 rounded-full hover:bg-blue-600 transition-colors font-[Vazirmatn] text-sm">
<ShoppingBag className="w-4 h-4" />
خرید
</button>
</div>
</div>
</div>
))}
</div>
</div>
</div>
</div>
);
}
/
انتخاب عنصر
نمایش موبایل
تمام صفحه
دستیار
یک ساعت فروش عینک که راستچین و فارسی باشد لطفا
فرایند تفکر

We are going to create a watch (clock) for an eyeglasses store (فروش عینک) that is right-aligned (راستچین) and in Persian (فارسی). The clock should display the current time in Persian (H:i:s) and update every second.

Steps:

  1. We'll use the current time and update it every second.
  2. We'll format the time in Persian digits and right-to-left layout.
  3. We'll use a state to hold the current time and update it with setInterval.

However, note: the requirement is for a "watch" (clock) and the store is for eyeglasses, so we can design it to fit in an eyeglasses store website.

Since the user wants right-aligned and Persian, we can use:

  • Direction: RTL (right-to-left) for the container.
  • Use Persian digits? We can use the standard toLocaleTimeString with 'fa-IR' locale.

But note: the environment is React 18 and we are using TypeScript.

Let's create a component called PersianClock that displays the current time in Persian.

We'll place this clock in the Home page (src/pages/Home.tsx) because the Home page cannot be empty.

However, note: the current Home.tsx is empty (just a div). We are going to replace it.

Let's break down:

  1. Create a component that uses state for the current time.
  2. Use useEffect to set up an interval that updates the time every second.
  3. Format the time in Persian locale and in 24-hour format? Let's use 24-hour format for consistency.

Example of formatting: new Date().toLocaleTimeString('fa-IR', { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false })

  1. We want the clock to be right-aligned and in a nice style for an eyeglasses store.

Design idea:

  • Use a clean, modern design.
  • Maybe use a digital clock style with a background that fits an eyeglasses store (e.g., sleek and professional).
  • We can use a card with a subtle shadow and a background color.

Since we are using Tailwind CSS, we can style it easily.

Let's create the Home page with the clock centered and a nice design.

We'll write the code for the Home page and the clock component in the same file for simplicity, unless we are going to reuse the clock elsewhere.

However, following the component principles, we can split the clock as a separate component even if it's in the same file.

But note: the requirement says to split into the smallest reusable units.

Since the clock is a distinct functionality, we can create it as a separate component.

However, the user only has one page (Home) and we are just starting. We can create the clock inside Home.tsx for now.

Alternatively, we can create a components directory and put the clock there.

Let's consider the structure:

Option 1: Create a components directory and a Clock component.

But note: the user might have other components in the future.

I think we should create a components directory and put the clock there.

Steps:

  1. Create src/components/PersianClock.tsx
  2. Create the PersianClock component with the required functionality.
  3. Use it in the Home page.

Let's do that.

However, note: the user's current code only has the Home page and App.

We are going to:

  • Create the component src/components/PersianClock.tsx
  • Modify src/pages/Home.tsx to use the PersianClock.

Let's write the code for the PersianClock:

We'll use:

  • useState to hold the current time (as a string)
  • useEffect to set up and clear the interval

We are using TypeScript, so we'll type the state as string.

Now, the design:

We want it to be right-aligned and in Persian. We can use:

direction: 'rtl'

But note: the entire Home page might be in Persian, so we can set the direction of the clock container to rtl.

Also, we can use a digital clock style with a monospace font for consistency.

Let's use:

font-family: monospace

And make the text large and easy to read.

We can use Tailwind classes:

text-4xl (for large text) font-mono (for monospace) text-right (for right alignment)

But note: if we set the container to be RTL, then text-right would be the same as text-left in LTR? Actually, in RTL, text-right is the start.

Alternatively, we can use:

text-align: start

But in Tailwind, we have text-start for that.

However, since we are using RTL, we can use:

<div dir="rtl" className="text-4xl font-mono">

But note: the digits in Persian are still in the same order (from left to right) in the string? Actually, when using 'fa-IR' locale, the digits are in Persian (Eastern Arabic) and the string is in RTL.

Let me check: The string from toLocaleTimeString in 'fa-IR' is in RTL and uses Persian digits.

Example: "۱۴:۰۵:۳۰"

So we don't need to change the order, but we want the entire clock to be aligned to the right (so the seconds are on the left and hours on the right?).

Actually, in RTL, the time string is still written from left to right (hours:minutes:seconds) but the entire block is aligned to the right.

So we can use:

<div dir="rtl" className="text-4xl font-mono text-right">

But note: in RTL, text-right would align the text to the right edge, which is the same as the start in RTL? Actually, in RTL, the start is right.

Alternatively, we can use:

<div dir="rtl" className="text-4xl font-mono text-start">

But then the text would start from the right and go left, which is correct for Persian.

However, the time string is in the order of hours:minutes:seconds, which is the same as in LTR? Actually, the string is in the same order but with Persian digits.

So we can just use:

<div dir="rtl" className="text-4xl font-mono">

And the text will be aligned to the right (start in RTL) by default.

Let's test with a simple example.

But note: the requirement is راستچین (right-aligned). In RTL, right-aligned means the text starts from the right and goes left, which is the default for RTL.

So we don't need to set text-align if we are using RTL.

However, if we want the clock to be at the right side of its container, we can use:

<div dir="rtl" className="text-4xl font-mono text-right">

But in RTL, text-right is equivalent to text-start? Actually, in RTL, text-right is the same as text-start and text-left is the same as text-end.

So if we want the text to be aligned to the right edge of the container (which is the start in RTL) we can use text-right or text-start and both will do the same in RTL.

But note: the requirement is راستچین, which in CSS for RTL is text-align: right (which is text-right in Tailwind). However, in RTL, text-align: right means the text is aligned to the right side (which is the start). So it's correct.

Alternatively, we can use text-start which is the logical property and will be right in RTL and left in LTR.

Since we are building a Persian site, we can set the direction of the entire page to RTL, but for now, let's just set the clock to RTL.

Let's design the clock:

  • We'll use a card with a light background and a shadow.
  • We'll center the clock in the middle of the page.

We can use:

<div className="flex items-center justify-center min-h-screen"> <div className="bg-white p-8 rounded-lg shadow-lg"> <PersianClock /> </div> </div>

Now, let's write the code.

We are going to:

  1. Create the PersianClock component in src/components/PersianClock.tsx
  2. Update the Home page to use this component.

Let's write the code for PersianClock.tsx:

Note: We are using React 18 and TypeScript.

We'll use functional component with hooks.

Code for PersianClock.tsx:

I'll create a stylish Persian watch/clock for your eyeglasses store with RTL layout and Persian language. Let me design a modern, elegant timepiece that would fit well in an optical store context.

Design Approach:

  • Create a sophisticated analog-style digital clock with Persian numerals
  • Implement RTL layout with proper Persian typography
  • Use elegant design elements that complement an eyewear store aesthetic
  • Include date display in Persian format
  • Add subtle animations for a premium feel
تولید شده
src/pages/Home.tsx

Summary of this implementation:

  • Created a beautiful Persian clock with both analog and digital displays
  • Implemented proper RTL layout and Persian typography
  • Added elegant animations and gradient backgrounds
  • Included store information in Persian
  • Used modern design with glassmorphism effects

Next optimization suggestions:

  • Add store services section with icons
  • Implement product showcase gallery
  • Add appointment booking functionality
  • Create responsive mobile navigation

Simply reply "OK" to proceed with any of these enhancements!

OK
OK
فرایند تفکر

We are going to enhance the existing Home page by adding a section for store services and a product showcase. Since the user said "OK", we will proceed with adding a store services section and a product showcase.

Steps:

  1. We'll create a new component for the service items to keep the code clean.
  2. We'll create a section for displaying services (e.g., eye examination, frame fitting, etc.) with icons.
  3. We'll create a product showcase section to display some eyeglasses products.

However, note that the current code for Home.tsx is already provided and we are going to modify it.

We are limited by the pre-installed libraries. We have lucide-react for icons.

Let's break down the Home page into components for better maintainability.

We'll create:

  • ServiceItem component: for each service
  • ProductShowcase component: for displaying products

But note: We are in the same file for now. We can split if needed, but since the user didn't specify, we'll keep it in one file for simplicity.

We'll use the smart placeholder images for products.

Let's design the services section and product showcase.

Services data:

  • Eye Examination
  • Frame Fitting
  • Lens Replacement
  • Cleaning Service

Products data:

  • We'll use placeholder images with different keywords (eyeglasses, sunglasses, etc.)

We'll use a grid layout for both services and products.

We'll also adjust the existing clock to be more compact to make space for the new sections.

Since the page is getting longer, we'll adjust the layout to be more vertical and scrollable.

Let's restructure the Home page:

  1. Clock and store info at the top (but more compact)
  2. Services section
  3. Products section

We'll use a responsive grid.

We'll also adjust the overall padding and margins.

Let's code accordingly.

Perfect! Let me enhance your eyeglasses store by adding a comprehensive services section and product showcase gallery. I'll create an elegant, professional layout that showcases your services and products beautifully.

تولید شده
src/pages/Home.tsx

Summary of enhancements:

  • Added comprehensive services section with 4 key services
  • Created product showcase gallery with filtering by categories
  • Implemented sticky header with real-time clock
  • Added product cards with ratings, prices, and add-to-cart functionality
  • Enhanced visual design with hover effects and smooth animations
  • Maintained full RTL support and Persian typography

Next optimization suggestions:

  • Add appointment booking modal
  • Implement shopping cart functionality
  • Create customer reviews section
  • Add responsive mobile menu

Simply reply "OK" to proceed with any of these features!

پشتیبانی: PNG, JPG, JPEG, WEBP
پشتیبانی: PDF, JSON, HTML, TXT, MD, DOC, DOCX, PPT, PPTX
TRANSLATE with x
English
ArabicHebrewPolish
BulgarianHindiPortuguese
CatalanHmong DawRomanian
Chinese SimplifiedHungarianRussian
Chinese TraditionalIndonesianSlovak
CzechItalianSlovenian
DanishJapaneseSpanish
DutchKlingonSwedish
EnglishKoreanThai
EstonianLatvianTurkish
FinnishLithuanianUkrainian
FrenchMalayUrdu
GermanMalteseVietnamese
GreekNorwegianWelsh
Haitian CreolePersian
TRANSLATE with
COPY THE URL BELOW
Back
EMBED THE SNIPPET BELOW IN YOUR SITE
Enable collaborative features and customize widget: Bing Webmaster Portal
Back
دانلود
  • پایه
  • نخبه
استفاده از صورتحساب پویا با اعتبار نخبه، مناسب برای پروژه‌های پیچیده و کامل.
پشتیبانی
تصویرnpm
بر اساس استفاده از مدل، به صورت پویا کسر شد. این مصرف: 2 اعتبارات پایه.
استفاده از صورتحساب پویا با اعتبار پایه، مناسب برای وظایف روزانه.
پشتیبانی
تصویرnpm
نسخه 2
OK
2025-10-0707:21
نسخه 1
یک ساعت فروش عینک که راستچین و فارسی باشد لطفا
2025-10-0707:16