Skip to content

Commit b9b125b

Browse files
committed
refactor pitch slider
1 parent 82bf62e commit b9b125b

File tree

4 files changed

+238
-233
lines changed

4 files changed

+238
-233
lines changed

css/activity.css

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,44 @@ table {
535535
margin-left: 53px;
536536
}
537537

538+
#sliderDiv {
539+
position: absolute;
540+
top: 20%;
541+
left: 30%;
542+
background: rgba(255, 255, 255, 0.85) !important;
543+
}
544+
545+
#sliderTableDiv {
546+
position: relative;
547+
left: 0px;
548+
top: 0px;
549+
border: 0 !important;
550+
background: rgba(255, 255, 255, 0.85) !important;
551+
width: 680px;
552+
}
553+
554+
#sliderButtonsDiv {
555+
position: relative;
556+
left: 0px;
557+
top: 0px;
558+
border: 0 !important;
559+
background: rgba(255, 255, 255, 0.85);
560+
}
561+
562+
#sliderOuterDiv {
563+
position: absolute;
564+
left: 0px;
565+
top: 0px;
566+
right: 5em;
567+
overflow-y:auto;
568+
overflow-x:none;
569+
background: rgba(255, 255, 255, 0.85);
570+
}
571+
572+
#sliderInnerDiv {
573+
overflow-x:auto;
574+
}
575+
538576
.headcol {
539577
position:absolute;
540578
left: 1px;
@@ -573,37 +611,6 @@ table {
573611
overflow-y: scroll !important;
574612
}
575613

576-
#pitchSliderDiv {
577-
position: absolute;
578-
top: 20%;
579-
left: 30%;
580-
border-style: solid;
581-
border: 0 !important;
582-
background: rgba(255, 255, 255, 0.85);
583-
-webkit-user-select: none;
584-
overflow-y: scroll !important;
585-
}
586-
587-
#moveUpSliderDiv {
588-
position: absolute;
589-
top: 66%;
590-
left: 30%;
591-
border-style: solid;
592-
border: 0 !important;
593-
background: rgba(255, 255, 255, 0.85);
594-
-webkit-user-select: none;
595-
}
596-
597-
#moveDownSliderDiv {
598-
position: absolute;
599-
top: 74%;
600-
left: 30%;
601-
border-style: solid;
602-
border: 0 !important;
603-
background: rgba(255, 255, 255, 0.85);
604-
-webkit-user-select: none;
605-
}
606-
607614
#sliderInCell {
608615
position: absolute;
609616
}

index.html

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -104,23 +104,6 @@
104104
$("#pitchdrummatrix").draggable();
105105
});
106106

107-
$(function() {
108-
$('#pitchSliderDiv').draggable({
109-
drag: function() {
110-
jQuery('#moveUpSliderDiv').css('left', jQuery(this).position().left);
111-
jQuery('#moveUpSliderDiv').css('top', jQuery(this).position().top + $(window).innerWidth/4.4);
112-
jQuery('#moveDownSliderDiv').css('left', jQuery(this).position().left);
113-
jQuery('#moveDownSliderDiv').css('top', jQuery(this).position().top + $(window).innerWidth/3.8);
114-
},
115-
stop: function(){
116-
jQuery('#moveUpSliderDiv').css('left', jQuery(this).position().left);
117-
jQuery('#moveUpSliderDiv').css('top', jQuery(this).position().top + $(window).innerWidth/4.4);
118-
jQuery('#moveDownSliderDiv').css('left', jQuery(this).position().left);
119-
jQuery('#moveDownSliderDiv').css('top', jQuery(this).position().top + $(window).innerWidth/3.8);
120-
}
121-
});
122-
});
123-
124107
$(function() {
125108
$("#statusmatrix").draggable();
126109
});
@@ -315,6 +298,14 @@ <h2 id="planetWorldwide"></h2>
315298
</div>
316299
</div>
317300

301+
<div id="sliderDiv" draggable="false">
302+
<div id="sliderButtonsDiv">
303+
</div>
304+
305+
<div id="sliderTableDiv">
306+
</div>
307+
</div>
308+
318309
<div id="pitchSliderDiv" style="visibility:hidden">
319310
</div>
320311

js/palette.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1920,7 +1920,7 @@ function Palette(palettes, name) {
19201920
const PERFECT8OBJ = [[0, 'perfectx', this.protoContainers[blkname].x - paletteBlocks.stage.x, this.protoContainers[blkname].y - paletteBlocks.stage.y, [null, 1, 2, null, 3]], [1, ['number', {'value': 8}], 0, 0, [0]], [2, ['number', {'value': 0}], 0, 0, [0]], [3, 'hidden', 0, 0, [0, null]]];
19211921
const PERFECTOBJ = [[0, 'perfectx', this.protoContainers[blkname].x - paletteBlocks.stage.x, this.protoContainers[blkname].y - paletteBlocks.stage.y, [null, 1, 2, null, 3]], [1, ['number', {'value': 5}], 0, 0, [0]], [2, ['number', {'value': 0}], 0, 0, [0]], [3, 'hidden', 0, 0, [0, null]]];
19221922
const PITCHDRUMMATRIXOBJ = [[0, 'pitchdrummatrix', this.protoContainers[blkname].x - paletteBlocks.stage.x, this.protoContainers[blkname].y - paletteBlocks.stage.y, [null, 1, 12]], [1, 'pitch', 0, 0, [0, 2, 3, 4]], [2, ['solfege', {'value': 'sol'}], 0, 0, [1]], [3, ['number', {'value': 4}], 0, 0, [1]], [4, 'pitch', 0, 0, [1, 5, 6, 7]], [5, ['solfege', {'value': 'mi'}], 0, 0, [4]], [6, ['number', {'value': 4}], 0, 0, [4]], [7, 'pitch', 0, 0, [4, 8, 9, 10]], [8, ['solfege', {'value': 're'}], 0, 0, [7]], [9, ['number', {'value': 4}], 0, 0, [7]], [10, 'playdrum', 0, 0, [7, 11, null]], [11, ['drumname', {'value': _(DEFAULTDRUM)}], 0, 0, [10]], [12, 'hiddennoflow', 0, 0, [0, null]]];
1923-
const PITCHSLIDEROBJ = [[0, 'pitchslider', this.protoContainers[blkname].x - paletteBlocks.stage.x, this.protoContainers[blkname].y - paletteBlocks.stage.y, [null, 1, 3]], [1, 'hertz', 0, 0, [0, 2, null]], [2, ['number', {'value': 220}], 0, 0, [1]], [3, 'hiddennoflow', 0, 0, [0, null]]];
1923+
const PITCHSLIDEROBJ = [[0, 'pitchslider', this.protoContainers[blkname].x - paletteBlocks.stage.x, this.protoContainers[blkname].y - paletteBlocks.stage.y, [null, 1, 3]], [1, 'hertz', 0, 0, [0, 2, null]], [2, ['number', {'value': 392}], 0, 0, [1]], [3, 'hiddennoflow', 0, 0, [0, null]]];
19241924
const PITCHSTAIRCASEOBJ = [[0, 'pitchstaircase', this.protoContainers[blkname].x - paletteBlocks.stage.x, this.protoContainers[blkname].y - paletteBlocks.stage.y, [null, 1, 4]], [1, 'pitch', 0, 0, [0, 2, 3, null]], [2, ['solfege', {'value': 'sol'}], 0, 0, [1]], [3, ['number', {'value': 3}], 0, 0, [1]], [4, 'hiddennoflow', 0, 0, [0, null]]];
19251925
const PLAYDRUMOBJ = [[0, 'playdrum', this.protoContainers[blkname].x - paletteBlocks.stage.x, this.protoContainers[blkname].y - paletteBlocks.stage.y, [null, 1, null]], [1, ['drumname', {'value': _(DEFAULTDRUM)}], 0, 0, [0]]];
19261926
const PLUCKOBJ = [[0, 'pluck', this.protoContainers[blkname].x - paletteBlocks.stage.x, this.protoContainers[blkname].y - paletteBlocks.stage.y, [null, null, 1]], [1, 'hidden', 0, 0, [0, null]]];

0 commit comments

Comments
 (0)