-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcardStyles.js
44 lines (35 loc) · 1.01 KB
/
cardStyles.js
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
export default function handleCard (image, passes, index) {
const screenHeight = window.screen.availHeight;
function sound(sound){
var snd = new Audio(`./sounds/${sound}.mp3`)
snd.play()
}
const passesMapping = {
0: (image) => {
image.style.left = '-79px';
},
1: (image) => {
image.style.left = '1px';
},
2: (image) => {
image.style.left = '81px';
},
3: (image) => {
image.style.left = '161px';
},
4: (image) => {
image.style.left = '241px';
},
5: (image) => {
image.style.left = '321px';
},
};
image.style.width = '80px';
sound('card_to_the_table');
passesMapping[passes](image);
image.style.top = `-${screenHeight / 2 - 100}px`;
image.classList.remove(`cards_number-hover`);
image.style.transform = 'none';
image.
players.slice(index, 1);
}