mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Previsualizacion recuperada
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
data-bs-target="#accordionPreviewTip" aria-expanded="false"
|
||||
aria-controls="accordionPreviewTip">
|
||||
<h4><?= lang("Presupuestos.preview") ?></h4>
|
||||
</button>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionPreviewTip" class="accordion-collapse collapse show"
|
||||
@ -37,11 +37,7 @@
|
||||
<?= lang("Presupuestos.previewConfiguracionCubierta") ?>
|
||||
</button>
|
||||
</li>
|
||||
<<<<<<< HEAD
|
||||
<li id="tab-preview-esquema-portada" class="nav-item">
|
||||
=======
|
||||
<li id="tab-preview-esquema-cubierta" class="nav-item">
|
||||
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
@ -302,24 +298,10 @@
|
||||
|
||||
} );
|
||||
|
||||
<<<<<<< HEAD
|
||||
$('#tab-preview-esquema-portada').on( "click", function() {
|
||||
|
||||
var altoLib = 400;
|
||||
|
||||
<<<<<<< HEAD
|
||||
var portadaObjeto = {
|
||||
altoLibro:altoLib,
|
||||
anchoLibro:altoLib * 0.67,
|
||||
solapas:0,
|
||||
lomo:altoLib * 0.21};
|
||||
=======
|
||||
=======
|
||||
$('#tab-preview-esquema-cubierta').on( "click", function() {
|
||||
|
||||
var altoLib = 400;
|
||||
|
||||
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
|
||||
var cubiertaObjeto = {
|
||||
altoLibro:220,
|
||||
anchoLibro:170,
|
||||
@ -327,14 +309,8 @@
|
||||
anchoSolapa:70,
|
||||
lomoLibro:11
|
||||
};
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> 594ce37 (Añadido preview cosido tapa blando con solapas)
|
||||
|
||||
previewEsquemaCubierta(portadaObjeto);
|
||||
=======
|
||||
|
||||
previewEsquemaCubierta(cubiertaObjeto);
|
||||
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
|
||||
|
||||
} );
|
||||
|
||||
|
||||
@ -46,13 +46,8 @@ function previewConfiguracionCubierta(cubiertaObj) {
|
||||
formaCubierta.linewidth = 1;
|
||||
|
||||
// Texts
|
||||
<<<<<<< HEAD
|
||||
_previewConfiguracionCubierta.makeText(cubiertaObj.altoLibro, origenCubierta.x + (fullBookWith/2 -25), origenCubierta.y, styles);
|
||||
_previewConfiguracionCubierta.makeText(fullBookWith, origenCubierta.x, origenCubierta.y + (cubiertaObj.altoLibro/2-15) , styles);
|
||||
=======
|
||||
_previewConfiguracionCubierta.makeText(cubiertaObj.altoLibro, origenCubierta.x + (fullBookWith / 2 - 25), origenCubierta.y, styles);
|
||||
_previewConfiguracionCubierta.makeText(fullBookWith, origenCubierta.x, origenCubierta.y + (cubiertaObj.altoLibro / 2 - 15), styles);
|
||||
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
|
||||
|
||||
_previewConfiguracionCubierta.update();
|
||||
|
||||
@ -64,12 +59,6 @@ function previewConfiguracionCubierta(cubiertaObj) {
|
||||
}
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
function previewEsquemaCubierta(portadaObj) {
|
||||
=======
|
||||
=======
|
||||
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
|
||||
function previewEsquemaCubierta(objEC) {
|
||||
|
||||
// Variables locales
|
||||
@ -95,45 +84,15 @@ function previewEsquemaCubierta(objEC) {
|
||||
lomoLibro = anchoSangrado * 0.09;
|
||||
anchoCubierta = (2 * anchoLibro) + (2 * anchoSolapa) + lomoLibro;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> 594ce37 (Añadido preview cosido tapa blando con solapas)
|
||||
=======
|
||||
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
|
||||
|
||||
// Clear the canvas element
|
||||
$('#draw-portada').empty();
|
||||
// Get the element for placing the graphical elements
|
||||
<<<<<<< HEAD
|
||||
var divPortada = document.getElementById('draw-portada');
|
||||
var _previewEsquemaCubierta = new Two({fitted: true}).appendTo(divPortada);
|
||||
// Calculate the center of the canvas element
|
||||
var origenPortada = new Two.Vector(_previewEsquemaCubierta.width / 2, _previewEsquemaCubierta.height / 2);
|
||||
|
||||
<<<<<<< HEAD
|
||||
var solapas = _previewEsquemaCubierta.makeRectangle(
|
||||
origenPortada.x,
|
||||
origenPortada.y,
|
||||
((2 * portadaObj.anchoLibro) + (2 * (portadaObj.solapas + _offsetSolapas)) + portadaObj.lomo),
|
||||
portadaObj.altoLibro);
|
||||
solapas.stroke = '#5FD2B5';
|
||||
solapas.fill = '#5FD2B5';
|
||||
solapas.linewidth = 1;
|
||||
|
||||
var libro = _previewEsquemaCubierta.makeRectangle(
|
||||
origenPortada.x,
|
||||
origenPortada.y,
|
||||
((2 * portadaObj.anchoLibro) + portadaObj.lomo),
|
||||
portadaObj.altoLibro);
|
||||
libro.stroke = '#6997D3';
|
||||
libro.fill = '#6997D3';
|
||||
=======
|
||||
=======
|
||||
var divEC = document.getElementById('draw-portada');
|
||||
var previewEC = new Two({fitted: true}).appendTo(divEC);
|
||||
// Calculate the center of the canvas element
|
||||
var origenEC = new Two.Vector(previewEC.width / 2, previewEC.height / 2);
|
||||
|
||||
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
|
||||
var sangrado = previewEC.makeRectangle(
|
||||
origenEC.x,
|
||||
origenEC.y,
|
||||
@ -186,93 +145,6 @@ function previewEsquemaCubierta(objEC) {
|
||||
((2 * anchoLibro) + lomoLibro),
|
||||
altoLibro);
|
||||
libro.stroke = 'black';
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> 594ce37 (Añadido preview cosido tapa blando con solapas)
|
||||
libro.linewidth = 1;
|
||||
|
||||
var lomo = _previewEsquemaCubierta.makeRectangle(
|
||||
origenPortada.x,
|
||||
origenPortada.y,
|
||||
portadaObj.lomo,
|
||||
portadaObj.altoLibro);
|
||||
lomo.stroke = '#8171D4';
|
||||
lomo.fill = '#8171D4';
|
||||
lomo.linewidth = 1;
|
||||
<<<<<<< HEAD
|
||||
|
||||
_previewEsquemaCubierta.update();
|
||||
|
||||
// Update preview info fields
|
||||
$('#prevLibro').text(portadaObj.anchoLibro + "X" + portadaObj.altoLibro );
|
||||
$('#prevLomo').text(portadaObj.lomo);
|
||||
$('#prevSolapas').text(portadaObj.solapas);
|
||||
=======
|
||||
|
||||
// Cotas
|
||||
var cotaAnchoCubierta = previewEC.makeDobleArrow(
|
||||
origenEC.x - (anchoCubierta / 2),
|
||||
origenEC.y + (altoLibro / 2) + 35,
|
||||
origenEC.x + (anchoCubierta / 2),
|
||||
origenEC.y + (altoLibro / 2) + 35,
|
||||
10);
|
||||
cotaAnchoCubierta.linewidth = 2;
|
||||
var cotaAltoLibro = previewEC.makeDobleArrow(
|
||||
origenEC.x + (anchoCubierta / 2) + 35,
|
||||
origenEC.y + (altoLibro / 2),
|
||||
origenEC.x + (anchoCubierta / 2) + 35,
|
||||
origenEC.y - (altoLibro / 2),
|
||||
10);
|
||||
cotaAltoLibro.linewidth = 2;
|
||||
var cotaLomo = previewEC.makeDobleArrow(
|
||||
origenEC.x - (lomoLibro / 2),
|
||||
origenEC.y + (altoLibro / 3),
|
||||
origenEC.x + (lomoLibro / 2),
|
||||
origenEC.y + (altoLibro / 3),
|
||||
10);
|
||||
cotaLomo.linewidth = 2;
|
||||
var cotaContraportada = previewEC.makeDobleArrow(
|
||||
origenEC.x - (lomoLibro / 2 + anchoLibro),
|
||||
origenEC.y - (altoLibro / 3),
|
||||
origenEC.x - (lomoLibro / 2),
|
||||
origenEC.y - (altoLibro / 3),
|
||||
10);
|
||||
cotaContraportada.linewidth = 2;
|
||||
var cotaPortada = previewEC.makeDobleArrow(
|
||||
origenEC.x + (lomoLibro / 2),
|
||||
origenEC.y - (altoLibro / 3),
|
||||
origenEC.x + (lomoLibro / 2 + anchoLibro),
|
||||
origenEC.y - (altoLibro / 3),
|
||||
10);
|
||||
cotaPortada.linewidth = 2;
|
||||
|
||||
|
||||
// Textos:
|
||||
// Titulos generales
|
||||
let stylesEC = {size: 22, weight: 'bold', family: 'Public Sans'};
|
||||
previewEC.makeText("Portada", origenEC.x + (lomoLibro + anchoLibro) / 2, origenEC.y, stylesEC);
|
||||
previewEC.makeText("Contraportada", origenEC.x - (lomoLibro + anchoLibro) / 2, origenEC.y, stylesEC);
|
||||
let a = previewEC.makeText("Lomo", origenEC.x, origenEC.y, stylesEC).rotation = -Math.PI / 2;
|
||||
// Sangrados
|
||||
let styleSangrado = {size: 10, family: 'Public Sans', style: 'italic', fill: 'red'};
|
||||
previewEC.makeText("Sangrado 3 mm", origenEC.x, origenEC.y + (altoLibro / 2 + 20), styleSangrado);
|
||||
previewEC.makeText("Sangrado 3 mm", origenEC.x, origenEC.y - (altoLibro / 2 + 20), styleSangrado);
|
||||
previewEC.makeText("Sangrado 3 mm", origenEC.x + (lomoLibro / 2 + anchoLibro + anchoSolapa + 20), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
|
||||
previewEC.makeText("Sangrado 3 mm", origenEC.x - (lomoLibro / 2 + anchoLibro + anchoSolapa + 20), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
|
||||
// Cotas
|
||||
previewEC.makeText(objEC.lomoLibro + " mm", origenEC.x, origenEC.y + (altoLibro / 3) + 15, styleCotas);
|
||||
previewEC.makeText(objEC.anchoLibro + " mm", origenEC.x - (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
|
||||
previewEC.makeText(objEC.anchoLibro + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
|
||||
previewEC.makeText(objEC.altoLibro + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro + anchoSolapa) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
|
||||
previewEC.makeText(objEC.anchoCubierta + " mm", origenEC.x, origenEC.y + (altoLibro / 2) + 50, styleCotas);
|
||||
|
||||
previewEC.update();
|
||||
|
||||
// Update preview info fields
|
||||
$('#prevLibro').text(objEC.anchoLibro + "X" + objEC.altoLibro);
|
||||
$('#prevLomo').text(objEC.lomoLibro);
|
||||
$('#prevSolapas').text(objEC.solapas);
|
||||
>>>>>>> 594ce37 (Añadido preview cosido tapa blando con solapas)
|
||||
=======
|
||||
libro.linewidth = 1;
|
||||
|
||||
var lomo = previewEC.makeRectangle(
|
||||
@ -347,7 +219,6 @@ function previewEsquemaCubierta(objEC) {
|
||||
$('#prevLibro').text(objEC.anchoLibro + "X" + objEC.altoLibro);
|
||||
$('#prevLomo').text(objEC.lomoLibro);
|
||||
$('#prevSolapas').text(objEC.solapas);
|
||||
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
|
||||
|
||||
}
|
||||
|
||||
|
||||
89
httpdocs/themes/vuexy/vendor/libs/two/two.min.js
vendored
89
httpdocs/themes/vuexy/vendor/libs/two/two.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user