Skip to content

Commit f02c212

Browse files
committed
2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave: Translation P.3
1 parent c493c5c commit f02c212

File tree

3 files changed

+34
-34
lines changed
  • 2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/1-behavior-nested-tooltip

3 files changed

+34
-34
lines changed

2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/1-behavior-nested-tooltip/solution.view/index.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<style>
77
body {
88
height: 2000px;
9-
/* the tooltip should work after page scroll too */
9+
/* спливаюча підказка також має працювати після прокручування сторінки */
1010
}
1111

1212
.tooltip {
@@ -49,42 +49,42 @@
4949
<body>
5050

5151

52-
<div data-tooltip="Here is the house interior" id="house">
53-
<div data-tooltip="Here is the roof" id="roof"></div>
52+
<div data-tooltip="Ось – інтер’єр будинку" id="house">
53+
<div data-tooltip="Ось – дах" id="roof"></div>
5454

55-
<p>Once upon a time there was a mother pig who had three little pigs.</p>
55+
<p>Жила-була мама-свиня, у якої було троє поросят.</p>
5656

57-
<p>The three little pigs grew so big that their mother said to them, "You are too big to live here any longer. You must go and build houses for yourselves. But take care that the wolf does not catch you."</p>
57+
<p>Троє поросят виросли такі великі, що їхня мати сказала їм: "Ви занадто великі, щоб жити тут далі. Ви повинні йти і будувати собі будинки. Але бережіть себе, щоб вовк вас не спіймав".</p>
5858

59-
<p>The three little pigs set off. "We will take care that the wolf does not catch us," they said.</p>
59+
<p>Троє поросят рушили. "Будемо берегти один одного, щоб вовк нас не спіймав", - сказали вони.</p>
6060

61-
<p>Soon they met a man. <a href="https://en.wikipedia.org/wiki/The_Three_Little_Pigs" data-tooltip="Read on">Hover over me</a></p>
61+
<p>Незабаром вони зустріли чоловіка.<a href="https://uk.wikipedia.org/wiki/Троє_поросят" data-tooltip="Читайте далі">Наведіть на мене вказівник</a></p>
6262

6363
</div>
6464

6565
<script>
6666
let tooltip;
6767

6868
document.onmouseover = function(event) {
69-
// important: a fast-moving mouse may "jump" right to a child on an annotated node, skipping the parent
70-
// so mouseover may happen on a child.
69+
// важливо: миша, що швидко рухається, може "стрибнути" прямо до дочірнього вузла на анотованому вузлі, пропускаючи батьківського
70+
// тому mouseover може статися на дочірньому елементі.
7171

7272
let anchorElem = event.target.closest('[data-tooltip]');
7373

7474
if (!anchorElem) return;
7575

76-
// show tooltip and remember it
76+
// показати підказку та запам'ятати її
7777
tooltip = showTooltip(anchorElem, anchorElem.dataset.tooltip);
7878
}
7979

8080
document.onmouseout = function() {
81-
// it is possible that mouseout triggered, but we're still inside the element
82-
// (its target was inside, and it bubbled)
83-
// but in this case we'll have an immediate mouseover,
84-
// so the tooltip will be destroyed and shown again
81+
// можливо, спрацював mouseout, але ми все ще всередині елемента
82+
// (target цієї події всередині, і подія спливає)
83+
// але в цьому випадку ми маємо негайне спрацювання події mouseover,
84+
// тому спливаючу підказку буде знищено та показано знову
8585
//
86-
// luckily, the "blinking" won't be visible,
87-
// as both events happen almost at the same time
86+
// на щастя, "миготіння" не буде видно,
87+
// оскільки обидві події відбуваються майже одночасно
8888
if (tooltip) {
8989
tooltip.remove();
9090
tooltip = false;
@@ -101,7 +101,7 @@
101101

102102
let coords = anchorElem.getBoundingClientRect();
103103

104-
// position the tooltip over the center of the element
104+
// розмістити підказку над центром елемента
105105
let left = coords.left + (anchorElem.offsetWidth - tooltipElem.offsetWidth) / 2;
106106
if (left < 0) left = 0;
107107

2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/1-behavior-nested-tooltip/source.view/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<style>
77
body {
88
height: 2000px;
9-
/* the tooltip should work after page scroll too */
9+
/* спливаюча підказка також має працювати після прокручування сторінки */
1010
}
1111

1212
.tooltip {
@@ -49,21 +49,21 @@
4949
<body>
5050

5151

52-
<div data-tooltip="Here is the house interior" id="house">
53-
<div data-tooltip="Here is the roof" id="roof"></div>
52+
<div data-tooltip="Ось – інтер’єр будинку" id="house">
53+
<div data-tooltip="Ось – дах" id="roof"></div>
5454

55-
<p>Once upon a time there was a mother pig who had three little pigs.</p>
55+
<p>Жила-була мама-свиня, у якої було троє поросят.</p>
5656

57-
<p>The three little pigs grew so big that their mother said to them, "You are too big to live here any longer. You must go and build houses for yourselves. But take care that the wolf does not catch you."</p>
57+
<p>Троє поросят виросли такі великі, що їхня мати сказала їм: "Ви занадто великі, щоб жити тут далі. Ви повинні йти і будувати собі будинки. Але бережіть себе, щоб вовк вас не спіймав".</p>
5858

59-
<p>The three little pigs set off. "We will take care that the wolf does not catch us," they said.</p>
59+
<p>Троє поросят рушили. "Будемо берегти один одного, щоб вовк нас не спіймав", - сказали вони.</p>
6060

61-
<p>Soon they met a man. <a href="https://en.wikipedia.org/wiki/The_Three_Little_Pigs" data-tooltip="Read on">Hover over me</a></p>
61+
<p>Незабаром вони зустріли чоловіка.<a href="https://uk.wikipedia.org/wiki/Троє_поросят" data-tooltip="Читайте далі">Наведіть на мене вказівник</a></p>
6262

6363
</div>
6464

6565
<script>
66-
// ...your code...
66+
// ...ваш код...
6767
</script>
6868

6969
</body>

2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/1-behavior-nested-tooltip/task.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ importance: 5
22

33
---
44

5-
# Improved tooltip behavior
5+
# Покращена поведінка спливаючої підказки
66

7-
Write JavaScript that shows a tooltip over an element with the attribute `data-tooltip`. The value of this attribute should become the tooltip text.
7+
Напишіть JavaScript, який покаже спливаючу підказку над елементом із атрибутом `data-tooltip`. Значення цього атрибута має стати текстом підказки.
88

9-
That's like the task <info:task/behavior-tooltip>, but here the annotated elements can be nested. The most deeply nested tooltip is shown.
9+
Це як задача <info:task/behavior-tooltip>, але тут елементи можуть бути вкладеними. Ви маєте показати найбільш глибоко вкладену підказку.
1010

11-
Only one tooltip may show up at the same time.
11+
Одночасно може відображатися лише одна підказка.
1212

13-
For instance:
13+
Наприклад:
1414

1515
```html
16-
<div data-tooltip="Hereis the house interior" id="house">
17-
<div data-tooltip="Hereis the roof" id="roof"></div>
16+
<div data-tooltip="Осьінтер’єр будинку" id="house">
17+
<div data-tooltip="Осьдах" id="roof"></div>
1818
...
19-
<a href="https://en.wikipedia.org/wiki/The_Three_Little_Pigs" data-tooltip="Read on">Hover over me</a>
19+
<a href="https://uk.wikipedia.org/wiki/Троє_поросят" data-tooltip="Читайте далі">Наведіть на мене вказівник</a>
2020
</div>
2121
```
2222

23-
The result in iframe:
23+
Результат в iframe:
2424

2525
[iframe src="solution" height=300 border=1]

0 commit comments

Comments
 (0)