{
"$schema": "../../schemas/code-crispies-module-schema.json",
"id": "html-progress-meter",
"title": "HTML Progress & Meter",
"description": "اعرض حالة الإكمال والقياسات بشكل أصلي",
"mode": "html",
"difficulty": "beginner",
"lessons": [
{
"id": "progress-basic",
"title": "أشرطة التقدم",
"description": "عنصر <progress> يُظهر إكمال المهمة. استخدم value للتقدم الحالي و max للإجمالي.
ملاحظة: هذا ليس وسماً ذاتي الإغلاق! اكتب <progress>...</progress> مع نص بديل بالداخل للمتصفحات القديمة.",
"task": "أنشئ شريط تقدم يُظهر 70% إكمال:
1. أضف <label> يقول Download:
2. أضف <progress> مع value=\"70\" و max=\"100\"",
"previewHTML": "",
"previewBaseCSS": "body { font-family: system-ui; padding: 20px; } label { display: block; margin-bottom: 8px; font-weight: 500; } progress { width: 100%; height: 20px; border-radius: 10px; } progress::-webkit-progress-bar { background: #e0e0e0; border-radius: 10px; } progress::-webkit-progress-value { background: linear-gradient(90deg, #4caf50, #8bc34a); border-radius: 10px; } progress::-moz-progress-bar { background: linear-gradient(90deg, #4caf50, #8bc34a); border-radius: 10px; }",
"sandboxCSS": "",
"initialCode": "",
"solution": "\n",
"previewContainer": "preview-area",
"validations": [
{
"type": "element_exists",
"value": "progress",
"message": "أضف عنصر <progress>"
},
{
"type": "attribute_value",
"value": { "selector": "progress", "attr": "value", "value": "70" },
"message": "عيّن value=\"70\" في عنصر progress"
},
{
"type": "attribute_value",
"value": { "selector": "progress", "attr": "max", "value": "100" },
"message": "عيّن max=\"100\" في عنصر progress"
},
{
"type": "element_exists",
"value": "label",
"message": "أضف <label> لشريط التقدم"
}
]
},
{
"id": "progress-indeterminate",
"title": "تقدم غير محدد",
"description": "عندما يكون التقدم غير معروف (مثل التحميل)، احذف سمة value. هذا ينشئ حالة متحركة غير محددة.
مفيد لطلبات الشبكة أو العمليات ذات المدة غير المعروفة.",
"task": "أنشئ مؤشر تحميل:
1. أضف <p> يقول Loading...
2. أضف <progress> بدون سمة value",
"previewHTML": "",
"previewBaseCSS": "body { font-family: system-ui; padding: 20px; } p { margin-bottom: 10px; color: #666; } progress { width: 100%; height: 8px; border-radius: 4px; } progress::-webkit-progress-bar { background: #e0e0e0; border-radius: 4px; }",
"sandboxCSS": "",
"initialCode": "",
"solution": "
Loading...
\n", "previewContainer": "preview-area", "validations": [ { "type": "element_exists", "value": "progress", "message": "أضف عنصر <progress>" }, { "type": "element_exists", "value": "p", "message": "أضف <p> مع نص التحميل" } ] }, { "id": "meter-gauge", "title": "مقاييس meter", "description": "عنصر <meter> يعرض قيمة قياسية ضمن نطاق. استخدمه للقياسات مثل مساحة القرص، البطارية، أو التقييمات.Battery: