mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-11-22 01:07:56 +01:00
New Twist and Height buttons
This commit is contained in:
parent
0b908a8f44
commit
e9a2b90483
Binary file not shown.
BIN
img/buttons/btnHeight.xcf
Normal file
BIN
img/buttons/btnHeight.xcf
Normal file
Binary file not shown.
Binary file not shown.
BIN
img/buttons/btnTwist.xcf
Normal file
BIN
img/buttons/btnTwist.xcf
Normal file
Binary file not shown.
@ -3,7 +3,7 @@ var twistIncrement = Math.PI/1800;
|
|||||||
var btnNew, btnPrevious, btnNext, btnOops, btnStop, btnInfo;
|
var btnNew, btnPrevious, btnNext, btnOops, btnStop, btnInfo;
|
||||||
var btnSettings, btnWordArt;
|
var btnSettings, btnWordArt;
|
||||||
var btnToggleEdit, buttonGroupEdit, btnZoom, btnMove, btnRotate;
|
var btnToggleEdit, buttonGroupEdit, btnZoom, btnMove, btnRotate;
|
||||||
var btnToggleVerticalShapes, btnUpDown, btnTwist, btnShape, btnConv, btnStraight, btnSine, btnDiv;
|
var btnToggleVerticalShapes, btnHeight, btnTwist, btnShape, btnConv, btnStraight, btnSine, btnDiv;
|
||||||
var buttonGroupAdd, popupWordArt;
|
var buttonGroupAdd, popupWordArt;
|
||||||
|
|
||||||
var state;
|
var state;
|
||||||
@ -27,29 +27,27 @@ function initButtonBehavior() {
|
|||||||
btnPrevious = $("#btnPrevious");
|
btnPrevious = $("#btnPrevious");
|
||||||
btnNext = $("#btnNext");
|
btnNext = $("#btnNext");
|
||||||
btnSave = $("#btnSave");
|
btnSave = $("#btnSave");
|
||||||
btnWordArt = $("#btnWordArt");
|
buttonGroupAdd = $("#buttonGroupAdd");
|
||||||
btnZoom = $("#btnZoom");
|
btnShape = $("#btnShape");
|
||||||
btnUp = $("#btnUp");
|
btnWordArt = $("#btnWordArt");
|
||||||
btnDown = $("#btnDown");
|
popupWordArt = $("#popupWordArt");
|
||||||
btnMove = $("#btnMove");
|
popupShape = $("#popupShape");
|
||||||
btnTwistLeft = $("#btnTwistLeft");
|
popupMask = $("#popupMask");
|
||||||
btnTwistRight = $("#btnTwistRight");
|
logoPanel = $("#logopanel");
|
||||||
btnShape = $("#btnShape");
|
|
||||||
btnRotate = $("#btnRotate");
|
|
||||||
btnToggleEdit = $("#btnToggleEdit");
|
btnToggleEdit = $("#btnToggleEdit");
|
||||||
buttonGroupEdit = $("#buttonGroupEdit");
|
buttonGroupEdit = $("#buttonGroupEdit");
|
||||||
|
btnZoom = $("#btnZoom");
|
||||||
|
btnMove = $("#btnMove");
|
||||||
|
btnRotate = $("#btnRotate");
|
||||||
|
btnToggleVerticalShapes = $("#btnToggleVerticalShapes");
|
||||||
|
buttonGroupVerticalShapes = $("#buttonGroupVerticalShapes");
|
||||||
|
btnHeight = $("#btnHeight");
|
||||||
|
btnTwist = $("#btnTwist");
|
||||||
btnStraight = $("#btnStraight");
|
btnStraight = $("#btnStraight");
|
||||||
btnDiv = $("#btnDiv");
|
btnDiv = $("#btnDiv");
|
||||||
btnConv = $("#btnConv");
|
btnConv = $("#btnConv");
|
||||||
btnSine = $("#btnSine");
|
btnSine = $("#btnSine");
|
||||||
btnAdd = $("#btnAdd");
|
btnAdd = $("#btnAdd");
|
||||||
btnToggleVerticalShapes = $("#btnToggleVerticalShapes");
|
|
||||||
buttonGroupAdd = $("#buttonGroupAdd");
|
|
||||||
buttonGroupVerticalShapes = $("#buttonGroupVerticalShapes");
|
|
||||||
popupWordArt = $("#popupWordArt");
|
|
||||||
popupShape = $("#popupShape");
|
|
||||||
popupMask = $("#popupMask");
|
|
||||||
logoPanel = $("#logopanel");
|
|
||||||
|
|
||||||
logoPanel.on("onButtonClick", onLogo);
|
logoPanel.on("onButtonClick", onLogo);
|
||||||
btnNew.on("onButtonClick", onBtnNew);
|
btnNew.on("onButtonClick", onBtnNew);
|
||||||
@ -60,10 +58,8 @@ function initButtonBehavior() {
|
|||||||
btnOops.on("onButtonHold", onBtnOops);
|
btnOops.on("onButtonHold", onBtnOops);
|
||||||
// vertical shape buttons
|
// vertical shape buttons
|
||||||
btnToggleVerticalShapes.on("onButtonClick", onBtnToggleVerticalShapes);
|
btnToggleVerticalShapes.on("onButtonClick", onBtnToggleVerticalShapes);
|
||||||
btnUp.on("onButtonHold", onBtnUp);
|
btnHeight.on("onButtonHold", onBtnHeight);
|
||||||
btnDown.on("onButtonHold", onBtnDown);
|
btnTwist.on("onButtonHold", onBtnTwist);
|
||||||
btnTwistLeft.on("onButtonHold", onBtnTwistLeft);
|
|
||||||
btnTwistRight.on("onButtonHold", onBtnTwistRight);
|
|
||||||
btnStraight.on("onButtonClick", onBtnStraight);
|
btnStraight.on("onButtonClick", onBtnStraight);
|
||||||
btnDiv.on("onButtonClick", onBtnDiv);
|
btnDiv.on("onButtonClick", onBtnDiv);
|
||||||
btnConv.on("onButtonClick", onBtnConv);
|
btnConv.on("onButtonClick", onBtnConv);
|
||||||
@ -141,25 +137,21 @@ function initButtonBehavior() {
|
|||||||
function onBtnRotate(e,cursor) {
|
function onBtnRotate(e,cursor) {
|
||||||
var h = btnZoom.height();
|
var h = btnZoom.height();
|
||||||
var multiplier = (h/2-cursor.y)*0.003;
|
var multiplier = (h/2-cursor.y)*0.003;
|
||||||
rotateShape(-multiplier);
|
rotateShape(-multiplier);
|
||||||
//if (cursor.y<25) rotateShape(.1);
|
|
||||||
//else if (cursor.y>55) rotateShape(-.1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBtnUp(e) {
|
function onBtnHeight(e,cursor) {
|
||||||
previewUp(true);
|
var h = btnHeight.height();
|
||||||
|
if(cursor.y < h/2) {
|
||||||
|
previewUp(true);
|
||||||
|
} else {
|
||||||
|
previewDown(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
function onBtnTwist(e,cursor) {
|
||||||
function onBtnDown(e) {
|
var h = btnTwist.height();
|
||||||
previewDown(true);
|
var multiplier = (cursor.y-h/2)*0.0005;
|
||||||
}
|
previewTwist(multiplier,true);
|
||||||
|
|
||||||
function onBtnTwistLeft(e) {
|
|
||||||
previewTwistLeft(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onBtnTwistRight(e) {
|
|
||||||
previewTwistRight(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBtnOops(e) {
|
function onBtnOops(e) {
|
||||||
@ -313,17 +305,19 @@ function previewDown(redrawLess) {
|
|||||||
redrawRenderedPreview(redrawLess);
|
redrawRenderedPreview(redrawLess);
|
||||||
}
|
}
|
||||||
function previewTwistLeft(redrawLess) {
|
function previewTwistLeft(redrawLess) {
|
||||||
if (redrawLess == undefined) redrawLess = false;
|
previewTwist(-twistIncrement,true)
|
||||||
// console.log("f:previewTwistLeft()");
|
|
||||||
if (rStep > -previewRotationLimit) rStep -= twistIncrement;
|
|
||||||
// redrawPreview(redrawLess);
|
|
||||||
redrawRenderedPreview(redrawLess);
|
|
||||||
setSketchModified(true);
|
|
||||||
}
|
}
|
||||||
function previewTwistRight(redrawLess) {
|
function previewTwistRight(redrawLess) {
|
||||||
// console.log("f:previewTwistRight()");
|
previewTwist(twistIncrement,true)
|
||||||
if (rStep < previewRotationLimit) rStep += twistIncrement;
|
}
|
||||||
// redrawPreview(redrawLess);
|
function previewTwist(increment,redrawLess) {
|
||||||
|
console.log("previewTwist: ",increment);
|
||||||
|
if (redrawLess == undefined) redrawLess = false;
|
||||||
|
|
||||||
|
rStep += increment;
|
||||||
|
if(rStep < -previewRotationLimit) rStep = -previewRotationLimit;
|
||||||
|
else if(rStep > previewRotationLimit) rStep = previewRotationLimit;
|
||||||
|
|
||||||
redrawRenderedPreview(redrawLess);
|
redrawRenderedPreview(redrawLess);
|
||||||
setSketchModified(true);
|
setSketchModified(true);
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,8 @@
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
.buttonGroup {
|
.buttonGroup {
|
||||||
background-color: white;
|
/*background-color: white;*/
|
||||||
|
background-color: #fff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border: 3px solid black;
|
border: 3px solid black;
|
||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
@ -185,7 +186,7 @@
|
|||||||
#buttonGroupVerticalShapes {
|
#buttonGroupVerticalShapes {
|
||||||
top: 7px;
|
top: 7px;
|
||||||
left: 8px;
|
left: 8px;
|
||||||
padding-top: 20px;
|
padding: 12px 7px 7px 9px;
|
||||||
width: 65px;
|
width: 65px;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
www/img/buttons/btnHeight.png
Normal file
BIN
www/img/buttons/btnHeight.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
BIN
www/img/buttons/btnTwist.png
Normal file
BIN
www/img/buttons/btnTwist.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
@ -56,18 +56,6 @@
|
|||||||
<canvas id="thermometerCanvas" width="90" height="120"></canvas>
|
<canvas id="thermometerCanvas" width="90" height="120"></canvas>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div id="verticalShapes">
|
|
||||||
<img class="btn btnVertical btnStraight" src="img/buttons/btnStraight.png"/>
|
|
||||||
<img class="btn btnVertical btnDiv" src="img/buttons/btnDiv.png"/>
|
|
||||||
<img class="btn btnVertical btnConv" src="img/buttons/btnConv.png"/>
|
|
||||||
<img class="btn btnVertical btnSine" src="img/buttons/btnSine.png"/>
|
|
||||||
<div><img class="verticalshape straight" src="img/vertical_shape_icons/straight.png" /></div>
|
|
||||||
<div><img class="verticalshape diverging" src="img/vertical_shape_icons/diverging.png" /></div>
|
|
||||||
<div><img class="verticalshape converging" src="img/vertical_shape_icons/converging.png" /></div>
|
|
||||||
<div><img class="verticalshape sinus" src="img/vertical_shape_icons/sinus.png" /></div>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<div id="btnsSettingsInfo">
|
<div id="btnsSettingsInfo">
|
||||||
<img id="btnSettings" class="btn" src="img/buttons/btnSettings.png">
|
<img id="btnSettings" class="btn" src="img/buttons/btnSettings.png">
|
||||||
<img id="btnInfo" class="btn" src="img/buttons/btnInfo.png">
|
<img id="btnInfo" class="btn" src="img/buttons/btnInfo.png">
|
||||||
@ -95,15 +83,14 @@
|
|||||||
<div id="previewContainer">
|
<div id="previewContainer">
|
||||||
<canvas id="preview"></canvas>
|
<canvas id="preview"></canvas>
|
||||||
<div id="buttonGroupVerticalShapes" class="buttonGroup">
|
<div id="buttonGroupVerticalShapes" class="buttonGroup">
|
||||||
<img id="btnTwistLeft" class="btn" src="img/buttons/btnTwistLeft.png" />
|
<img id="btnTwist" class="btn" src="img/buttons/btnTwist.png" />
|
||||||
<img id="btnTwistRight" class="btn" src="img/buttons/btnTwistRight.png" />
|
<img id="btnHeight" class="btn" src="img/buttons/btnHeight.png" />
|
||||||
<img id="btnUp" class="btn" src="img/buttons/btnUp.png" />
|
<div id="verticalShapes">
|
||||||
<img id="btnDown" class="btn" src="img/buttons/btnDown.png" />
|
<img id="btnConv" class="btn" src="img/buttons/btnConv.png" />
|
||||||
<hr>
|
<img id="btnDiv" class="btn" src="img/buttons/btnDiv.png" />
|
||||||
<img id="btnConv" class="btn" src="img/buttons/btnConv.png" />
|
<img id="btnSine" class="btn" src="img/buttons/btnSine.png" />
|
||||||
<img id="btnDiv" class="btn" src="img/buttons/btnDiv.png" />
|
<img id="btnStraight" class="btn" src="img/buttons/btnStraight.png" />
|
||||||
<img id="btnSine" class="btn" src="img/buttons/btnSine.png" />
|
</div>
|
||||||
<img id="btnStraight" class="btn" src="img/buttons/btnStraight.png" />
|
|
||||||
</div>
|
</div>
|
||||||
<img id="btnToggleVerticalShapes" class="btn" src="img/buttons/btnArrowClose.png" />
|
<img id="btnToggleVerticalShapes" class="btn" src="img/buttons/btnArrowClose.png" />
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user