كل الشروحات

· درس

أداة تصميم كاروسيل بـClaude Artifacts: برومبت واحد

تعلّم كيف تبني أداة تصميم كاروسيل تعمل في متصفحك ببرومبت واحد في Claude Artifacts: تعدّل الشرائح وتصدّرها صور PNG، مع قالب جاهز للتحميل.

أداة تصميم كاروسيل بـClaude Artifacts: برومبت واحد
محتويات الشرح
  1. ما هي ميزة Claude Artifacts؟
  2. لماذا تبني أداة بدل أن تطلب التصميم كل مرة؟
  3. ماذا تحصل عليه؟
  4. طريقة الاستخدام خطوة بخطوة
  5. كيف تعبّئ خيارات التخصيص؟
  6. لا تريد الانتظار؟ حمّل القالب الجاهز
  7. مشكلات شائعة وحلولها
  8. أسئلة شائعة
  9. البرومبت الكامل
  10. اقرأ أيضًا

ملخص سريع

  • ما هذا؟ طريقة تبني بها أداة تصميم كاروسيل تعمل داخل المتصفح ببرومبت واحد، تعدّل فيها النصوص والصور وتصدّر الشرائح صورًا.

  • ماذا تحتاج؟ حساب في Claude.ai ومتصفح حديث. لا تحتاج إلى معرفة بالبرمجة.

  • ماذا تحصل في النهاية؟ ملف HTML واحد: أداة تحرّر فيها الشرائح وتصدّرها بصيغة PNG، شريحة شريحة أو كلها دفعة واحدة في ملف ZIP.

ما هي ميزة Claude Artifacts؟

الـ Artifact ليس مجرد ميزة دردشة متطورة. تقنيًا هو «مساحة عمل حيّة» (Live Workspace) تفتح بجانب نافذة المحادثة. عندما تطلب من Claude كتابة كود (مثل HTML أو React) فإنه لا يعرضه لك كنص جامد تضطر لنسخه وتشغيله في برنامج آخر، بل يشغّله أمامك كواجهة تفاعلية. أي أنك تبني تطبيقات ويب صغيرة جاهزة للاستخدام الفوري.

لماذا تبني أداة بدل أن تطلب التصميم كل مرة؟

  • توفير الاستهلاك: بمجرد بناء الأداة تعمل كصفحة ويب في متصفحك. لن تطلب التصميم من Claude في كل مرة، بل ستستخدمه لتوليد الأفكار فقط.

  • الاستقلالية والسرعة: ترفع صورك، وتغيّر النصوص، وتعدّل الألوان داخل الأداة بدون أي انتظار.

  • تصدير بضغطة زر: تجمع الشرائح وتصدّرها صورًا PNG عالية الجودة جاهزة للنشر.

ماذا تحصل عليه؟

هذه هي المواصفات التي يطلبها البرومبت من Claude:

  • نصوص قابلة للتعديل بالنقر عليها مباشرة، بدون نماذج أو نوافذ.

  • رفع صورة لكل شريحة وتحريكها للأعلى والأسفل، وتبقى الصورة داخل المتصفح ولا تُرفع إلى أي خادم.

  • شريط أدوات لكل شريحة: تحريكها لأعلى أو لأسفل، وقلب ترتيب الصورة والنص، وإخفاء الوسم الصغير، ونسخ الشريحة، وحذفها، وتنزيلها.

  • لون رئيسي واحد تغيّره من الأعلى فتتغير ألوان كل الشرائح معًا.

  • زر «تنزيل كل الشرائح» يجمعها في ملف ZIP واحد، لأن المتصفحات تحجب التنزيلات المتعددة المتتالية.

راجع النتيجة وجرّب كل زر بنفسك، فقد يخطئ النموذج أحيانًا في تنفيذ بعض المواصفات.

طريقة الاستخدام خطوة بخطوة

  1. افتح Claude.ai وتأكد أن ميزة Artifacts تعمل في حسابك (إن طلب حسابك تفعيلها فهي في الإعدادات).

  2. ابدأ محادثة جديدة والصق البرومبت الكامل من آخر هذه الصفحة، بعد أن تبدّل الحقول الخمسة الأولى بقيمك (الشرح التالي).

  3. انتظر حتى يبني Claude الأداة. ستفتح في لوحة جانبية بجوار المحادثة.

  4. جرّبها: انقر على أي نص لتعدّله، وارفع صورة لكل شريحة، ورتّب الشرائح أو انسخها أو احذفها.

  5. غيّر اللون من مربع اللون في الأعلى.

  6. صدّر: زر على كل شريحة لتنزيلها صورة PNG، وزر «تنزيل كل الشرائح» لملف ZIP واحد.

  7. احفظ الأداة بنسخ الكود إلى ملف بصيغة .html على جهازك، لتفتحها لاحقًا في المتصفح.

كيف تعبّئ خيارات التخصيص؟

في أول البرومبت خمسة حقول بين أقواس مربعة. بدّل ما بين الأقواس بقيمك قبل الإرسال:

  • Language / text direction: لغة النص واتجاهه. للعربية اكتب Arabic, RTL، وللإنجليزية English, LTR.

  • Font: الخط. الأسهل system-ui (خط جهازك)، أو اسم خط من Google Fonts مثل Noto Sans Arabic.

  • Default accent color: اللون الرئيسي بكود hex، مثل #D97757.

  • Default slide size: مقاس الشريحة. المقترح في البرومبت 1080x1350 للتصدير، وهي نسبة 4:5 المناسبة لإنستغرام.

  • Dark or light slide background: هل خلفية الشريحة داكنة أم فاتحة، مع لون الخلفية ولون النص.

مثال تعبئة جاهز للعربية، انسخه واستبدل به الأسطر الخمسة في البرومبت:

Language / text direction: Arabic, RTL
Font: Noto Sans Arabic (Google Font)
Default accent color: #D97757
Default slide size: 1080x1350 export, 420x525 on-screen
Dark or light slide background by default: dark #141413 bg, off-white ink

لا تريد الانتظار؟ حمّل القالب الجاهز

إذا أردت استخدام الأداة مباشرة بدون بنائها، حمّل الملف الجاهز على جهازك: ملف تصميم الكاروسيل جاهز للتحميل

مشكلات شائعة وحلولها

زر «تنزيل كل الشرائح» ينزّل ملفًا واحدًا فقط أو يفشل

اطلب من Claude: «أعد بناء زر تنزيل كل الشرائح ليجمع الصور في ملف ZIP واحد باستخدام JSZip، بدل تنزيلات متعددة متتالية». هذا هو الأسلوب الذي يطلبه البرومبت أصلًا.

النص العربي يظهر باتجاه خاطئ

تأكد أنك كتبت Arabic, RTL في حقل اللغة، أو استخدم زر تبديل الاتجاه في الأعلى.

الصورة المصدّرة أقل جودة من المتوقع

اطلب من Claude التأكد أن نسبة التصدير (pixelRatio) تساوي 1080 مقسومة على عرض الشريحة على الشاشة.

الأداة لا تظهر في اللوحة الجانبية

حدّث الصفحة وأعد المحاولة، أو استخدم القالب الجاهز أعلاه.

أسئلة شائعة

هل أحتاج إلى معرفة البرمجة؟
لا. تنسخ البرومبت وتبدّل الحقول الخمسة بقيمك، ثم تستخدم الأداة بالنقر.

هل تُرفع صوري إلى أي مكان؟
حسب مواصفات البرومبت، تُقرأ الصور داخل المتصفح فقط ولا تُرسل إلى أي خادم. إن كانت صورك حساسة، تحقق من الأداة بنفسك قبل الاعتماد عليها.

هل أستطيع استخدام الأداة بعد إغلاق Claude؟
نعم، إذا حفظتها كملف HTML. وكذلك القالب الجاهز، تفتحه مباشرة في المتصفح.

ما الفرق بين هذه الأداة ومساعد كتابة الكاروسيل؟
هذه أداة تصميم: شكل الشرائح وتصديرها. أما كتابة نص الكاروسيل نفسه فتجدها في مساعد كتابة كاروسيل إنستغرام في Claude.

البرومبت الكامل

انسخه كاملًا والصقه في محادثة جديدة مع Claude، بعد تبديل الحقول الخمسة الأولى:

Build me a single self-contained HTML artifact that works as a visual
editor for creating Instagram/LinkedIn-style multi-slide carousel posts,
which I can fill in with text and images and then export as PNGs.
Customization (fill these in)
Language / text direction: [e.g. English, LTR — or Arabic, RTL]
Font: [e.g. embed "Inter" — or link a Google Font — or use system-ui]
Default accent color: [hex code, e.g. #D97757]
Default slide size: [e.g. 1080x1350 export, 420x525 on-screen — a 4:5
portrait ratio is ideal for Instagram]
Dark or light slide background by default: [e.g. dark #141413 bg, off-white ink]
Core concept
Each "slide" is split into two halves stacked vertically:
An image half — a zone where the user uploads a background photo.
A text half — a solid-color panel with a small eyebrow tag, a bold
heading, and a smaller supporting paragraph, all directly editable in place.
The whole page is a scrollable stack of these slide cards, each with its own
mini toolbar above it, plus a global toolbar at the top and an "add slide"
button at the bottom.
Required features
1. Directly editable text, no forms/modals
- Use contenteditable="true" on the tag/eyebrow, heading, and paragraph.
- Show a placeholder via data-ph="..." + CSS :empty:before{content:attr(data-ph)}.
- On hover/focus, editable regions get a subtle highlight background so it's
  obvious what's clickable — no visible outline/border by default.
2. Image upload per slide, no external hosting
- Clicking/tapping an empty image zone reveals an upload button (visible
  by default, or on hover on desktop).
- Reads the file with FileReader.readAsDataURL() and sets it as a CSS
  background-image — fully client-side, nothing leaves the browser.
- Once an image is set, show a small "change image" button and up/down
  nudge arrows that let the user reposition the image vertically
  (store the offset in a CSS custom property like --posY, adjustable in a
  0–100% range) — useful for portraits where a face gets cropped badly.
- Overlay a subtle color tint (derived from the accent color) and a faint
  grain/noise texture over every uploaded image so photos from different
  sources look visually consistent.
3. Per-slide toolbar
Each slide gets its own compact row of icon buttons above it:
- Move slide up / down (reorder within the stack)
- Flip — toggles whether the image half is on top or the text half is on
  top for that specific slide (use flex-direction: column-reverse)
- Toggle the small tag/eyebrow's visibility on or off
- Duplicate this slide (copies text, image, flip state, and tag visibility)
- Delete this slide (block deleting the very last remaining slide)
- Download just this one slide as a PNG
4. Global toolbar (top of page)
- A native <input type="color"> swatch that recolors every slide's accent
  at once. When changed, use JS to programmatically derive a darker shade and
  a lighter shade from the chosen hex (simple RGB multiplication, e.g. ×0.72
  and ×1.18 clamped to 255) and apply all three via CSS custom properties on
  :root — don't make the user pick three colors separately.
- If the content is bilingual/RTL-capable, an RTL/LTR direction toggle.
- A "download all slides" button. IMPORTANT: do NOT implement this as a loop
  that fires multiple separate link.click() downloads in sequence, even with
  a delay between them. Real browsers (Chrome especially) silently block
  automatic multi-file downloads after the first one or two — this is a hard
  permission gate, not a timing issue, so a setTimeout delay will not fix it
  and the bug will only show up for real users, not in automated testing.
  Instead: bundle the JSZip library inline (same approach as html-to-image
  below), loop through every slide exporting each to a PNG data URL, add
  each one to a JSZip instance as slide-01.png, slide-02.png, etc., then
  call zip.generateAsync({type:'blob'}) once at the end and trigger exactly
  ONE download of a single carousel-slides.zip file. While processing, update
  the button's own text to show progress (e.g. "Exporting… (2/5)") so the
  user knows it's working during the export loop.
5. Add / progress
- A dashed "+ add slide" button at the very bottom that appends a new blank
  slide using the same template function (give it a fresh unique id).
- Each slide shows a thin progress bar + "current/total" counter (like
  Instagram Stories) at its bottom edge, and renumber all slides whenever
  one is added, deleted, or reordered.
6. PNG export (this is the important technical part)
- Bundle the html-to-image library inline via a <script> tag (its
  minified UMD bundle is small — paste it directly into the file so the
  artifact has zero external network dependencies and works fully offline).
- Export using htmlToImage.toPng(element, { pixelRatio, backgroundColor, width, height, cacheBust: true }),
  where pixelRatio is calculated as targetExportWidth / onScreenWidth
  (e.g. 1080/420) so exports are full-resolution even though the on-screen
  card is small.
- Before capturing, add an .exporting class to the slide that hides all
  editor-only chrome (upload buttons, nudge arrows, contenteditable focus
  styling) via CSS, then remove the class after capture completes.
- Name files predictably inside the zip: slide-01.png, slide-02.png, etc.
- For the single-slide "download this one" button (not the "download all"
  button), a plain single PNG download via link.click() is fine — the
  browser block only applies to multiple automatic downloads from one
  action, so one-at-a-time manual downloads are never a problem.
Structure & constraints
- One HTML file. Inline <style> and <script>, no build step, no
  external CDN calls except the bundled libraries (html-to-image and JSZip),
  embedded directly so the artifact has zero network calls at all.
- Use CSS custom properties (--primary, --dark2, --light2, --bg,
  --ink, etc.) for every themeable color so the accent-color system in
  feature #4 can restyle the whole page by touching only :root.
- Seed the page with 2–3 starter slides on load so it isn't empty.
- Keep all JS in plain vanilla functions attached via onclick= in the
  generated template strings — no framework needed, this keeps it a portable
  single file.
- Mobile-friendly: cards should be centered, max-width: 100%, and controls
  usable at narrow viewport widths.
Output
Give me the complete HTML file, ready to open directly in a browser or drop
into an artifact.

اقرأ أيضًا

واتساب للاستفسارات التجارية فقط

هذا الرقم مخصّص للتعاون والخدمات والاستفسارات التجارية.

أي رسالة بخصوص الهدايا أو الشروحات لن يتم الرد عليها.

متابعة إلى واتساب