Skip to content

Commit

Permalink
Cleanup minor bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfe committed Apr 4, 2019
1 parent 8cd1af0 commit f02ee68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
21 changes: 4 additions & 17 deletions chordbox.js
Expand Up @@ -50,18 +50,16 @@ class ChordBox {
// Size and shift board
this.width = this.params.width * 0.75;
this.height = this.params.height * 0.75;
this.x = this.params.x + this.params.width * 0.15;
this.y = this.params.y + this.params.height * 0.15;

// Initialize scaled-spacing
this.numStrings = this.params.numStrings;
this.numFrets = this.params.numFrets;

this.spacing = this.width / this.numStrings;
this.fretSpacing = this.height / (this.numFrets + 2);

// Add room on sides for finger positions on 1. and 6. string
this.x += this.spacing / 2;
this.y += this.fretSpacing;
this.x = this.params.x + this.params.width * 0.15 + this.spacing / 2;
this.y = this.params.y + this.params.height * 0.15 + this.fretSpacing;

this.metrics = {
circleRadius: this.width / 20,
Expand All @@ -75,21 +73,10 @@ class ChordBox {
this.position = 0;
this.positionText = 0;
this.chord = [];
this.bars = [];
this.barres = [];
this.tuning = ['E', 'A', 'D', 'G', 'B', 'E'];
}

setNumFrets(numFrets) {
this.numFrets = numFrets;
this.fretSpacing = this.height / (this.numFrets + 1);
return this;
}

setPositionText(position) {
this.positionText = position;
return this;
}

drawText(x, y, msg, attrs) {
const textAttrs = {
...{
Expand Down
9 changes: 4 additions & 5 deletions upload.sh
@@ -1,12 +1,11 @@
#!/bin/sh

# This bucket is in the sweartax project
BUCKET=gs://vexflow.com
URL=${BUCKET}/vexchords

echo Building...
echo Building VexChords...
npm run build

echo Uploading Sweartax...
gsutil -h "Cache-control:public,max-age=300" -m cp -a public-read -z js,map,css,html dist/* ${URL}
gsutil -h "Cache-control:public,max-age=300" -m cp -a public-read -z html dist/demo.html ${URL}/index.html
echo Uploading VexChords...
gsutil -h "Cache-control:public,max-age=600" -m cp -a public-read -z js,map,css,html dist/* ${URL}
gsutil -h "Cache-control:public,max-age=600" -m cp -a public-read -z html dist/demo.html ${URL}/index.html

0 comments on commit f02ee68

Please sign in to comment.