manual item upload

This commit is contained in:
Frank John Begornia
2019-05-17 15:55:38 +08:00
parent c39fb0a2a4
commit 30962d3b4e
26 changed files with 960 additions and 98 deletions

View File

@@ -229,19 +229,19 @@
</div>
@if(($template->Type == "Jersey" || $template->Type == "Shirts") && $template->Side == "Front")
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="222px" height="380px" style="margin-top:36px; margin-left: -3px;"></canvas>
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="222px" height="380px" style="margin-top:42px; margin-left: 0px;"></canvas>
@endif
@if(($template->Type == "Jersey" || $template->Type == "Shirts") && $template->Side == "Back")
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="221.107px" height="379.04px" style="margin-top:24px;"></canvas>
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="221.107px" height="379.04px" style="margin-top:16px; margin-left:-1px;"></canvas>
@endif
@if($template->Type == "Shorts" && $template->Side == "Right")
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="157.933px" height="315.863px" style="margin-top:188px; margin-left: 0px;" ></canvas>
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="157.933px" height="315.863px" style="margin-top:175px; margin-left: 0px;" ></canvas>
@endif
@if($template->Type == "Shorts" && $template->Side == "Left")
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="157.933px" height="315.863px" style="margin-top:188px; margin-left: 0px;" ></canvas>
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="157.933px" height="315.863px" style="margin-top:175px; margin-left: 0px;" ></canvas>
@endif
@if($template->Type == "Shirts" && $template->Side == "Right")
@@ -1489,7 +1489,13 @@
canvas = window[$(this).attr('data-canvas-id')];
canvasID = $(this).attr('data-canvas-id');
canvas.calcOffset();
// initCanvas();
initCanvas();
canvas.on('object:moving', function(options) {
console.log('asdasd')
});
// canvas.on('selection:cleared', onDeSelected);
// canvas.on('object:selected', onSelected);
});
//trigger enter ######################################################################
@@ -1592,13 +1598,12 @@
options.target.set({
left: canvas.width / 2 - options.target.getWidth() / 2,
}).setCoords();
// console.log(canvasID.split("_")[2] + "_" +canvasID.split("_")[1] + "_Border")
// $("#"+canvasID.split("_")[2] + "_" +canvasID.split("_")[1] + "_Border").css({ "display" : "" });
document.getElementById(canvasID.split("_")[2] + "_" +canvasID.split("_")[1] + "_Border").setAttribute("display", "");
}
console.log('asdasd')
});
canvas.on('object:rotating', onRotating);
@@ -1707,7 +1712,7 @@
// console.log("Height =", (obj.getScaleY() * obj.getHeight()).toFixed(2));
// console.log("Width = ", (obj.getScaleX() * obj.getWidth()).toFixed(2));
// console.log('left-', obj.left, 'top-', obj.top);
console.log('left-', obj.left, 'top-', obj.top);
// console.log('font-', obj.fontSize);
if(obj != null){
@@ -1942,6 +1947,13 @@
window.addEventListener("keydown", processKeys, false);
// end arrow keys navigations
// window.addEventListener("mousemove", myFunction, false);
// function myFunction(){
// console.log('asda')
// }
//remove object
$(document).on('button click', '.remove', function() {
var object = canvas.getActiveObject();
@@ -2651,7 +2663,7 @@
var defNameShortLeft = new fabric.Text(defaultNumber, {
idNumber:"NumberLeftShorts",
top: 278.35,
top: 235.35,
fontSize: 62.50, // 71.25 for default font size. equivalent 2.5"
//height: fabric.util.parseUnit('1in'),
fill: '#000000',
@@ -2673,7 +2685,7 @@
var defNameShortRight = new fabric.Text(defaultNumber, {
idNumber:"NumberRightShorts",
top: 278.35,
top: 235.35,
fontSize: 62.50, // 71.25 for default font size. equivalent 2.5"
//height: fabric.util.parseUnit('1in'),
fill: '#000000',
@@ -3013,7 +3025,7 @@
}
function getClipartProperties(arrayPathId, randomNumbers) {
console.log(arrayPathId);
// console.log(arrayPathId);
$.ajax({ //create an ajax request to load_page.php
type: "POST",
@@ -3044,7 +3056,7 @@
// END 4TH TAB
// 5TH TAB
// for upload image
// for upload image
document.getElementById('upload-images').onchange = function handleImage(e) {
console.log(event);
var reader = new FileReader();
@@ -3913,8 +3925,8 @@
]
});
}
//################### E N D C O L O R P A L E T T E S #######################//
function myCart(){
$.ajax({ //create an ajax request to load_page.php

View File

@@ -1,50 +1,38 @@
[
[
"rgb(0, 0, 0)",
"rgb(67, 67, 67)",
"rgb(102, 102, 102)",
"rgb(204, 204, 204)",
"rgb(217, 217, 217)",
"rgb(255, 255, 255)"
[
[
"rgb(38, 38, 38)",
"rgb(102, 102, 102)",
"rgb(68, 69, 79)",
"rgb(255, 255, 255)"
],
[
"rgb(152, 0, 0)",
"rgb(255, 0, 0)",
"rgb(255, 153, 0)",
"rgb(255, 255, 0)",
"rgb(0, 255, 0)",
"rgb(0, 255, 255)"
[
"rgb(77, 20, 8)",
"rgb(0, 75, 43)",
"rgb(0, 135, 81)",
"rgb(0, 111, 175)"
],
[
"rgb(74, 134, 232)",
"rgb(0, 0, 255)",
"rgb(153, 0, 255)",
"rgb(255, 0, 255)",
"rgb(230, 184, 175)",
"rgb(244, 204, 204)"
[
"rgb(0, 95, 111)",
"rgb(16, 34, 64)",
"rgb(66, 128, 206)",
"rgb(17, 43, 155)"
],
[
"rgb(252, 229, 205)",
"rgb(255, 242, 204)",
"rgb(217, 234, 211)",
"rgb(208, 224, 227)",
"rgb(201, 218, 248)",
"rgb(207, 226, 243)"
[
"rgb(64, 18, 129)",
"rgb(116, 0, 36)",
"rgb(169, 30, 54)",
"rgb(221, 117, 174)"
],
[
"rgb(217, 210, 233)",
"rgb(234, 209, 220)",
"rgb(221, 126, 107)",
"rgb(234, 153, 153)",
"rgb(249, 203, 156)",
"rgb(255, 229, 153)"
[
"rgb(214, 0, 2)",
"rgb(51, 0, 0)",
"rgb(255, 224, 27)",
"rgb(255, 186, 0)"
],
[
"rgb(182, 215, 168)",
"rgb(162, 196, 201)",
"rgb(164, 194, 244)",
"rgb(159, 197, 232)",
"rgb(180, 167, 214)",
"rgb(213, 166, 189)"
[
"rgb(211, 198, 120)",
"rgb(158, 64, 0)",
"rgb(255, 64, 0)",
"rgb(255, 112, 10)"
]
]
]