-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplay.js
More file actions
55 lines (42 loc) · 1.78 KB
/
play.js
File metadata and controls
55 lines (42 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'use strict';
(function showPlayArrow() {
const n = document.querySelectorAll('.MusicAlbum').length; /* Количество альбомов */
let hTimer = null,
fTimer = null;
for (let i = 1; i <= n; i++) {
const linkToAnchorMA = document.querySelector('.LinkToAnchorMA' + i);
const playMA = document.querySelector('.PlayMA' + i);
linkToAnchorMA.addEventListener('click', () => {
clearTimeout(fTimer);
clearTimeout(hTimer);
playMA.classList.remove('FadeOut');
playMA.style.visibility = "visible";
playMA.classList.add('FadeIn');
console.log('Выбран альбом №' + i);
for (let k = 1; k <= n; k++) {
if (k == i) continue;
let playMAHidden = document.querySelector('.PlayMA' + k);
playMAHidden.style.visibility = "hidden";
};
fTimer = setTimeout(function() {
playMA.classList.remove('FadeIn');
playMA.classList.add('FadeOut');
const animationTime = parseFloat(getComputedStyle(playMA).animationDuration) * 1000;
hTimer = setTimeout(function() {
playMA.style.visibility = "hidden";
}, animationTime);
}, 1000);
});
};
})();
(function moveOnPlayerCount() {
const centerSection = document.querySelector('.CenterSection');
let counter = 0;
centerSection.addEventListener('mouseout', function(event) {
const player = event.relatedTarget;
if (player && player.matches('iframe[id^="PlayerAlbum"]')) {
counter++;
console.log('Указатель мыши перешёл на плеер, раз: ' + counter);
}
});
})();