/
index.js
67 lines (64 loc) · 1.84 KB
/
index.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
document.addEventListener('keydown', (event) => {
let key = event.key;
if(key=='ArrowLeft'){
playground.currentSlide--;
if(playground.currentSlide<0){
playground.currentSlide=0;
}
console.log(playground.currentSlide);
return;
}
if(key=='ArrowRight'){
playground.currentSlide++;
if(playground.currentSlide>19){
playground.currentSlide=19;
}
console.log(playground.currentSlide)
return;
}
if(key=='ArrowUp'){
sizeAdjust.zoom=sizeAdjust.zoom+0.1;
console.log(sizeAdjust.zoom);
return;
}
if(key=='ArrowDown'){
sizeAdjust.zoom=sizeAdjust.zoom-0.1;
console.log(sizeAdjust.zoom);
return;
}
});
const playground = new Vue({
el: '#playground',
data:{
currentSlide:0,
},
computed: {
windowShow:function(){return this.currentSlide>=2},
page1:function(){return this.currentSlide===1},
page2:function(){return this.currentSlide===2},
page3:function(){return this.currentSlide===3},
page4:function(){return this.currentSlide===4},
page5:function(){return this.currentSlide===5},
page6:function(){return this.currentSlide===6},
page7:function(){return this.currentSlide===7},
page8:function(){return this.currentSlide===8},
page9:function(){return this.currentSlide===9},
page10:function(){return this.currentSlide===10},
page11:function(){return this.currentSlide===11},
page12:function(){return this.currentSlide===12},
page13:function(){return this.currentSlide===13},
page14:function(){return this.currentSlide===14},
page15:function(){return this.currentSlide===15},
page16:function(){return this.currentSlide===16},
page17:function(){return this.currentSlide===17},
page18:function(){return this.currentSlide===18},
page19:function(){return this.currentSlide===19},
page20:function(){return this.currentSlide===20},
},
})
const sizeAdjust = new Vue({
el: '#sizeAdjust',
data:{
zoom:1
}
})