-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
1,573 additions
and
2,355 deletions.
There are no files selected for viewing
Binary file modified
BIN
+14.6 KB
(700%)
app/assets/images/common/button-background-active-border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+15.2 KB
(1200%)
app/assets/images/common/button-background-disabled-border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+14.6 KB
(730%)
app/assets/images/common/button-background-pressed-border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<!--Src: https://www.npmjs.com/package/vue-pie-chart--> | ||
<template> | ||
<svg :viewBox=viewBox> | ||
<circle | ||
cx=0 | ||
cy=0 | ||
r=1 | ||
stroke="transparent" | ||
:stroke-width="strokeWidth / 5" | ||
/> | ||
<path | ||
v-if=!circle | ||
:d=path | ||
:stroke=color | ||
:stroke-width="strokeWidth / 5" | ||
:opacity=opacity | ||
/> | ||
<circle | ||
v-if=circle | ||
cx=0 | ||
cy=0 | ||
r=1 | ||
:stroke=color | ||
:stroke-width="strokeWidth / 5" | ||
:opacity=opacity | ||
/> | ||
<text | ||
x=0 y=0 | ||
text-anchor=middle | ||
alignment-baseline=middle | ||
:style=labelStyle() | ||
> | ||
{{label || _label}} | ||
</text> | ||
<text | ||
x=0 :y="width / 10" | ||
text-anchor=middle | ||
alignment-baseline=middle | ||
:style=labelStyle(true) | ||
> | ||
{{labelSmall}} | ||
</text> | ||
</svg> | ||
</template> | ||
|
||
<script> | ||
module.exports = Vue.extend({ | ||
name: 'pie-chart', | ||
props: { | ||
ratio: Number, | ||
percent: { | ||
type: Number, | ||
default: 42 | ||
}, | ||
strokeWidth: { | ||
type: Number, | ||
default: 1, | ||
validator: (v) => v > 0 && v <= 10 | ||
}, | ||
label: String, | ||
labelSmall: String, | ||
color: { | ||
type: String, | ||
default: '#40a070' | ||
}, | ||
opacity: { | ||
type: Number, | ||
default: 0.7 | ||
} | ||
}, | ||
computed: { | ||
width: function () { | ||
return 2 + this.strokeWidth / 5 | ||
}, | ||
viewBox: function () { | ||
let c = 1 + this.strokeWidth / 10 | ||
let w = this.width | ||
return `${-c} ${-c} ${w} ${w}` | ||
}, | ||
circle: function () { | ||
return this._ratio % 1 === 0 | ||
}, | ||
_ratio: function () { | ||
let r = this.percent / 100 | ||
return isFinite(this.ratio) ? this.ratio : r | ||
}, | ||
_label: function () { | ||
let p = (this._ratio * 100).toFixed(0) | ||
return `${p} %` | ||
}, | ||
arc: function () { | ||
let r = this._ratio // short hand | ||
let deg = 2 * Math.PI * r | ||
let x = 1 * Math.sin(deg) | ||
let y = -1 * Math.cos(deg) | ||
let negative = r < 0 | ||
let large = 0 | ||
// 0 ccw, 1 clock-wise | ||
let rotation = negative ? 0 : 1 | ||
if (negative && x > 0) { | ||
large = 1 | ||
} else if (!negative && x < 0) { | ||
large = 1 | ||
} | ||
return `A 1 1 0 ${large} ${rotation} ${x} ${y}` | ||
}, | ||
path: function () { | ||
return `M 0 -1 ${this.arc}` | ||
} | ||
}, | ||
methods: { | ||
labelStyle: function (small) { | ||
let size = small | ||
? this.width / 13 | ||
: this.width / 10 | ||
return `font-size:${size}pt` | ||
}, | ||
} | ||
}) | ||
|
||
function ratioOK (val) { | ||
return | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
svg path, svg circle { | ||
fill: transparent; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
levelSchema = require('schemas/models/level') | ||
api = require('core/api') | ||
|
||
# TODO: Be explicit about the properties being stored | ||
emptyLevel = _.zipObject(([key, null] for key in _.keys(levelSchema.properties))) | ||
|
||
# This module should eventually include things such as: session, player code, score, thangs, etc | ||
module.exports = { | ||
namespaced: true | ||
state: { | ||
level: emptyLevel | ||
} | ||
mutations: { | ||
updateLevel: (state, updates) -> | ||
_.assign(state.level, $.extend(true, {}, updates)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.