Skip to content

Commit bf874a4

Browse files
committed
translate coordinated into arabic
1 parent e29f635 commit bf874a4

8 files changed

Lines changed: 133 additions & 131 deletions

File tree

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Outer corners
1+
# الزوايا الخارجية
22

3-
Outer corners are basically what we get from [elem.getBoundingClientRect()](https://developer.mozilla.org/en-US/docs/DOM/element.getBoundingClientRect).
3+
الزوايا الخارجية هي في الأساس ما نحصل عليه من [elem.getBoundingClientRect ()] (https://developer.mozilla.org/en-US/docs/DOM/element.getBoundingClientRect).
44

5-
Coordinates of the upper-left corner `answer1` and the bottom-right corner `answer2`:
5+
إحداثيات الزاوية العلوية اليسرى `answer1` والزاوية اليمنى السفلى` answer2`:
66

77
```js
88
let coords = elem.getBoundingClientRect();
@@ -11,19 +11,17 @@ let answer1 = [coords.left, coords.top];
1111
let answer2 = [coords.right, coords.bottom];
1212
```
1313

14-
# Left-upper inner corner
14+
# الزاوية الداخلية اليسرى العليا
1515

16-
That differs from the outer corner by the border width. A reliable way to get the distance is `clientLeft/clientTop`:
16+
هذا يختلف عن الزاوية الخارجية بعرض الحدود. طريقة موثوقة للحصول على المسافة هي `clientLeft / clientTop`:
1717

1818
```js
1919
let answer3 = [coords.left + field.clientLeft, coords.top + field.clientTop];
2020
```
2121

22-
# Right-bottom inner corner
23-
24-
In our case we need to substract the border size from the outer coordinates.
25-
26-
We could use CSS way:
22+
# الزاوية الداخلية اليمنى السفلية
23+
في حالتنا ، نحتاج إلى طرح حجم الحدود من الإحداثيات الخارجية.
24+
يمكننا استخدام طريقة CSS:
2725

2826
```js
2927
let answer4 = [
@@ -32,11 +30,12 @@ let answer4 = [
3230
];
3331
```
3432

35-
An alternative way would be to add `clientWidth/clientHeight` to coordinates of the left-upper corner. That's probably even better:
33+
هناك طريقة بديلة تتمثل في إضافة "clientWidth / clientHeight" إلى إحداثيات الزاوية العلوية اليسرى. ربما هذا أفضل:
3634

3735
```js
3836
let answer4 = [
3937
coords.left + elem.clientLeft + elem.clientWidth,
4038
coords.top + elem.clientTop + elem.clientHeight
4139
];
4240
```
41+
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
importance: 5
1+
5
22

33
---
44

5-
# Find window coordinates of the field
5+
# البحث عن إحداثيات النافذة للحقل
66

7-
In the iframe below you can see a document with the green "field".
7+
في iframe أدناه ، يمكنك رؤية مستند يحتوي على "الحقل" الأخضر.
88

9-
Use JavaScript to find window coordinates of corners pointed by with arrows.
9+
استخدم JavaScript للعثور على إحداثيات النوافذ ذات الزوايا المشار إليها بالسهام.
1010

11-
There's a small feature implemented in the document for convenience. A click at any place shows coordinates there.
11+
هناك ميزة صغيرة تم تنفيذها في المستند من أجل الراحة. تظهر نقرة في أي مكان إحداثيات هناك.
1212

1313
[iframe border=1 height=360 src="source" link edit]
1414

15-
Your code should use DOM to get window coordinates of:
15+
يجب أن يستخدم الرمز الخاص بك DOM للحصول على إحداثيات النافذة لـ:
1616

17-
1. Upper-left, outer corner (that's simple).
18-
2. Bottom-right, outer corner (simple too).
19-
3. Upper-left, inner corner (a bit harder).
20-
4. Bottom-right, inner corner (there are several ways, choose one).
17+
1. الزاوية العلوية اليسرى ، (هذا بسيط).
18+
2. الزاوية اليمنى السفلية ، (بسيطة أيضًا).
19+
3. الزاوية اليسرى العليا ، الداخلية (أصعب قليلاً).
20+
4. الزاوية اليمنى السفلية (هناك عدة طرق ، اختر واحدة).
2121

22-
The coordinates that you calculate should be the same as those returned by the mouse click.
22+
يجب أن تكون الإحداثيات التي تحسبها هي نفس الإحداثيات التي تم إرجاعها بواسطة النقر بالماوس.
2323

24-
P.S. The code should also work if the element has another size or border, not bound to any fixed values.
24+
ملاحظة. يجب أن تعمل الشفرة أيضًا إذا كان للعنصر حجم أو حد آخر ، غير مرتبط بأي قيم ثابتة.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
In this task we only need to accurately calculate the coordinates. See the code for details.
1+
في هذه المهمة نحتاج فقط لحساب الإحداثيات بدقة. انظر الرمز للحصول على التفاصيل.
22

3-
Please note: the elements must be in the document to read `offsetHeight` and other properties.
4-
A hidden (`display:none`) or out of the document element has no size.
3+
يرجى ملاحظة: يجب أن تكون العناصر في المستند لقراءة `offsetHeight` وخصائص أخرى.
4+
العنصر المخفي (`display: none`) أو خارج عنصر المستند ليس له حجم.
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
importance: 5
2-
1+
درجة الأهمية: 5
32
---
43

5-
# Show a note near the element
4+
# عرض ملاحظة بالقرب من العنصر
65

7-
Create a function `positionAt(anchor, position, elem)` that positions `elem`, depending on `position` near `anchor` element.
6+
إنشاء وظيفة `positionAt (مرساة ، موضع ، elem)` تضع مواضع `elem` ، اعتمادًا على` position` بالقرب من عنصر `anchor`.
87

9-
The `position` must be a string with any one of 3 values:
10-
- `"top"` - position `elem` right above `anchor`
11-
- `"right"` - position `elem` immediately at the right of `anchor`
12-
- `"bottom"` - position `elem` right below `anchor`
8+
يجب أن يكون "الموضع" عبارة عن سلسلة تحتوي على أي قيمة من 3 قيم:
9+
- `` top '' - ضع `elem` فوق` anchor` مباشرة
10+
- "" right "" - ضع "elem" مباشرة على يمين "anchor"
11+
- "أسفل" "- ضع" elem "أسفل" anchor "مباشرة
1312

14-
It's used inside function `showNote(anchor, position, html)`, provided in the task source code, that creates a "note" element with given `html` and shows it at the given `position` near the `anchor`.
13+
يتم استخدامه داخل الوظيفة `showNote (anchor ، position ، html)` ، المتوفرة في شفرة مصدر المهمة ، والتي تنشئ عنصر "note" مع `html` معينًا وتعرضه في" الموضع "القريب من" anchor ".
1514

16-
Here's the demo of notes:
15+
إليك عرض الملاحظات:
1716

1817
[iframe src="solution" height="350" border="1" link]
18+
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The solution is actually pretty simple:
1+
الحل بسيط للغاية:
22

3-
- Use `position:absolute` in CSS instead of `position:fixed` for `.note`.
4-
- Use the function [getCoords()](info:coordinates#getCoords) from the chapter <info:coordinates> to get document-relative coordinates.
3+
- استخدم "الموضع: مطلق" في CSS بدلاً من "الموضع: ثابت" لـ ". ملاحظة".
4+
- استخدم الوظيفة [getCoords ()] (info: إحداثيات # getCoords) من الفصل <info: إحداثيات> للحصول على إحداثيات نسبية للdocument.
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
importance: 5
2+
الأهمية: 5
23

34
---
45

5-
# Show a note near the element (absolute)
6+
# إظهار ملاحظة بالقرب من العنصر (مطلق)
67

7-
Modify the solution of the [previous task](info:task/position-at) so that the note uses `position:absolute` instead of `position:fixed`.
8+
قم بتعديل حل [المهمة السابقة] (info: task / position-at) بحيث تستخدم الملاحظة "الموضع: مطلق" بدلاً من "الموضع: ثابت".
89

9-
That will prevent its "runaway" from the element when the page scrolls.
10+
وذلك سيمنع "هربه" من العنصر عند تمرير الصفحة.
1011

11-
Take the solution of that task as a starting point. To test the scroll, add the style `<body style="height: 2000px">`.
12+
خذ حل هذه المهمة كنقطة انطلاق. لاختبار التمرير ، أضف النمط `<body style =" height: 2000px ">`.
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
importance: 5
1+
الأهمية: 5
22

33
---
44

5-
# Position the note inside (absolute)
5+
# ضع الملاحظة في الداخل (مطلق)
66

7-
Extend the previous task <info:task/position-at-absolute>: teach the function `positionAt(anchor, position, elem)` to insert `elem` inside the `anchor`.
7+
تمديد المهمة السابقة
8+
<info:task/position-at-absolute>: علم الوظيفة `الموضع (المرساة ، الموضع ، العنصر)` لإدراج `عنصر` داخل` المرساة`.
89

9-
New values for `position`:
10+
القيم الجديدة لـ "الموضع":
1011

11-
- `top-out`, `right-out`, `bottom-out` -- work the same as before, they insert the `elem` over/right/under `anchor`.
12-
- `top-in`, `right-in`, `bottom-in` -- insert `elem` inside the `anchor`: stick it to the upper/right/bottom edge.
12+
- `top-out` و` right-out` و` bottom-out` - تعمل كما كانت من قبل ، حيث تقوم بإدخال` elem` over / right / under `anchor`.
13+
- "أعلى" ، "يمين" ، "أسفل" - أدخل "عنصر" داخل "المرساة": ألصقه بالحافة العلوية / اليمنى / السفلية.
1314

14-
For instance:
15+
على سبيل المثال:
1516

1617
```js
1718
// shows the note above blockquote
@@ -21,8 +22,8 @@ positionAt(blockquote, "top-out", note);
2122
positionAt(blockquote, "top-in", note);
2223
```
2324

24-
The result:
25+
النتائج:
2526

26-
[iframe src="solution" height="310" border="1" link]
27+
[iframe src = "solution" height = "310" border = "1" link]
2728

28-
As the source code, take the solution of the task <info:task/position-at-absolute>.
29+
كرمز المصدر ، خذ حل المهمة <info:task/position-at-absolute>.

0 commit comments

Comments
 (0)