codepens/bug-report-d20/dist/script.js

42 lines
874 B
JavaScript

new Vue({
el: '#app',
data: {
currentFaceIndex: 0,
isRolling: false,
faces: [
'works on my machine',
'try updating',
'but the tests pass',
'did you rebase?',
'huh',
'even on master?',
'are you sure?',
'even in prod?',
'oh, windows?',
'oh, high sierra?',
'what error?',
'🤔',
'every time?',
'i\'m on vacation',
'force refresh',
'no, it should not',
'it\'s a feature',
'don\'t do that then',
'try a fresh clone',
'it sorta works'] },
computed: {
currentFace() {
return this.faces[this.currentFaceIndex];
} },
methods: {
roll() {
if (this.isRolling) return;
this.currentFaceIndex = Math.floor(Math.random() * this.faces.length);
this.isRolling = true;
setTimeout(() => {
this.isRolling = false;
}, 3000);
} } });