0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-22 09:17:56 +01:00

Merge branch 'feature/printerdriver' of github.com:Doodle3D/doodle3d-client into feature/printerdriver

This commit is contained in:
Rick Companje 2013-10-29 23:26:26 +01:00
commit 1da8ff05d0
14 changed files with 149 additions and 94 deletions

View File

@ -68,7 +68,8 @@ function initButtonBehavior() {
e.preventDefault(); e.preventDefault();
clearInterval(btnOopsInterval); clearInterval(btnOopsInterval);
redrawDoodle(true); redrawDoodle(true);
redrawPreview(); renderToImageDataPreview();
// redrawPreview();
} }
btnOops.on('touchstart', function(e) { startOops(e); }); btnOops.on('touchstart', function(e) { startOops(e); });
btnOops.on('touchend', function(e) { stopOops(e); }); btnOops.on('touchend', function(e) { stopOops(e); });
@ -78,17 +79,19 @@ function initButtonBehavior() {
function startMoveUp(e) { function startMoveUp(e) {
e.preventDefault(); e.preventDefault();
// console.log("btnMoveUp mouse down"); // console.log("btnMoveUp mouse down");
previewUp(true); if (_points.length > 1) {
clearInterval(btnMoveUpInterval);
btnMoveUpInterval = setInterval( function() {
previewUp(true); previewUp(true);
}, 1000/30); clearInterval(btnMoveUpInterval);
btnMoveUpInterval = setInterval( function() {
previewUp(true);
}, 1000/30);
}
} }
function stopMoveUp(e) { function stopMoveUp(e) {
e.preventDefault(); e.preventDefault();
console.log("btnMoveUp mouse up"); // console.log("btnMoveUp mouse up");
clearInterval(btnMoveUpInterval); clearInterval(btnMoveUpInterval);
previewUp(); if (_points.length > 1) previewUp();
} }
btnMoveUp.mousedown(function(e) { startMoveUp(e) }); btnMoveUp.mousedown(function(e) { startMoveUp(e) });
btnMoveUp.mouseup(function(e) { stopMoveUp(e) }); btnMoveUp.mouseup(function(e) { stopMoveUp(e) });
@ -98,17 +101,19 @@ function initButtonBehavior() {
function startMoveDown(e) { function startMoveDown(e) {
e.preventDefault(); e.preventDefault();
// console.log("btnMoveDown mouse down"); // console.log("btnMoveDown mouse down");
previewDown(true); if (_points.length > 1) {
clearInterval(btnMoveDownInterval);
btnMoveDownInterval = setInterval( function() {
previewDown(true); previewDown(true);
}, 1000/30); clearInterval(btnMoveDownInterval);
btnMoveDownInterval = setInterval( function() {
previewDown(true);
}, 1000/30);
}
} }
function stopMoveDown(e) { function stopMoveDown(e) {
e.preventDefault(); e.preventDefault();
console.log("btnMoveDown mouse up"); // console.log("btnMoveDown mouse up");
clearInterval(btnMoveDownInterval); clearInterval(btnMoveDownInterval);
previewDown(); if (_points.length > 1) previewDown();
} }
btnMoveDown.mousedown(function(e) { startMoveDown(e) }); btnMoveDown.mousedown(function(e) { startMoveDown(e) });
btnMoveDown.mouseup(function(e) { stopMoveDown(e) }); btnMoveDown.mouseup(function(e) { stopMoveDown(e) });
@ -118,17 +123,19 @@ function initButtonBehavior() {
function startTwistLeft(e) { function startTwistLeft(e) {
e.preventDefault(); e.preventDefault();
// console.log("btnTwistLeft mouse down"); // console.log("btnTwistLeft mouse down");
previewTwistLeft(true); if (_points.length > 1) {
clearInterval(btnTwistLeftInterval);
btnTwistLeftInterval = setInterval( function() {
previewTwistLeft(true); previewTwistLeft(true);
}, 1000/30); clearInterval(btnTwistLeftInterval);
btnTwistLeftInterval = setInterval( function() {
previewTwistLeft(true);
}, 1000/30);
}
} }
function stopTwistLeft(e) { function stopTwistLeft(e) {
e.preventDefault(); e.preventDefault();
// console.log("btnTwistLeft mouse up"); // console.log("btnTwistLeft mouse up");
clearInterval(btnTwistLeftInterval); clearInterval(btnTwistLeftInterval);
previewTwistLeft(); if (_points.length > 1) previewTwistLeft();
} }
btnTwistLeft.mousedown(function(e) { startTwistLeft(e) }); btnTwistLeft.mousedown(function(e) { startTwistLeft(e) });
btnTwistLeft.mouseup(function(e) { stopTwistLeft(e) }); btnTwistLeft.mouseup(function(e) { stopTwistLeft(e) });
@ -138,17 +145,19 @@ function initButtonBehavior() {
function startTwistRight(e) { function startTwistRight(e) {
e.preventDefault(); e.preventDefault();
// console.log("btnTwistRight mouse down"); // console.log("btnTwistRight mouse down");
previewTwistRight(true); if (_points.length > 1) {
clearInterval(btnTwistRightInterval);
btnTwistRightInterval = setInterval( function() {
previewTwistRight(true); previewTwistRight(true);
}, 1000/30); clearInterval(btnTwistRightInterval);
btnTwistRightInterval = setInterval( function() {
previewTwistRight(true);
}, 1000/30);
}
} }
function stopTwistRight(e) { function stopTwistRight(e) {
e.preventDefault(); e.preventDefault();
// console.log("btnTwistRight mouse up"); // console.log("btnTwistRight mouse up");
clearInterval(btnTwistRightInterval); clearInterval(btnTwistRightInterval);
previewTwistRight(); if (_points.length > 1) previewTwistRight();
} }
btnTwistRight.mousedown(function(e) { startTwistRight(e) }); btnTwistRight.mousedown(function(e) { startTwistRight(e) });
btnTwistRight.mouseup(function(e) { stopTwistRight(e) }); btnTwistRight.mouseup(function(e) { stopTwistRight(e) });
@ -168,11 +177,16 @@ function initButtonBehavior() {
// console.log("btnSettings touchend"); // console.log("btnSettings touchend");
// }); // });
btnInfo.mouseup(function(e) { // 29-okt-2013 - we're not doing help for smartphones at the moment
e.preventDefault(); if (clientInfo.isSmartphone) {
console.log("btnInfo mouse up"); btnInfo.addClass("disabled");
if (!clientInfo.isSmartphone) helpTours.startTour(helpTours.WELCOMETOUR); } else {
}); btnInfo.mouseup(function(e) {
e.preventDefault();
console.log("btnInfo mouse up");
helpTours.startTour(helpTours.WELCOMETOUR);
});
}
// DEBUG // DEBUG
/* /*
@ -266,6 +280,9 @@ function resetPreview() {
previewCtx.clearRect(0,0,canvas.width, canvas.height); previewCtx.clearRect(0,0,canvas.width, canvas.height);
previewCtx.restore(); previewCtx.restore();
// also make new Image, otherwise the previously cached preview can be redrawn with move up/down or twist left/right
doodleImageCapture = new Image();
// reset height and rotation to default values // reset height and rotation to default values
numLayers = previewDefaults.numLayers; // current number of preview layers numLayers = previewDefaults.numLayers; // current number of preview layers
rStep = previewDefaults.rotation; // Math.PI/180; //Math.PI/40; // rStep = previewDefaults.rotation; // Math.PI/180; //Math.PI/40; //

View File

@ -172,7 +172,7 @@ function clearDoodle() {
function redrawDoodle(recalcBoundsAndTransforms) { function redrawDoodle(recalcBoundsAndTransforms) {
if (recalcBoundsAndTransforms == undefined) recalcBoundsAndTransforms = false; if (recalcBoundsAndTransforms == undefined) recalcBoundsAndTransforms = false;
console.log("f:redrawDoodle() >> recalcBoundsAndTransforms = " + recalcBoundsAndTransforms); // console.log("f:redrawDoodle() >> recalcBoundsAndTransforms = " + recalcBoundsAndTransforms);
if (recalcBoundsAndTransforms == true) { if (recalcBoundsAndTransforms == true) {
doodleBounds = [-1, -1, -1, -1]; // left, top, right, bottom doodleBounds = [-1, -1, -1, -1]; // left, top, right, bottom

View File

@ -13,7 +13,7 @@ function doOnResize() {
canvasWidth = canvas.width; canvasWidth = canvas.width;
canvasHeight = canvas.height; canvasHeight = canvas.height;
console.log(" preview.width: " + preview.width + ", $preview.width(): " + $preview.width()); // console.log(" preview.width: " + preview.width + ", $preview.width(): " + $preview.width());
calcPreviewCanvasProperties(); calcPreviewCanvasProperties();
@ -22,7 +22,6 @@ function doOnResize() {
redrawDoodle(); redrawDoodle();
redrawPreview(); redrawPreview();
} }
function initLayouting() { function initLayouting() {

View File

@ -353,6 +353,8 @@
// detect phones with media queries if supported. // detect phones with media queries if supported.
is_phone : function () { is_phone : function () {
return false; // 2013-10-29 Adriaan Wormgoor - hard-falsed this
if (Modernizr) { if (Modernizr) {
return Modernizr.mq('only screen and (max-width: 767px)'); return Modernizr.mq('only screen and (max-width: 767px)');
} }

View File

@ -33,12 +33,17 @@ function initPreviewRendering() {
previewCtx_tmp = preview_tmp.getContext('2d'); previewCtx_tmp = preview_tmp.getContext('2d');
// doodleImageCapture = new Image();
calcPreviewCanvasProperties(); calcPreviewCanvasProperties();
redrawPreview(); redrawPreview();
// needed to
// doodleImageCapture = new Image();
} }
function calcPreviewCanvasProperties() { function calcPreviewCanvasProperties() {
console.log("f:calcPreviewCanvasProperties()"); // console.log("f:calcPreviewCanvasProperties()");
globalScale = preview.width / canvasWidth; globalScale = preview.width / canvasWidth;
layerCX = (canvasWidth / 2) * globalScale; // defined in canvasDrawing_v01.js layerCX = (canvasWidth / 2) * globalScale; // defined in canvasDrawing_v01.js
@ -226,7 +231,7 @@ function renderToImageDataPreview() {
// it is assumed that the preview has been rendered to an Image object, which will be used to draw the preview with (much better performance) // it is assumed that the preview has been rendered to an Image object, which will be used to draw the preview with (much better performance)
function redrawRenderedPreview(redrawLess) { function redrawRenderedPreview(redrawLess) {
if (redrawLess == undefined) redrawLess = false; if (redrawLess == undefined) redrawLess = false;
console.log("f:redrawRenderedPreview()"); // console.log("f:redrawRenderedPreview()");
previewCtx.clearRect(0, 0, preview.width, preview.height); previewCtx.clearRect(0, 0, preview.width, preview.height);
previewCtx.lineWidth = strokeWidth; previewCtx.lineWidth = strokeWidth;

View File

@ -3,6 +3,8 @@
GLOBAL CONTAINER GLOBAL CONTAINER
*/ */
body { body {
background-color: #fcfcfc; background-color: #fcfcfc;
user-select: none; /* disable cut copy paste */ user-select: none; /* disable cut copy paste */
@ -110,6 +112,13 @@ img {
} }
// http://blogs.msdn.com/b/askie/archive/2013/01/06/how-to-implement-the-ms-touch-action-none-property-to-disable-double-tap-zoom-on-touch-devices.aspx
//a, input, button {
// -ms-touch-action: none !important;
//}
/* /*

View File

@ -80,7 +80,7 @@
box-shadow: 0 2px 5px rgba(37, 37, 37, 0.35); box-shadow: 0 2px 5px rgba(37, 37, 37, 0.35);
transition: right .40s cubic-bezier(0.68, -0.55, 0.265, 1.55); transition: right .40s cubic-bezier(0.68, -0.55, 0.265, 1.55);
right: -60%; right: -70%;
margin: 5% 0%; margin: 5% 0%;
} }
@ -126,7 +126,7 @@
box-shadow: 0 2px 5px rgba(37, 37, 37, 0.35); box-shadow: 0 2px 5px rgba(37, 37, 37, 0.35);
transition: right .50s cubic-bezier(0.68, -0.55, 0.265, 1.55); transition: right .50s cubic-bezier(0.68, -0.55, 0.265, 1.55);
right: -55%; right: -65%;
} }
#thermometerCanvas { #thermometerCanvas {

View File

@ -31,20 +31,6 @@
padding: 10px 10px 15px 15px; padding: 10px 10px 15px 15px;
} }
// Mobile
//@media only screen and (max-width: 767px) {
// .joyride-tip-guide {
// width: 95% !important;
// -moz-border-radius: 0;
// -webkit-border-radius: 0;
// border-radius: 0;
// left: 2.5% !important;
// }
// .joyride-tip-guide-wrapper {
// width: 100%;
// }
//}
/* Add a little css triangle pip, older browser just miss out on the fanciness of it */ /* Add a little css triangle pip, older browser just miss out on the fanciness of it */
.joyride-tip-guide span.joyride-nub { .joyride-tip-guide span.joyride-nub {
@ -144,7 +130,7 @@
.joyride-tip-guide { .joyride-tip-guide {
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
line-height: 1.25; line-height: 1.25em;
margin: 0; margin: 0;
font-weight: bold; font-weight: bold;
// color: #2DDF34; // color: #2DDF34;
@ -153,20 +139,20 @@
} }
} }
.joyride-tip-guide h1 { font-size: 30px; } .joyride-tip-guide h1 { font-size: 1.85em; }
.joyride-tip-guide h2 { font-size: 26px; } .joyride-tip-guide h2 { font-size: 1.7em; }
.joyride-tip-guide h3 { font-size: 22px; } .joyride-tip-guide h3 { font-size: 1.55em; }
.joyride-tip-guide h4 { font-size: 18px; } .joyride-tip-guide h4 { font-size: 1.4em; }
.joyride-tip-guide h5 { font-size: 16px; } .joyride-tip-guide h5 { font-size: 1.25em; }
.joyride-tip-guide h6 { font-size: 14px; } .joyride-tip-guide h6 { font-size: 1.1em; }
.joyride-tip-guide { .joyride-tip-guide {
p { p {
// margin: 0 0 18px 0; // margin: 0 0 18px 0;
margin: 5px 0 25px; margin: 5px 0 25px;
font-size: 14px; font-size: 1.1em;
line-height: 18px; line-height: 1.3em;
} }
a { a {
@ -318,3 +304,33 @@
left: 0; left: 0;
border-radius: 5px; border-radius: 5px;
} }
// Mobile
@media only screen and (max-width: 767px) {
.joyride-tip-guide {
// width: 75% !important;
// border-radius: 0;
p {
margin: 5px 0 18px;
font-size: 1.0em;
}
.joyride-next-tip {
// width: auto;
// padding: 6px 18px 4px;
font-size: 1.0em;
}
h1 { font-size: 1.60em; }
h2 { font-size: 1.48em; }
h3 { font-size: 1.36em; }
h4 { font-size: 1.24em; }
h5 { font-size: 1.12em; }
h6 { font-size: 1.0em; }
}
.joyride-tip-guide-wrapper {
width: 80%;
}
}

View File

@ -1,31 +1,33 @@
#message { #message {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
padding: 0.4em 0.5em; padding: 0.4em 0.5em;
border-radius: 0 0 0 10px; border-radius: 0 0 0 10px;
border: 2px solid #333; border: 2px solid #333;
border-width: 0 0 2px 2px; border-width: 0 0 2px 2px;
font-weight: bold; font-weight: bold;
box-shadow: 0px 2px 6px 0px rgba(16, 16, 16, 0.65); box-shadow: 0px 2px 6px 0px rgba(16, 16, 16, 0.65);
color: #333; color: #333;
white-space:nowrap; white-space:nowrap;
display:none; z-index: 5;
&.error { display:none;
background: #EB313C;
color: #fff; &.error {
} background: #EB313C;
&.warning { color: #fff;
background: #E9A86E; }
} &.warning {
&.notice { background: #E9A86E;
background: #93CAF4; }
} &.notice {
&.info { background: #93CAF4;
background: #97DD8A; }
} &.info {
background: #97DD8A;
}
} }

View File

@ -32,17 +32,20 @@
} }
} }
// sets width for both right and left panel
@mobilePanelsWidth: 92px;
/* /*
LEFT LEFT
*/ */
.leftpanel { .leftpanel {
width: 100px; width: @mobilePanelsWidth;
background-color: #fff; background-color: #fff;
z-index: 50; z-index: 50;
transition: left .3s ease-out; transition: left .3s ease-out;
} }
.hideleft { .hideleft {
left: -101px; left: -(@mobilePanelsWidth+1);
} }
.shadowright { .shadowright {
box-shadow: 2px 0 4px rgba(42, 42, 41, 0.6); box-shadow: 2px 0 4px rgba(42, 42, 41, 0.6);
@ -64,13 +67,13 @@
RIGHT RIGHT
*/ */
.rightpanel { .rightpanel {
width: 100px; width: @mobilePanelsWidth;
background-color: #fff; background-color: #fff;
z-index: 50; z-index: 50;
transition: right .3s ease-out; transition: right .3s ease-out;
} }
.hideright { .hideright {
right: -101px; right: -(@mobilePanelsWidth+1);
} }
.shadowleft { .shadowleft {
box-shadow: -2px 0 4px rgba(42, 42, 41, 0.6); box-shadow: -2px 0 4px rgba(42, 42, 41, 0.6);

View File

@ -7,8 +7,8 @@
} }
.vertImage { .vertImage {
margin: 0px; margin: 0;
padding: 0px; padding: 0;
/*border: 2px solid #f0f;*/ /*border: 2px solid #f0f;*/
max-width: 100%; max-width: 100%;
height: auto; height: auto;

View File

@ -60,6 +60,7 @@
margin: .5%; margin: .5%;
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
-webkit-overflow-scrolling: touch;
border: 1px solid rgb(187, 187, 187); border: 1px solid rgb(187, 187, 187);
border-radius: 5px; border-radius: 5px;
} }

View File

@ -61,9 +61,10 @@
<img class="btnInfo btn" src="img/buttons/btnInfo.png"> <img class="btnInfo btn" src="img/buttons/btnInfo.png">
</div> </div>
<div id="message"></div>
</div> </div>
<div id="message"></div>
<!-- center panel --> <!-- center panel -->
<div class="centerpanel"> <div class="centerpanel">
<div class="logopanel"> <div class="logopanel">

File diff suppressed because one or more lines are too long