mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add screenChangingToggle.
This commit is contained in:
parent
526e227b41
commit
3261cf663a
21
src/app.vue
21
src/app.vue
@ -130,6 +130,7 @@
|
||||
{{ width }}x{{ height }}@{{ rate }}
|
||||
</option>
|
||||
</select>
|
||||
<button @click="screenChangingToggle">screenChangingToggle</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="ok">
|
||||
@ -247,6 +248,26 @@
|
||||
this.neko.disconnect()
|
||||
}
|
||||
|
||||
// fast sceen changing test
|
||||
screen_interval = null
|
||||
screenChangingToggle() {
|
||||
if (this.screen_interval === null) {
|
||||
let sizes = this.neko.state.screen.configurations
|
||||
let len = sizes.length
|
||||
|
||||
//@ts-ignore
|
||||
this.screen_interval = setInterval(() => {
|
||||
let { width, height, rate } = sizes[Math.floor(Math.random() * len)]
|
||||
|
||||
this.neko.setScreenSize(width, height, rate)
|
||||
}, 10)
|
||||
} else {
|
||||
//@ts-ignore
|
||||
clearInterval(this.screen_interval)
|
||||
this.screen_interval = null
|
||||
}
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.loaded = true
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user