-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
63 lines (56 loc) · 1.89 KB
/
main.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
const app = Vue.createApp({
data() {
return {
i: 0,
theme: ["dark", "light", "neon"],
inUse: false,
}
},
methods: {
toggleOpen() {
this.i++;
if(this.i == 2 ) {
document.body.classList.remove(`${this.theme[0]}`);
this.$refs.slider.style.gridColumnStart = "2";
document.body.classList.add(`${this.theme[1]}`);
}
if(this.i == 4 ) {
document.body.classList.remove(`${this.theme[1]}`);
this.$refs.slider.style.gridColumnStart = "3";
document.body.classList.add(`${this.theme[2]}`);
}
if(this.i > 5 ) {
this.i = 0;
document.body.classList.remove(`${this.theme[2]}`);
this.$refs.slider.style.gridColumnStart = "1";
document.body.classList.add(`${this.theme[0]}`);
}
},
displayNumbers(e) {
this.$refs.screenText.innerText = " ";
this.$refs.screen.innerText += e.target.innerText;
},
sum() {
this.$refs.screenText.innerText = " ";
try {
this.$refs.screen.innerText = eval(this.$refs.screen.innerText);
} catch {
this.$refs.screen.innerText = 'Error';
setTimeout(this.reset, 2000);
}
},
del() {
this.$refs.screenText.innerText = " ";
if(this.$refs.screen.innerText) {
this.$refs.screen.innerText = this.$refs.screen.innerText.slice(0, -1);
}
},
reset(){
this.$refs.screenText.innerText = " ";
if(this.$refs.screen.innerText) {
this.$refs.screen.innerText = "";
}
}
}
})
app.mount("#app");