From f02ee68a852942795f039f56d4d1c27cf3ac85d7 Mon Sep 17 00:00:00 2001 From: 0xFE Date: Thu, 4 Apr 2019 10:37:43 -0400 Subject: [PATCH] Cleanup minor bugs. --- chordbox.js | 21 ++++----------------- upload.sh | 9 ++++----- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/chordbox.js b/chordbox.js index c4243e5..9b54481 100644 --- a/chordbox.js +++ b/chordbox.js @@ -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, @@ -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 = { ...{ diff --git a/upload.sh b/upload.sh index abbc8b5..6b84fdb 100755 --- a/upload.sh +++ b/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