lots of changes to switch to vue
This commit is contained in:
parent
5adb8806dc
commit
a0118b0bdf
22 changed files with 582 additions and 920 deletions
36
public/components/PuzzleStatus.vue.js
Normal file
36
public/components/PuzzleStatus.vue.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
"use strict"
|
||||
|
||||
import Time from './../../common/Time.js'
|
||||
|
||||
// ingame component
|
||||
// shows timer, tiles left, etc..
|
||||
// maybe split it up later
|
||||
|
||||
export default {
|
||||
name: 'puzzle-status',
|
||||
template: `
|
||||
<div class="timer">
|
||||
<div>
|
||||
🧩 {{piecesDone}}/{{piecesTotal}}
|
||||
</div>
|
||||
<div>
|
||||
{{icon}} {{durationStr}}
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
`,
|
||||
props: {
|
||||
finished: Boolean,
|
||||
duration: Number,
|
||||
piecesDone: Number,
|
||||
piecesTotal: Number,
|
||||
},
|
||||
computed: {
|
||||
icon () {
|
||||
return this.finished ? '🏁' : '⏳'
|
||||
},
|
||||
durationStr () {
|
||||
return Time.durationStr(this.duration)
|
||||
},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue