Spaces:
Sleeping
Sleeping
Tristan Yu commited on
Commit ·
0090241
1
Parent(s): 02f1559
Week 2 tutorial task: side-by-side layout with 1/4 image size, text on right
Browse files- src/pages/TutorialTasks.tsx +36 -11
src/pages/TutorialTasks.tsx
CHANGED
|
@@ -898,18 +898,43 @@ const TutorialTasks: React.FC = () => {
|
|
| 898 |
</div>
|
| 899 |
) : (
|
| 900 |
<>
|
| 901 |
-
|
| 902 |
-
|
| 903 |
-
<div className="
|
| 904 |
-
|
| 905 |
-
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
|
| 909 |
-
|
| 910 |
-
|
| 911 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 912 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 913 |
)}
|
| 914 |
</>
|
| 915 |
)}
|
|
|
|
| 898 |
</div>
|
| 899 |
) : (
|
| 900 |
<>
|
| 901 |
+
{selectedWeek === 2 && task.imageUrl ? (
|
| 902 |
+
// Week 2 side-by-side layout with reduced image size
|
| 903 |
+
<div className="flex flex-col md:flex-row gap-6 items-start">
|
| 904 |
+
{/* Image on the left - 1/4 of original size */}
|
| 905 |
+
<div className="w-full md:w-1/4 flex justify-center">
|
| 906 |
+
<img
|
| 907 |
+
src={task.imageUrl}
|
| 908 |
+
alt={task.imageAlt || 'Task image'}
|
| 909 |
+
className="w-full h-auto rounded-lg shadow-md"
|
| 910 |
+
style={{ width: '25%', height: 'auto' }}
|
| 911 |
+
onError={(e) => {
|
| 912 |
+
e.currentTarget.style.display = 'none';
|
| 913 |
+
}}
|
| 914 |
+
/>
|
| 915 |
+
</div>
|
| 916 |
+
{/* Text on the right */}
|
| 917 |
+
<div className="w-full md:w-3/4">
|
| 918 |
+
<p className="text-indigo-900 leading-relaxed text-lg font-source-text">{task.content}</p>
|
| 919 |
+
</div>
|
| 920 |
</div>
|
| 921 |
+
) : (
|
| 922 |
+
// Default layout for other weeks or no image
|
| 923 |
+
<>
|
| 924 |
+
<p className="text-indigo-900 leading-relaxed text-lg font-source-text mb-4">{task.content}</p>
|
| 925 |
+
{task.imageUrl && (
|
| 926 |
+
<div className="mt-4">
|
| 927 |
+
<img
|
| 928 |
+
src={task.imageUrl}
|
| 929 |
+
alt={task.imageAlt || 'Task image'}
|
| 930 |
+
className="w-full max-w-md mx-auto rounded-lg shadow-md"
|
| 931 |
+
onError={(e) => {
|
| 932 |
+
e.currentTarget.style.display = 'none';
|
| 933 |
+
}}
|
| 934 |
+
/>
|
| 935 |
+
</div>
|
| 936 |
+
)}
|
| 937 |
+
</>
|
| 938 |
)}
|
| 939 |
</>
|
| 940 |
)}
|