Commit 2f4c317491d77c8ee85a615ec780b3609f8565fa
1 parent
e6d8ee863d
Exists in
master
and in
1 other branch
Fix text design and reposive
Showing 8 changed files with 189 additions and 103 deletions Inline Diff
app/bower_components/fabric-customise-controls/.bower.json
1 | { | 1 | { |
2 | "name": "fabric-customise-controls", | 2 | "name": "fabric-customise-controls", |
3 | "version": "0.1.8", | 3 | "version": "0.1.8", |
4 | "main": "dist/customiseControls.js", | 4 | "main": "dist/customiseControls.js", |
5 | "ignore": [ | 5 | "ignore": [ |
6 | "source", | 6 | "source", |
7 | "spec", | 7 | "spec", |
8 | ".bowerrc", | 8 | ".bowerrc", |
9 | ".gitignore", | 9 | ".gitignore", |
10 | ".jscsrc", | 10 | ".jscsrc", |
11 | "bower.json", | 11 | "bower.json", |
12 | "gruntfile.js", | 12 | "gruntfile.js", |
13 | "package.json", | 13 | "package.json", |
14 | "README.md" | 14 | "README.md" |
15 | ], | 15 | ], |
16 | "authors": [ | 16 | "authors": [ |
17 | "Simon Kunz" | 17 | "Simon Kunz" |
18 | ], | 18 | ], |
19 | "license": "MIT", | 19 | "license": "MIT", |
20 | "dependencies": { | 20 | "dependencies": { |
21 | "fabric": "~1.6.6" | 21 | "fabric": "~1.6.6" |
22 | }, | 22 | }, |
23 | "homepage": "https://github.com/pixolith/fabricjs-customise-controls-extension", | 23 | "homepage": "https://github.com/pixolith/fabricjs-customise-controls-extension", |
24 | "_release": "0.1.8", | 24 | "_release": "0.1.8", |
25 | "_resolution": { | 25 | "_resolution": { |
26 | "type": "version", | 26 | "type": "version", |
27 | "tag": "0.1.8", | 27 | "tag": "0.1.8", |
28 | "commit": "5586eb55027446026f22e086dc4bca8f5fa35f7f" | 28 | "commit": "5586eb55027446026f22e086dc4bca8f5fa35f7f" |
29 | }, | 29 | }, |
30 | "_source": "https://github.com/pixolith/fabricjs-customise-controls-extension.git", | 30 | "_source": "https://github.com/pixolith/fabricjs-customise-controls-extension.git", |
31 | "_target": "^0.1.8", | 31 | "_target": "^0.1.8", |
32 | "_originalSource": "fabric-customise-controls" | 32 | "_originalSource": "fabric-customise-controls", |
33 | "_direct": true | ||
33 | } | 34 | } |
app/images/control-icon/trash.png
3.45 KB
app/scripts/controllers/about.js
1 | define(['app'], function (app) { | 1 | define(['app'], function (app) { |
2 | 'use strict'; | 2 | 'use strict'; |
3 | |||
4 | app.controller('AboutCtrl', function ($scope) { | 3 | app.controller('AboutCtrl', function ($scope) { |
5 | $scope.awesomeThings = [ | 4 | $scope.awesomeThings = [ |
6 | 'HTML5 Boilerplate', | 5 | 'HTML5 Boilerplate', |
7 | 'AngularJS', | 6 | 'AngularJS', |
8 | 'Karma' | 7 | 'Karma' |
9 | ]; | 8 | ]; |
10 | }); | 9 | }); |
11 | }); | 10 | }); |
12 | 11 |
app/scripts/controllers/main.js
1 | define(['app'], function (app) { | 1 | define(['app'], function (app) { |
2 | 'use strict'; | 2 | 'use strict'; |
3 | app.controller('MainCtrl', function ($rootScope, $scope, $timeout, $illustration, $t_shirt) { | 3 | app.controller('MainCtrl', function ($rootScope, $scope, $timeout, $illustration, $t_shirt) { |
4 | // console.log($('nav').width()); | ||
4 | $rootScope.API_URL = 'http://domain.com'; | 5 | $rootScope.API_URL = 'http://domain.com'; |
5 | $scope.designFrameView = 'views/tshirt-design.html?ver='+VERSION; | 6 | $scope.designFrameView = 'views/tshirt-design.html?ver='+VERSION; |
6 | $scope.designPartIllustration = 'views/design_part/illustration.html?ver='+VERSION; | 7 | $scope.designPartIllustration = 'views/design_part/illustration.html?ver='+VERSION; |
7 | $scope.designPartImage = 'views/design_part/image.html?ver='+VERSION; | 8 | $scope.designPartImage = 'views/design_part/image.html?ver='+VERSION; |
8 | $scope.designPartText = 'views/design_part/text.html?ver='+VERSION; | 9 | $scope.designPartText = 'views/design_part/text.html?ver='+VERSION; |
9 | $scope.designPartDefault = 'views/design_part/default.html?ver='+VERSION; | 10 | $scope.designPartDefault = 'views/design_part/default.html?ver='+VERSION; |
10 | 11 | ||
11 | //Action T-Shirt choice color and Back or Front | 12 | //Action T-Shirt choice color and Back or Front |
12 | $scope.tShirtColor = $t_shirt.getTShirtColor(0); | 13 | $scope.tShirtColor = $t_shirt.getTShirtColor(0); |
13 | //Set color name default | 14 | //Set color name default |
14 | var tShirtColorFirstKey = 0; | 15 | var tShirtColorFirstKey = 0; |
15 | $scope.tShirtChoiceBackFrontKey = 'front'; | 16 | $scope.tShirtChoiceBackFrontKey = 'front'; |
16 | $scope.tShirtColorKey = tShirtColorFirstKey; | 17 | $scope.tShirtColorKey = tShirtColorFirstKey; |
17 | $rootScope.tShirtColorCode = $scope.tShirtColor[tShirtColorFirstKey].code; | 18 | $rootScope.tShirtColorCode = $scope.tShirtColor[tShirtColorFirstKey].code; |
18 | $scope.tShirtColorName = $scope.tShirtColor[tShirtColorFirstKey].name; | 19 | $scope.tShirtColorName = $scope.tShirtColor[tShirtColorFirstKey].name; |
19 | $scope.tShirtImgFront = $scope.tShirtColor[tShirtColorFirstKey].img.front; | 20 | $scope.tShirtImgFront = $scope.tShirtColor[tShirtColorFirstKey].img.front; |
20 | $scope.tShirtImgBack = $scope.tShirtColor[tShirtColorFirstKey].img.back; | 21 | $scope.tShirtImgBack = $scope.tShirtColor[tShirtColorFirstKey].img.back; |
21 | $scope.tShirtImg = $scope.tShirtImgFront; | 22 | $scope.tShirtImg = $scope.tShirtImgFront; |
22 | 23 | ||
24 | //review design set position | ||
25 | var _widthPreviewDesign = $('#preview-design').width(); | ||
26 | var _widthTShirtImage = $('.tshirt-image').width(); | ||
27 | console.log(_widthTShirtImage); | ||
28 | console.log(_widthPreviewDesign); | ||
29 | // $('#preview-design').css({width: _widthTShirtImage/2 - 60}); | ||
30 | var leftReviewDesign = _widthTShirtImage/2 - (_widthPreviewDesign/2 - 10); | ||
31 | $('#preview-design').css({left: leftReviewDesign}); | ||
32 | |||
33 | |||
23 | $scope.choiceTShirtColor = function(key) { | 34 | $scope.choiceTShirtColor = function(key) { |
24 | $scope.tShirtColorKey = key; | 35 | $scope.tShirtColorKey = key; |
25 | $rootScope.tShirtColorCode = $scope.tShirtColor[key].code; | 36 | $rootScope.tShirtColorCode = $scope.tShirtColor[key].code; |
26 | $scope.tShirtColorName = $scope.tShirtColor[key].name; | 37 | $scope.tShirtColorName = $scope.tShirtColor[key].name; |
27 | $scope.tShirtImgFront = $scope.tShirtColor[key].img.front; | 38 | $scope.tShirtImgFront = $scope.tShirtColor[key].img.front; |
28 | $scope.tShirtImgBack = $scope.tShirtColor[key].img.back; | 39 | $scope.tShirtImgBack = $scope.tShirtColor[key].img.back; |
29 | if($scope.tShirtChoiceBackFrontKey == 'front') { | 40 | if($scope.tShirtChoiceBackFrontKey == 'front') { |
30 | $scope.tShirtImg = $scope.tShirtImgFront; | 41 | $scope.tShirtImg = $scope.tShirtImgFront; |
31 | } else { | 42 | } else { |
32 | $scope.tShirtImg = $scope.tShirtImgBack; | 43 | $scope.tShirtImg = $scope.tShirtImgBack; |
33 | } | 44 | } |
34 | }; | 45 | }; |
35 | $scope.choiceTShirtBackFront = function(choice) { | 46 | $scope.choiceTShirtBackFront = function(choice) { |
36 | if(choice == 'front') { | 47 | if(choice == 'front') { |
37 | $scope.tShirtImg = $scope.tShirtImgFront; | 48 | $scope.tShirtImg = $scope.tShirtImgFront; |
38 | } else { | 49 | } else { |
39 | $scope.tShirtImg = $scope.tShirtImgBack; | 50 | $scope.tShirtImg = $scope.tShirtImgBack; |
40 | } | 51 | } |
41 | $scope.tShirtChoiceBackFrontKey = choice; | 52 | $scope.tShirtChoiceBackFrontKey = choice; |
42 | }; | 53 | }; |
43 | 54 | ||
44 | 55 | ||
45 | $scope.showDesignTab = function(tab){ | ||
46 | $rootScope.isShowLeftPanel = tab; | ||
47 | switch (tab) { | ||
48 | case 'illustration': { | ||
49 | $scope.IllustrationList = $illustration.getAll(); | ||
50 | $rootScope.outputImage = false; | ||
51 | $scope.illustrationSelectConfig = { | ||
52 | allowClear:true | ||
53 | }; | ||
54 | $timeout(function(){ | ||
55 | $('.illstration-item').tooltip({ | ||
56 | animated: 'fade', | ||
57 | placement: 'bottom', | ||
58 | html: true | ||
59 | }); | ||
60 | // console.log('here'); | ||
61 | },1000); | ||
62 | break; | ||
63 | } | ||
64 | case 'text': { | ||
65 | break; | ||
66 | } | ||
67 | } | ||
68 | }; | ||
69 | 56 | ||
57 | |||
70 | //safeApply | 58 | //safeApply |
71 | $rootScope.safeApply = function(fn) { | 59 | $rootScope.safeApply = function(fn) { |
72 | var phase = this.$root.$$phase; | 60 | var phase = this.$root.$$phase; |
73 | if(phase == '$apply' || phase == '$digest') { | 61 | if(phase == '$apply' || phase == '$digest') { |
74 | if(fn && (typeof(fn) === 'function')) { | 62 | if(fn && (typeof(fn) === 'function')) { |
75 | fn(); | 63 | fn(); |
76 | } | 64 | } |
77 | } else { | 65 | } else { |
78 | this.$apply(fn); | 66 | this.$apply(fn); |
79 | } | 67 | } |
80 | }; | 68 | }; |
81 | 69 | ||
82 | $scope.modalTShirtDesign = function() { | 70 | $scope.modalTShirtDesign = function() { |
83 | $('#tshirt-design').modal( | 71 | $('#tshirt-design').modal( |
84 | { | 72 | { |
85 | backdrop: 'static', | 73 | backdrop: 'static', |
86 | keyboard: false | 74 | keyboard: false |
87 | } | 75 | } |
88 | ); | 76 | ); |
app/scripts/controllers/tshirtdesign.js
1 | define(['app'], function (app) { | 1 | define(['app'], function (app) { |
2 | //'use strict'; | 2 | //'use strict'; |
3 | app.controller('TshirtdesignCtrl', function ($scope, $rootScope, $window, $timeout, $illustration) { | ||
3 | 4 | ||
4 | app.controller('TshirtdesignCtrl', function ($scope, $rootScope, $window, $illustration) { | ||
5 | var canvas = new fabric.Canvas('main-design-container'); | 5 | var canvas = new fabric.Canvas('main-design-container'); |
6 | //Set width and height canvas | ||
7 | var _modalWidth = $('.modal-dialog').width(); | ||
8 | var _windowWidth = window.innerWidth; | ||
9 | if(_windowWidth > 762) { | ||
10 | var _contentCanvasWidth = _modalWidth*8/12 - 100; | ||
11 | } else { | ||
12 | var _contentCanvasWidth = _windowWidth-70; | ||
13 | } | ||
14 | |||
15 | |||
16 | canvas.setWidth(_contentCanvasWidth); | ||
17 | canvas.setHeight(650); | ||
18 | |||
19 | //Custom control | ||
6 | fabric.Object.prototype.transparentCorners = false; | 20 | fabric.Object.prototype.transparentCorners = false; |
7 | fabric.Object.prototype.hasRotatingPoint = false; | 21 | fabric.Object.prototype.hasRotatingPoint = false; |
8 | var ctrVisible = {tl: false, ml:false, bl:false, mb: false, br: true, mr: false, tr: true, mt: true, mtr: false}; | 22 | var ctrVisible = {tl: false, ml:false, bl:false, mb: false, br: true, mr: false, tr: true, mt: true, mtr: false}; |
9 | for(key in ctrVisible) { | 23 | for(key in ctrVisible) { |
10 | fabric.Object.prototype.setControlVisible(key,ctrVisible[key]); | 24 | fabric.Object.prototype.setControlVisible(key,ctrVisible[key]); |
11 | } | 25 | } |
12 | fabric.Object.prototype.customiseCornerIcons({ | 26 | fabric.Object.prototype.customiseCornerIcons({ |
13 | settings: { | 27 | settings: { |
14 | borderColor: '#0000ff', | 28 | borderColor: '#0000ff', |
15 | cornerSize: 25, | 29 | cornerSize: 25, |
16 | cornerShape: 'circle', | 30 | cornerShape: 'circle', |
17 | cornerBackgroundColor: '#0171b4', | 31 | cornerBackgroundColor: '#0171b4', |
18 | cornerPadding: 6 | 32 | cornerPadding: 6 |
19 | }, | 33 | }, |
20 | mt: { | 34 | mt: { |
21 | icon: 'images/control-icon/ok.png' | 35 | icon: 'images/control-icon/trash.png' |
22 | }, | 36 | }, |
23 | br: { | 37 | br: { |
24 | icon: 'images/control-icon/resize.png' | 38 | icon: 'images/control-icon/resize.png' |
25 | }, | 39 | }, |
26 | tr: { | 40 | tr: { |
27 | icon: 'images/control-icon/rotate.png' | 41 | icon: 'images/control-icon/rotate.png' |
28 | } | 42 | } |
29 | }); | 43 | }); |
30 | 44 | ||
31 | fabric.Canvas.prototype.customiseControls({ | 45 | fabric.Canvas.prototype.customiseControls({ |
32 | mt: { | 46 | mt: { |
33 | cursor: 'pointer', | 47 | cursor: 'pointer', |
34 | action: function (e, target) { | 48 | // action: 'remove' |
35 | target.hasControls = false; | 49 | action: function(e, target) { |
36 | target.hasBorders = false; | 50 | currentObj = canvas.getActiveObject(); |
37 | canvas.deactivateAll().renderAll(); | 51 | if(confirm('削除してもよろしいですか?')) { |
38 | setTimeout(function() { | 52 | currentObj.remove(); |
39 | target.hasControls = true; | 53 | } |
40 | target.hasBorders = true; | 54 | |
41 | }, 1); | ||
42 | } | 55 | } |
43 | }, | 56 | }, |
44 | br: { | 57 | br: { |
45 | 58 | ||
46 | }, | 59 | }, |
47 | tr: { | 60 | tr: { |
48 | action: 'rotate', | 61 | action: 'rotate', |
49 | cursor: 'crosshair' | 62 | cursor: 'crosshair' |
50 | } | 63 | } |
51 | }); | 64 | }); |
52 | 65 | ||
53 | canvas.on('after:render', function() { | 66 | canvas.on('after:render', function() { |
54 | // console.log('after render'); | 67 | // console.log('after render'); |
55 | }); | 68 | }); |
56 | canvas.on({ | 69 | canvas.on({ |
57 | 'mouse:up' : mouseUp, | 70 | 'mouse:up' : mouseUp, |
58 | 'object:added' : onIllustrationAdded, | 71 | 'object:added' : onIllustrationAdded, |
59 | 'object:moving' : onIllustrationMoving, | 72 | 'object:moving' : onIllustrationMoving, |
60 | 'object:scaling' : onIllustrationChange, | 73 | 'object:scaling' : onIllustrationChange, |
61 | 'object:rotating' : onIllustrationChange, | 74 | 'object:rotating' : onIllustrationChange, |
62 | 'object:selected' : onObjectSelected, | 75 | 'object:selected' : onObjectSelected, |
63 | 'object:modified' : onIllustrationModifield, | 76 | 'object:modified' : onIllustrationModifield, |
64 | 'selection:cleared' : onObjectOut, | 77 | 'selection:cleared' : onObjectOut, |
65 | }); | 78 | }); |
66 | 79 | ||
67 | var currentObj; | 80 | var currentObj; |
68 | var listObj = []; | 81 | var listObj = []; |
69 | var stateObj = []; | 82 | var stateObj = []; |
70 | var indexCurr = 0; | 83 | var indexCurr = 0; |
71 | var indexCurr2 = 0; | 84 | var indexCurr2 = 0; |
72 | var actionObj = false; | 85 | var actionObj = false; |
73 | var refreshObj = true; | 86 | var refreshObj = true; |
74 | var spacingNum = 0; | 87 | var spacingNum = 0; |
88 | $scope.itemFont = 0; | ||
75 | 89 | ||
76 | function mouseUp(e) { | ||
77 | currentObj = canvas.getActiveObject(); | ||
78 | console.log(currentObj); | ||
79 | currentObj.activate(); | ||
80 | } | ||
81 | 90 | ||
91 | $scope.showDesignTab = function(tab){ | ||
92 | canvas.deactivateAll().renderAll(); | ||
93 | $rootScope.isShowLeftPanel = tab; | ||
94 | switch (tab) { | ||
95 | case 'illustration': { | ||
96 | $scope.IllustrationList = $illustration.getAll(); | ||
97 | $rootScope.outputImage = false; | ||
98 | $scope.illustrationSelectConfig = { | ||
99 | allowClear:true | ||
100 | }; | ||
101 | $timeout(function(){ | ||
102 | $('.illstration-item').tooltip({ | ||
103 | animated: 'fade', | ||
104 | placement: 'bottom', | ||
105 | html: true | ||
106 | }); | ||
107 | // console.log('here'); | ||
108 | },1000); | ||
109 | break; | ||
110 | } | ||
111 | case 'text': { | ||
112 | break; | ||
113 | } | ||
114 | } | ||
115 | }; | ||
116 | $scope.showDesignTab('default'); | ||
117 | |||
82 | 118 | ||
83 | function onIllustrationAdded(options){ | 119 | function onIllustrationAdded(options){ |
84 | var object = options.target; | 120 | var object = options.target; |
85 | // console.log('object:added'); | 121 | // console.log('object:added'); |
86 | 122 | ||
87 | if (actionObj === true) { | 123 | if (actionObj === true) { |
88 | stateObj = [stateObj[indexCurr2]]; | 124 | stateObj = [stateObj[indexCurr2]]; |
89 | listObj = [listObj[indexCurr2]]; | 125 | listObj = [listObj[indexCurr2]]; |
90 | 126 | ||
91 | actionObj = false; | 127 | actionObj = false; |
92 | console.log(stateObj); | 128 | console.log(stateObj); |
93 | indexCurr = 1; | 129 | indexCurr = 1; |
94 | } | 130 | } |
95 | object.saveState(); | 131 | object.saveState(); |
96 | 132 | ||
97 | console.log(object.originalState); | 133 | console.log(object.originalState); |
98 | stateObj[indexCurr] = JSON.stringify(object.originalState); | 134 | stateObj[indexCurr] = JSON.stringify(object.originalState); |
99 | listObj[indexCurr] = object; | 135 | listObj[indexCurr] = object; |
100 | indexCurr++; | 136 | indexCurr++; |
101 | indexCurr2 = indexCurr - 1; | 137 | indexCurr2 = indexCurr - 1; |
102 | refreshObj = true; | 138 | refreshObj = true; |
103 | } | 139 | } |
104 | 140 | ||
105 | function onIllustrationModifield(options){ | 141 | function onIllustrationModifield(options){ |
106 | // | 142 | // |
107 | var pointer = canvas.getPointer(options.e); | 143 | var pointer = canvas.getPointer(options.e); |
108 | if (pointer.x >= 567 && pointer.y >= 620 && pointer.x <= 600 && pointer.y <= 670){ | 144 | if (pointer.x >= 567 && pointer.y >= 620 && pointer.x <= 600 && pointer.y <= 670){ |
109 | canvas.getActiveObject().remove(); | 145 | canvas.getActiveObject().remove(); |
110 | $('.design-content .trash-design img').attr({'src':'images/trash.png'}); | 146 | $('.design-content .trash-design img').attr({'src':'images/trash.png'}); |
111 | return; | 147 | return; |
112 | } | 148 | } |
113 | 149 | ||
114 | // | 150 | // |
115 | var objOffset = canvas.getActiveObject().getBoundingRect(); | 151 | var objOffset = canvas.getActiveObject().getBoundingRect(); |
116 | var cH = canvas.height, cW = canvas.width, H0 = 20, W0 = 20; | 152 | var cH = canvas.height, cW = canvas.width, H0 = 20, W0 = 20; |
117 | //console.log(objOffset,canvas.height,canvas.width); | 153 | //console.log(objOffset,canvas.height,canvas.width); |
118 | if (objOffset.left<W0-objOffset.width || objOffset.left>cW-W0 || objOffset.top<H0-objOffset.height || objOffset.top>cH-H0){ | 154 | if (objOffset.left<W0-objOffset.width || objOffset.left>cW-W0 || objOffset.top<H0-objOffset.height || objOffset.top>cH-H0){ |
119 | if (confirm('削除してもよろしいですか')){ | 155 | if (confirm('削除してもよろしいですか')){ |
120 | canvas.getActiveObject().remove(); | 156 | canvas.getActiveObject().remove(); |
121 | }else{ | 157 | }else{ |
122 | undoCanvas(); | 158 | undoCanvas(); |
123 | return; | 159 | return; |
124 | } | 160 | } |
125 | } | 161 | } |
126 | 162 | ||
127 | var object = options.target; | 163 | var object = options.target; |
128 | // console.log('object:modified'); | 164 | // console.log('object:modified'); |
129 | if (actionObj === true) { | 165 | if (actionObj === true) { |
130 | stateObj = [stateObj[indexCurr2]]; | 166 | stateObj = [stateObj[indexCurr2]]; |
131 | listObj = [listObj[indexCurr2]]; | 167 | listObj = [listObj[indexCurr2]]; |
132 | 168 | ||
133 | actionObj = false; | 169 | actionObj = false; |
134 | console.log(stateObj); | 170 | console.log(stateObj); |
135 | indexCurr = 1; | 171 | indexCurr = 1; |
136 | } | 172 | } |
137 | 173 | ||
138 | object.saveState(); | 174 | object.saveState(); |
139 | 175 | ||
140 | stateObj[indexCurr] = JSON.stringify(object.originalState); | 176 | stateObj[indexCurr] = JSON.stringify(object.originalState); |
141 | listObj[indexCurr] = object; | 177 | listObj[indexCurr] = object; |
142 | indexCurr++; | 178 | indexCurr++; |
143 | indexCurr2 = indexCurr - 1; | 179 | indexCurr2 = indexCurr - 1; |
144 | // console.log(stateObj); | 180 | // console.log(stateObj); |
145 | refreshObj = true; | 181 | refreshObj = true; |
146 | } | 182 | } |
147 | 183 | ||
148 | function onIllustrationChange(options) { | 184 | function onIllustrationChange(options) { |
149 | // options.target.setCoords(); | 185 | // options.target.setCoords(); |
150 | // canvas.forEachObject(function(obj) { | 186 | // canvas.forEachObject(function(obj) { |
151 | // if (obj === options.target) return; | 187 | // if (obj === options.target) return; |
152 | // obj.setOpacity(options.target.intersectsWithObject(obj) ? 0.5 : 1); | 188 | // obj.setOpacity(options.target.intersectsWithObject(obj) ? 0.5 : 1); |
153 | // }); | 189 | // }); |
154 | } | 190 | } |
155 | 191 | ||
156 | function onIllustrationMoving(options) { | 192 | function onIllustrationMoving(options) { |
157 | var pointer = canvas.getPointer(options.e); | 193 | var pointer = canvas.getPointer(options.e); |
158 | if (pointer.x >= 567 && pointer.y >= 620 && pointer.x <= 600 && pointer.y <= 670){ | 194 | if (pointer.x >= 567 && pointer.y >= 620 && pointer.x <= 600 && pointer.y <= 670){ |
159 | $('.design-content .trash-design img').attr({'src':'images/trash-hover.png'}); | 195 | $('.design-content .trash-design img').attr({'src':'images/trash-hover.png'}); |
160 | }else{ | 196 | }else{ |
161 | $('.design-content .trash-design img').attr({'src':'images/trash.png'}); | 197 | $('.design-content .trash-design img').attr({'src':'images/trash.png'}); |
162 | } | 198 | } |
163 | } | 199 | } |
164 | 200 | ||
165 | function onObjectOut() { | 201 | function onObjectOut() { |
166 | delete currentObj; | 202 | delete currentObj; |
167 | $scope.designTextValue = ''; | 203 | $scope.designTextValue = ''; |
168 | } | 204 | } |
169 | 205 | ||
170 | function undoCanvas() { | 206 | function undoCanvas() { |
171 | if (indexCurr <= 0) { | 207 | if (indexCurr <= 0) { |
172 | indexCurr = 0; | 208 | indexCurr = 0; |
173 | return; | 209 | return; |
174 | } | 210 | } |
175 | 211 | ||
176 | if (refreshObj === true) { | 212 | if (refreshObj === true) { |
177 | indexCurr--; | 213 | indexCurr--; |
178 | refreshObj = false; | 214 | refreshObj = false; |
179 | } | 215 | } |
180 | 216 | ||
181 | console.log('undo'); | 217 | console.log('undo'); |
182 | 218 | ||
183 | indexCurr2 = indexCurr - 1; | 219 | indexCurr2 = indexCurr - 1; |
184 | currentObj = listObj[indexCurr2]; | 220 | currentObj = listObj[indexCurr2]; |
185 | if (currentObj){ | 221 | if (currentObj){ |
186 | currentObj.setOptions(JSON.parse(indexCurr[indexCurr2])); | 222 | currentObj.setOptions(JSON.parse(indexCurr[indexCurr2])); |
187 | } | 223 | } |
188 | 224 | ||
189 | indexCurr--; | 225 | indexCurr--; |
190 | currentObj.setCoords(); | 226 | currentObj.setCoords(); |
191 | canvas.renderAll(); | 227 | canvas.renderAll(); |
192 | actionObj = true; | 228 | actionObj = true; |
193 | } | 229 | } |
194 | 230 | ||
195 | function redoCanvas() { | 231 | function redoCanvas() { |
196 | actionObj = true; | 232 | actionObj = true; |
197 | if (indexCurr >= stateObj.length - 1) { | 233 | if (indexCurr >= stateObj.length - 1) { |
198 | return; | 234 | return; |
199 | } | 235 | } |
200 | 236 | ||
201 | console.log('redo'); | 237 | console.log('redo'); |
202 | 238 | ||
203 | indexCurr2 = indexCurr + 1; | 239 | indexCurr2 = indexCurr + 1; |
204 | currentObj = listObj[indexCurr2]; | 240 | currentObj = listObj[indexCurr2]; |
205 | currentObj.setOptions(JSON.parse(indexCurr[indexCurr2])); | 241 | currentObj.setOptions(JSON.parse(indexCurr[indexCurr2])); |
206 | 242 | ||
207 | indexCurr++; | 243 | indexCurr++; |
208 | currentObj.setCoords(); | 244 | currentObj.setCoords(); |
209 | canvas.renderAll(); | 245 | canvas.renderAll(); |
210 | } | 246 | } |
211 | 247 | ||
212 | $scope.canvasClearAll = function(){ | 248 | $scope.canvasClearAll = function(){ |
213 | if (confirm('配置されたすべての文字や画像を消去します')){ | 249 | if (confirm('配置されたすべての文字や画像を消去します')){ |
214 | canvas.clear(); | 250 | canvas.clear(); |
215 | } | 251 | } |
216 | } | 252 | } |
217 | 253 | ||
218 | function onObjectSelected(options) { | 254 | function onObjectSelected(options) { |
219 | var currentObj = options.target; | 255 | var currentObj = options.target; |
220 | //Set default | 256 | |
221 | console.log('selected object'); | ||
222 | // currentObj.hasControls = true; | ||
223 | // currentObj.hasBorders = true; | ||
224 | $scope.typeObject = currentObj.type; | 257 | $scope.typeObject = currentObj.type; |
225 | switch ($scope.typeObject) { | 258 | switch ($scope.typeObject) { |
226 | case 'i-text' : | 259 | case 'i-text' : |
227 | $rootScope.isShowLeftPanel = 'text'; | 260 | $rootScope.isShowLeftPanel = 'text'; |
228 | var text = currentObj.text; | 261 | var text = currentObj.text; |
229 | if(text != '') { | 262 | if(text != '') { |
230 | $scope.designText = text; | 263 | $scope.designText = text; |
231 | $scope.designTextValue = text; | 264 | $scope.designTextValue = text; |
232 | } | 265 | } |
233 | break; | 266 | break; |
234 | 267 | ||
235 | case 'path-group' : | 268 | case 'path-group' : |
236 | $rootScope.isShowLeftPanel = 'illustration'; | 269 | $rootScope.isShowLeftPanel = 'illustration'; |
237 | break; | 270 | break; |
238 | 271 | ||
239 | case 'image': | 272 | case 'image': |
240 | $rootScope.isShowLeftPanel = 'image'; | 273 | $rootScope.isShowLeftPanel = 'image'; |
241 | break; | 274 | break; |
242 | 275 | ||
243 | default : | 276 | default : |
244 | $rootScope.isShowLeftPanel = 'default'; | 277 | $rootScope.isShowLeftPanel = 'default'; |
245 | break; | 278 | break; |
246 | } | 279 | } |
247 | $rootScope.safeApply(); | 280 | $rootScope.safeApply(); |
248 | } | 281 | } |
249 | 282 | ||
250 | // Illustration process | 283 | // Illustration process |
251 | $scope.changeIllustrationCategory = function(currentIllustration){ | 284 | $scope.changeIllustrationCategory = function(currentIllustration){ |
252 | $scope.currentIllustrationCate = $illustration.getList(currentIllustration); | 285 | $scope.currentIllustrationCate = $illustration.getList(currentIllustration); |
253 | //console.log($scope.currentIllustrationCate); | 286 | //console.log($scope.currentIllustrationCate); |
254 | }; | 287 | }; |
255 | 288 | ||
256 | $scope.insertSvg = function(item){ | 289 | $scope.insertSvg = function(item){ |
257 | fabric.loadSVGFromURL(item.path, function(objects, options) { | 290 | fabric.loadSVGFromURL(item.path, function(objects, options) { |
258 | var shape = fabric.util.groupSVGElements(objects, options); | 291 | var shape = fabric.util.groupSVGElements(objects, options); |
259 | //shape.setFill('green'); | 292 | //shape.setFill('green'); |
260 | canvas.add(shape.scale(0.6)); | 293 | canvas.add(shape.scale(0.6)); |
261 | shape.set({ left: 150, top: 200 }).setCoords(); | 294 | shape.set({ left: 150, top: 200 }).setCoords(); |
262 | canvas.renderAll(); | 295 | canvas.renderAll(); |
263 | canvas.setActiveObject(shape); | 296 | canvas.setActiveObject(shape); |
264 | }); | 297 | }); |
265 | }; | 298 | }; |
266 | 299 | ||
267 | // color pattern | 300 | // color pattern |
268 | $scope.listColorPatterns = [ | 301 | $scope.listColorPatterns = [ |
269 | '#000000','#ffff00','#ff6600','#ff0000','#ff6262','#ffa19c','#ff9933','#c45d01','#5d2b03','#ffffcc', | 302 | '#000000','#ffff00','#ff6600','#ff0000','#ff6262','#ffa19c','#ff9933','#c45d01','#5d2b03','#ffffcc', |
270 | '#ffff99','#ffd500','#c0db50','#21a52a','#00663f','#abfcab','#36ffaa','#89eaea','#00938c','#005450', | 303 | '#ffff99','#ffd500','#c0db50','#21a52a','#00663f','#abfcab','#36ffaa','#89eaea','#00938c','#005450', |
271 | '#0badff','#006cff','#839aff','#0410a0','#ffb2ff','#f93fff','#6600ca','#ff6699','#999999','#666666', | 304 | '#0badff','#006cff','#839aff','#0410a0','#ffb2ff','#f93fff','#6600ca','#ff6699','#999999','#666666', |
272 | '#333333' | 305 | '#333333' |
273 | ]; | 306 | ]; |
274 | 307 | ||
275 | $scope.changeColorPattern = function(color){ | 308 | $scope.changeColorPattern = function(color){ |
276 | var obj = canvas.getActiveObject(); | 309 | var obj = canvas.getActiveObject(); |
277 | if (!color){ | 310 | if (!color){ |
278 | color = 'none'; | 311 | color = 'none'; |
279 | } | 312 | } |
280 | if (obj instanceof fabric.PathGroup) { | 313 | if (obj instanceof fabric.PathGroup) { |
281 | obj.getObjects().forEach(function(o) { | 314 | obj.getObjects().forEach(function(o) { |
282 | o.fill = color; | 315 | o.fill = color; |
283 | }); | 316 | }); |
284 | } | 317 | } |
285 | else { | 318 | else { |
286 | obj.fill = color; | 319 | obj.fill = color; |
287 | } | 320 | } |
288 | canvas.renderAll(); | 321 | canvas.renderAll(); |
289 | // if (canvas.getActiveObject()){ | 322 | // if (canvas.getActiveObject()){ |
290 | // canvas.getActiveObject().set("fill", color); | 323 | // canvas.getActiveObject().set("fill", color); |
291 | // canvas.renderAll(); | 324 | // canvas.renderAll(); |
292 | // } | 325 | // } |
293 | }; | 326 | }; |
294 | 327 | ||
295 | //Font | 328 | //Font |
296 | $scope.listFontFamily = [ | 329 | $scope.listFontFamily = [ |
297 | { | 330 | { |
298 | name : 'GN Aki iro Sesami Cookies', | 331 | name : 'GN Aki iro Sesami Cookies', |
299 | slug : 'gn_aki_iro_sesami_cookies', | 332 | slug : 'gn_aki_iro_sesami_cookies', |
300 | }, | 333 | }, |
301 | { | 334 | { |
302 | name : 'GN-Fuyu-iro_Script_Bold', | 335 | name : 'GN-Fuyu-iro_Script_Bold', |
303 | slug : 'gn_fuyu_iro_script_bold' | 336 | slug : 'gn_fuyu_iro_script_bold' |
304 | }, | 337 | }, |
305 | { | 338 | { |
306 | name : 'GN Killgothic U Kanana', | 339 | name : 'GN Killgothic U Kanana', |
307 | slug : 'gn_killgothic_u_kanana' | 340 | slug : 'gn_killgothic_u_kanana' |
308 | }, | 341 | }, |
309 | { | 342 | { |
310 | name : 'GN-Kin-iro_Alphabet_Cookies', | 343 | name : 'GN-Kin-iro_Alphabet_Cookies', |
311 | slug : 'gn_kin_iro_alphabet_cookies' | 344 | slug : 'gn_kin_iro_alphabet_cookies' |
312 | 345 | ||
313 | }, | 346 | }, |
314 | { | 347 | { |
315 | name : 'GN-Kin-iro_SansSerif', | 348 | name : 'GN-Kin-iro_SansSerif', |
316 | slug : 'gn_kin_iro_sansserif' | 349 | slug : 'gn_kin_iro_sansserif' |
317 | 350 | ||
318 | }, | 351 | }, |
319 | { | 352 | { |
320 | name : 'GN-Koharuiro_Sunray', | 353 | name : 'GN-Koharuiro_Sunray', |
321 | slug : 'gn_koharuiro_sunray' | 354 | slug : 'gn_koharuiro_sunray' |
322 | 355 | ||
323 | }, | 356 | }, |
324 | { | 357 | { |
325 | name : 'GN-Kyu-pin', | 358 | name : 'GN-Kyu-pin', |
326 | slug : 'gn_kyu_pin' | 359 | slug : 'gn_kyu_pin' |
327 | }, | 360 | }, |
328 | { | 361 | { |
329 | name : 'gn_natsu_iro_schedule', | 362 | name : 'gn_natsu_iro_schedule', |
330 | slug : 'gn_natsu_iro_schedule' | 363 | slug : 'gn_natsu_iro_schedule' |
331 | 364 | ||
332 | }, | 365 | }, |
333 | { | 366 | { |
334 | name : 'gnkana_kiniro_sansserif_l', | 367 | name : 'gnkana_kiniro_sansserif_l', |
335 | slug : 'gnkana_kiniro_sansserif_l' | 368 | slug : 'gnkana_kiniro_sansserif_l' |
336 | 369 | ||
337 | }, | 370 | }, |
338 | { | 371 | { |
339 | name : 'gnkana_kiniro_sansserif_st', | 372 | name : 'gnkana_kiniro_sansserif_st', |
340 | slug : 'gnkana_kiniro_sansserif_st' | 373 | slug : 'gnkana_kiniro_sansserif_st' |
341 | }, | 374 | }, |
342 | { | 375 | { |
343 | name : 'gnkana_kon_iro_nightfall', | 376 | name : 'gnkana_kon_iro_nightfall', |
344 | slug : 'gnkana_kon_iro_nightfall' | 377 | slug : 'gnkana_kon_iro_nightfall' |
345 | 378 | ||
346 | }, | 379 | }, |
347 | { | 380 | { |
348 | name : 'ms_gothic', | 381 | name : 'ms_gothic', |
349 | slug : 'ms_gothic' | 382 | slug : 'ms_gothic' |
350 | 383 | ||
351 | }, | 384 | }, |
352 | { | 385 | { |
353 | name : 'msmincho', | 386 | name : 'msmincho', |
354 | slug : 'msmincho' | 387 | slug : 'msmincho' |
355 | }, | 388 | }, |
356 | { | 389 | { |
357 | name : 'ufonts_com_ms_pgothic', | 390 | name : 'ufonts_com_ms_pgothic', |
358 | slug : 'ufonts_com_ms_pgothic' | 391 | slug : 'ufonts_com_ms_pgothic' |
359 | } | 392 | } |
360 | ]; | 393 | ]; |
361 | 394 | ||
362 | // layer process | 395 | // layer process |
363 | $scope.layerProcess = function(mode) { | 396 | $scope.layerProcess = function(mode) { |
364 | // console.log('layerProcess'); | 397 | // console.log('layerProcess'); |
365 | var activeObject = canvas.getActiveObject(); | 398 | var activeObject = canvas.getActiveObject(); |
366 | 399 | ||
367 | console.log(activeObject); | 400 | console.log(activeObject); |
368 | 401 | ||
369 | if (activeObject){ | 402 | if (activeObject){ |
370 | switch (mode) { | 403 | switch (mode) { |
371 | case 1: | 404 | case 1: |
372 | // canvas.bringForward(activeObject); | 405 | // canvas.bringForward(activeObject); |
373 | activeObject.bringForward(); | 406 | activeObject.bringForward(); |
374 | break; | 407 | break; |
375 | case 2: | 408 | case 2: |
376 | // canvas.sendBackwards(activeObject); | 409 | // canvas.sendBackwards(activeObject); |
377 | activeObject.sendBackwards(); | 410 | activeObject.sendBackwards(); |
378 | break; | 411 | break; |
379 | case 3: | 412 | case 3: |
380 | // canvas.bringToFront(activeObject); | 413 | // canvas.bringToFront(activeObject); |
381 | activeObject.bringToFront(); | 414 | activeObject.bringToFront(); |
382 | break; | 415 | break; |
383 | case 4: | 416 | case 4: |
384 | // canvas.sendToBack(activeObject); | 417 | // canvas.sendToBack(activeObject); |
385 | activeObject.sendToBack(); | 418 | activeObject.sendToBack(); |
386 | break; | 419 | break; |
387 | } | 420 | } |
388 | canvas.deactivateAll().renderAll(); | 421 | canvas.deactivateAll().renderAll(); |
389 | } | 422 | } |
390 | }; | 423 | }; |
391 | 424 | ||
392 | $scope.focusInputText = function(text) { | 425 | $scope.focusInputText = function(text) { |
393 | currentObj = canvas.getActiveObject(); | 426 | currentObj = canvas.getActiveObject(); |
394 | if(typeof currentObj == 'undefined' || currentObj == null) { | 427 | if(typeof currentObj == 'undefined' || currentObj == null) { |
395 | $scope.iText = new fabric.IText('', { | 428 | $scope.iText = new fabric.IText('', { |
396 | left: 150, | 429 | left: 150, |
397 | top: 200, | 430 | top: 200, |
398 | fontFamily: 'Arial', | 431 | fontFamily: 'Arial', |
399 | fontWeight: 'normal', | 432 | fontWeight: 'normal', |
400 | textAlign: 'center', | 433 | textAlign: 'center', |
401 | fontSize: 28, | 434 | fontSize: 28, |
402 | fill: 'black' | 435 | fill: 'black' |
403 | }); | 436 | }); |
404 | } else { | 437 | } else { |
405 | if(currentObj.type != 'i-text') { | 438 | if(currentObj.type != 'i-text') { |
406 | $scope.iText = new fabric.IText('', { | 439 | $scope.iText = new fabric.IText('', { |
407 | left: 150, | 440 | left: 150, |
408 | top: 200, | 441 | top: 200, |
409 | fontFamily: 'Arial', | 442 | fontFamily: 'Arial', |
410 | fontWeight: 'normal', | 443 | fontWeight: 'normal', |
411 | textAlign: 'center', | 444 | textAlign: 'center', |
412 | fontSize: 28, | 445 | fontSize: 28, |
413 | fill: 'black' | 446 | fill: 'black' |
414 | }); | 447 | }); |
415 | } else{ | 448 | } else{ |
416 | $scope.iText = currentObj; | 449 | $scope.iText = currentObj; |
417 | } | 450 | } |
418 | } | 451 | } |
419 | }; | 452 | }; |
420 | 453 | ||
421 | //Design text | 454 | //Design text |
422 | $scope.inputText = function(e) { | 455 | $scope.inputText = function(e) { |
423 | if(typeof $scope.iText != "undefined") { | 456 | if(typeof $scope.iText != "undefined") { |
424 | var iText = $scope.iText; | 457 | var iText = $scope.iText; |
425 | iText.text = e; | 458 | iText.text = e; |
426 | canvas.add(iText); | 459 | canvas.add(iText); |
427 | canvas.renderAll(); | 460 | canvas.renderAll(); |
428 | canvas.setActiveObject(iText); | 461 | canvas.setActiveObject(iText); |
429 | } | 462 | } |
430 | }; | 463 | }; |
431 | $scope.setFontFamily = function(font) { | 464 | $scope.setFontFamily = function(font,index) { |
465 | $scope.itemFont = index; | ||
432 | if(canvas.getActiveObject()) { | 466 | if(canvas.getActiveObject()) { |
433 | var currentObj = canvas.getActiveObject(); | 467 | var currentObj = canvas.getActiveObject(); |
434 | if(currentObj.type == 'i-text') { | 468 | if(currentObj.type == 'i-text') { |
435 | currentObj.set('fontFamily', font); | 469 | currentObj.set('fontFamily', font); |
436 | canvas.renderAll(); | 470 | canvas.renderAll(); |
437 | canvas.setActiveObject(currentObj); | 471 | canvas.setActiveObject(currentObj); |
438 | } | 472 | } |
439 | 473 | ||
440 | } | 474 | } |
441 | }; | 475 | }; |
442 | //Set letter spacing text | 476 | //Set letter spacing text |
443 | $scope.setLetterSpacingText = function(e) { | 477 | $scope.setLetterSpacingText = function(e) { |
444 | if(canvas.getActiveObject()) { | 478 | if(canvas.getActiveObject()) { |
445 | var currentObj = canvas.getActiveObject(); | 479 | var currentObj = canvas.getActiveObject(); |
446 | if(currentObj.type == 'i-text') { | 480 | if(currentObj.type == 'i-text') { |
447 | if(e == 'plus') | 481 | if(e == 'plus') |
448 | spacingNum = spacingNum + 30; | 482 | spacingNum = spacingNum + 30; |
449 | else if (spacingNum >= 30){ | 483 | else if (spacingNum >= -30){ |
450 | spacingNum = spacingNum - 30; | 484 | spacingNum = spacingNum - 30; |
451 | } | 485 | } |
452 | currentObj.set('charSpacing', spacingNum); | 486 | currentObj.set('charSpacing', spacingNum); |
453 | canvas.renderAll(); | 487 | canvas.renderAll(); |
454 | canvas.setActiveObject(currentObj); | 488 | canvas.setActiveObject(currentObj); |
455 | } | 489 | } |
456 | } | 490 | } |
457 | } | 491 | }; |
492 | |||
493 | $scope.setLetterSpacingTextDefault = function() { | ||
494 | if(canvas.getActiveObject()) { | ||
495 | var currentObj = canvas.getActiveObject(); | ||
496 | if(currentObj.type == 'i-text') { | ||
497 | spacingNum = 0; | ||
498 | currentObj.set('charSpacing', spacingNum); | ||
499 | canvas.renderAll(); | ||
500 | canvas.setActiveObject(currentObj); | ||
501 | } | ||
502 | } | ||
503 | }; | ||
458 | 504 | ||
459 | 505 | ||
460 | /**** process insert image */ | 506 | /**** process insert image */ |
461 | if (typeof($window.localStorage.recentImages) != 'undefined'){ | 507 | if (typeof($window.localStorage.recentImages) != 'undefined'){ |
462 | $scope.recentImages = JSON.parse($window.localStorage.recentImages); | 508 | $scope.recentImages = JSON.parse($window.localStorage.recentImages); |
463 | }else{ | 509 | }else{ |
464 | $scope.recentImages = {}; | 510 | $scope.recentImages = {}; |
465 | } | 511 | } |
466 | 512 | ||
467 | var addToRecentImage = function(name, data){ | 513 | var addToRecentImage = function(name, data){ |
468 | if (typeof($window.localStorage.recentImages) != 'undefined'){ | 514 | if (typeof($window.localStorage.recentImages) != 'undefined'){ |
469 | $scope.recentImages = JSON.parse($window.localStorage.recentImages); | 515 | $scope.recentImages = JSON.parse($window.localStorage.recentImages); |
470 | }else{ | 516 | }else{ |
471 | $scope.recentImages = {}; | 517 | $scope.recentImages = {}; |
472 | } | 518 | } |
473 | 519 | ||
474 | if (typeof($scope.recentImages[name]) == 'undefined'){ | 520 | if (typeof($scope.recentImages[name]) == 'undefined'){ |
475 | var ii=0; | 521 | var ii=0; |
476 | var II = 0; | 522 | var II = 0; |
477 | for(var item in $scope.recentImages){ | 523 | for(var item in $scope.recentImages){ |
478 | if (II==0){ | 524 | if (II==0){ |
479 | II = item; | 525 | II = item; |
480 | } | 526 | } |
481 | ii++; | 527 | ii++; |
482 | } | 528 | } |
483 | if (ii>16 && II!=0){ | 529 | if (ii>16 && II!=0){ |
484 | delete $scope.recentImages[II]; | 530 | delete $scope.recentImages[II]; |
485 | } | 531 | } |
486 | $scope.recentImages[name] = data; | 532 | $scope.recentImages[name] = data; |
487 | $window.localStorage.recentImages = JSON.stringify($scope.recentImages); | 533 | $window.localStorage.recentImages = JSON.stringify($scope.recentImages); |
488 | } | 534 | } |
489 | } | 535 | } |
490 | $scope.chooseImage = function(e){//console.log(e); | 536 | $scope.chooseImage = function(e){//console.log(e); |
491 | if (e.target.files[0] && e.target.files[0].size > 5*1024*1024){ | 537 | if (e.target.files[0] && e.target.files[0].size > 5*1024*1024){ |
492 | alert('アップロードできませんでした'); | 538 | alert('アップロードできませんでした'); |
493 | return; | 539 | return; |
494 | } | 540 | } |
495 | var reader = new FileReader(); | 541 | var reader = new FileReader(); |
496 | reader.onload = function (event) { | 542 | reader.onload = function (event) { |
497 | addToRecentImage ($('#imgLoader').val(), event.target.result); | 543 | addToRecentImage ($('#imgLoader').val(), event.target.result); |
498 | var imgObj = new Image();//console.log($('#imgLoader').val()); | 544 | var imgObj = new Image();//console.log($('#imgLoader').val()); |
499 | imgObj.src = event.target.result; | 545 | imgObj.src = event.target.result; |
500 | imgObj.onload = function () { | 546 | imgObj.onload = function () { |
501 | // start fabricJS stuff | 547 | // start fabricJS stuff |
502 | 548 | ||
503 | var image = new fabric.Image(imgObj); | 549 | var image = new fabric.Image(imgObj); |
504 | image.set({ | 550 | image.set({ |
505 | left: 50, | 551 | left: 50, |
506 | top: 50 | 552 | top: 50 |
507 | }); | 553 | }); |
554 | //image.scale(getRandomNum(0.1, 0.25)).setCoords(); | ||
508 | image.scaleToWidth(200); | 555 | image.scaleToWidth(200); |
509 | canvas.add(image); | 556 | canvas.add(image); |
510 | } | 557 | } |
511 | } | 558 | } |
512 | reader.readAsDataURL(e.target.files[0]); | 559 | reader.readAsDataURL(e.target.files[0]); |
513 | } | 560 | } |
514 | 561 | ||
515 | $scope.insertRecentImage = function(data){ | 562 | $scope.insertRecentImage = function(data){ |
516 | var imgObj = new Image(); | 563 | var imgObj = new Image(); |
517 | imgObj.src = data; | 564 | imgObj.src = data; |
518 | imgObj.onload = function () { | 565 | imgObj.onload = function () { |
519 | // start fabricJS stuff | 566 | // start fabricJS stuff |
520 | 567 | ||
521 | var image = new fabric.Image(imgObj); | 568 | var image = new fabric.Image(imgObj); |
522 | image.set({ | 569 | image.set({ |
523 | left: 50, | 570 | left: 50, |
524 | top: 50 | 571 | top: 50 |
525 | }); | 572 | }); |
526 | image.scaleToWidth(200); | 573 | image.scaleToWidth(200); |
527 | canvas.add(image); | 574 | canvas.add(image); |
528 | } | 575 | } |
529 | } | 576 | } |
530 | 577 | ||
531 | //Traslation text | 578 | //Traslation text |
532 | $scope.rotateText = function(style) { | 579 | $scope.rotateText = function(style) { |
533 | if(canvas.getActiveObject()) { | 580 | if(canvas.getActiveObject()) { |
534 | var currentObj = canvas.getActiveObject(); | 581 | var currentObj = canvas.getActiveObject(); |
535 | if(currentObj.type == 'i-text') { | 582 | if(currentObj.type == 'i-text') { |
536 | currentObj.set('rotate', Math.PI / 4); | 583 | currentObj.set('rotate', Math.PI / 4); |
537 | canvas.renderAll(); | 584 | canvas.renderAll(); |
538 | canvas.setActiveObject(currentObj); | 585 | canvas.setActiveObject(currentObj); |
539 | } | 586 | } |
540 | } | 587 | } |
541 | }; | 588 | }; |
542 | 589 |
app/styles/main.css
1 | /* Space out content a bit */ | 1 | /* Space out content a bit */ |
2 | @import "../fonts/font.css"; | 2 | @import "../fonts/font.css"; |
3 | @import "../fonts/font_canvas/font-canvas.css"; | 3 | @import "../fonts/font_canvas/font-canvas.css"; |
4 | html{ | ||
5 | height:100%; | ||
6 | width:100%; | ||
7 | } | ||
4 | body { | 8 | body { |
5 | font-family: 'Hiragino Kaku Gothic Pro', sans-serif; | 9 | font-family: 'Hiragino Kaku Gothic Pro', sans-serif; |
6 | /*font-family: 'gn_aki_iro_sesami_cookies';*/ | 10 | height:100%; |
11 | width:100%; | ||
7 | } | 12 | } |
8 | /*Scroll bar style*/ | 13 | /*Scroll bar style*/ |
9 | ::-webkit-scrollbar { | 14 | ::-webkit-scrollbar { |
10 | -webkit-appearance: none; | 15 | -webkit-appearance: none; |
11 | width: 7px; | 16 | width: 7px; |
12 | } | 17 | } |
18 | ::-webkit-scrollbar-track { | ||
19 | -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); | ||
20 | } | ||
21 | |||
13 | ::-webkit-scrollbar-thumb { | 22 | ::-webkit-scrollbar-thumb { |
14 | border-radius: 4px; | 23 | border-radius: 4px; |
15 | background-color: rgba(0,0,0,.5); | 24 | background-color: rgba(0,0,0,.5); |
16 | -webkit-box-shadow: 0 0 1px rgba(255,255,255,.5); | 25 | -webkit-box-shadow: 0 0 1px rgba(255,255,255,.5); |
17 | } | 26 | } |
18 | /*End scroll bar style*/ | 27 | /*End scroll bar style*/ |
19 | .padding-right-0{ | 28 | .padding-right-0{ |
20 | padding-right: 0!important; | 29 | padding-right: 0!important; |
21 | } | 30 | } |
22 | .padding-left-0{ | 31 | .padding-left-0{ |
23 | padding-left: 0!important; | 32 | padding-left: 0!important; |
24 | } | 33 | } |
25 | button.red{ | 34 | button.red{ |
26 | color: #ffffff; | 35 | color: #ffffff; |
27 | background-color: #ff0000; | 36 | background-color: #ff0000; |
28 | border: 1px solid #ff0000; | 37 | border: 1px solid #ff0000; |
29 | 38 | ||
30 | } | 39 | } |
31 | button.white{ | 40 | button.white{ |
32 | border: 1px solid #ff8080; | 41 | border: 1px solid #ff8080; |
33 | color: #ff8080; | 42 | color: #ff8080; |
34 | background-color: #ffffff; | 43 | background-color: #ffffff; |
35 | } | 44 | } |
36 | button.brown{ | 45 | button.brown{ |
37 | background-color: #666666; | 46 | background-color: #666666; |
38 | border: 1px solid #666666; | 47 | border: 1px solid #666666; |
39 | color: #ffffff; | 48 | color: #ffffff; |
40 | border-radius: 5px; | 49 | border-radius: 5px; |
41 | } | 50 | } |
42 | button.black{ | 51 | button.black{ |
43 | border: 1px solid #c9c9c9; | 52 | border: 1px solid #c9c9c9; |
44 | background-color: #343434; | 53 | background-color: #343434; |
45 | color: #ffffff; | 54 | color: #ffffff; |
46 | padding: 1px 6px; | 55 | padding: 1px 6px; |
47 | } | 56 | } |
48 | #tshirt-container{ | 57 | #tshirt-container{ |
49 | border-left: 1px solid #dcdcdc; | 58 | border-left: 1px solid #dcdcdc; |
50 | border-right: 1px solid #dcdcdc; | 59 | border-right: 1px solid #dcdcdc; |
51 | } | 60 | } |
52 | /*HEADER*/ | 61 | /*HEADER*/ |
53 | header{ | 62 | header{ |
54 | border-bottom: 1px solid #dcdcdc; | 63 | border-bottom: 1px solid #dcdcdc; |
55 | } | 64 | } |
56 | header .logo{ | 65 | header .logo{ |
57 | color: #ed1d24; | 66 | color: #ed1d24; |
58 | font-size: 30px; | 67 | font-size: 30px; |
59 | text-transform: uppercase; | 68 | text-transform: uppercase; |
60 | font-weight: bold; | 69 | font-weight: bold; |
61 | } | 70 | } |
62 | header .logo img{ | 71 | header .logo img{ |
63 | width: 60px; | 72 | width: 60px; |
64 | } | 73 | } |
65 | /*NAVIGATION*/ | 74 | /*NAVIGATION*/ |
66 | nav{ | 75 | nav{ |
67 | border-bottom: 1px solid #dcdcdc; | 76 | border-bottom: 1px solid #dcdcdc; |
68 | padding: 10px 0; | 77 | padding: 10px 0; |
69 | } | 78 | } |
70 | nav h2{ | 79 | nav h2{ |
71 | font-size: 27px; | 80 | font-size: 27px; |
72 | margin: 0 0; | 81 | margin: 0 0; |
73 | } | 82 | } |
74 | nav ul{ | 83 | nav ul{ |
75 | list-style: none; | 84 | list-style: none; |
76 | padding-left: 0; | 85 | padding-left: 0; |
77 | margin-bottom: 0; | 86 | margin-bottom: 0; |
78 | 87 | ||
79 | } | 88 | } |
80 | nav ul li{ | 89 | nav ul li{ |
81 | margin-left: 2px; | 90 | margin-left: 2px; |
82 | float: left; | 91 | float: left; |
83 | padding: 6px 12px; | 92 | padding: 6px 12px; |
84 | background-color: #999999; | 93 | background-color: #999999; |
85 | position: relative; | 94 | position: relative; |
86 | } | 95 | } |
87 | nav ul li i.fa{ | 96 | nav ul li i.fa{ |
88 | position: absolute; | 97 | position: absolute; |
89 | color: #ffffff; | 98 | color: #ffffff; |
90 | font-size: 18px; | 99 | font-size: 18px; |
91 | right: -4px; | 100 | right: -4px; |
92 | top: 50%; | 101 | top: 50%; |
93 | transform: translateX(-50%) translateY(-50%); | 102 | transform: translateX(-50%) translateY(-50%); |
94 | -webkit-transform: translateX(-50%) translateY(-50%); | 103 | -webkit-transform: translateX(-50%) translateY(-50%); |
95 | } | 104 | } |
96 | nav ul li a{ | 105 | nav ul li a{ |
97 | color: #ffffff; | 106 | color: #ffffff; |
98 | } | 107 | } |
99 | nav ul li:hover a{ | 108 | nav ul li:hover a{ |
100 | text-decoration: none; | 109 | text-decoration: none; |
101 | color: #ffffff; | 110 | color: #ffffff; |
102 | } | 111 | } |
103 | nav ul li.action{ | 112 | nav ul li.action{ |
104 | color: #ffffff; | 113 | color: #ffffff; |
105 | background-color: #ed1d24; | 114 | background-color: #ed1d24; |
106 | } | 115 | } |
107 | /*ASIDE*/ | 116 | /*ASIDE*/ |
108 | aside{ | 117 | aside{ |
109 | margin: 10px 0; | 118 | margin: 10px 0; |
110 | } | 119 | } |
111 | 120 | ||
112 | aside .break-down{ | 121 | aside .break-down{ |
113 | padding: 0 0; | 122 | padding: 0 0; |
114 | } | 123 | } |
115 | aside .break-down i.fa{ | 124 | aside .break-down i.fa{ |
116 | font-size: 35px; | 125 | font-size: 35px; |
117 | color: #ff0000; | 126 | color: #ff0000; |
118 | } | 127 | } |
119 | aside .break-line{ | 128 | aside .break-line{ |
120 | height: 10px; | 129 | height: 10px; |
121 | } | 130 | } |
122 | aside .break-line hr{ | 131 | aside .break-line hr{ |
123 | border-top: 1px dotted #cccccc; | 132 | border-top: 1px dotted #cccccc; |
124 | } | 133 | } |
125 | aside .step{ | 134 | aside .step{ |
126 | margin: 0 0; | 135 | margin: 0 0; |
127 | } | 136 | } |
128 | aside .step .title{ | 137 | aside .step .title{ |
129 | font-size: 15px; | 138 | font-size: 15px; |
130 | line-height: 16px; | 139 | line-height: 16px; |
131 | font-weight: bold; | 140 | font-weight: bold; |
132 | margin-bottom: 3px; | 141 | margin-bottom: 3px; |
133 | } | 142 | } |
134 | aside .step .title-notice{ | 143 | aside .step .title-notice{ |
135 | font-size: 13px; | 144 | font-size: 13px; |
136 | line-height: 16px; | 145 | line-height: 16px; |
137 | margin-bottom: 3px; | 146 | margin-bottom: 3px; |
138 | } | 147 | } |
139 | aside .step .title-notice .require{ | 148 | aside .step .title-notice .require{ |
140 | font-size: 10px; | 149 | font-size: 10px; |
141 | } | 150 | } |
142 | aside .step .step-box{ | 151 | aside .step .step-box{ |
143 | border: 2px solid #dcdcdc; | 152 | border: 2px solid #dcdcdc; |
144 | font-size: 12px; | 153 | font-size: 12px; |
145 | 154 | ||
146 | } | 155 | } |
147 | /*Step 1*/ | 156 | /*Step 1*/ |
148 | aside .step .step-box .tshirt-design{ | 157 | aside .step .step-box .tshirt-design{ |
149 | border: 1px solid #cccccc; | 158 | border: 1px solid #cccccc; |
150 | background-color: #f5f5f5; | 159 | background-color: #f5f5f5; |
151 | margin: 10px 10px; | 160 | margin: 10px 10px; |
152 | } | 161 | } |
153 | aside .step .step-box .tshirt-design:hover{ | 162 | aside .step .step-box .tshirt-design:hover{ |
154 | border: 1px solid #ff0000; | 163 | border: 1px solid #ff0000; |
155 | } | 164 | } |
156 | aside .step .step-box .tshirt-design button:hover{ | 165 | aside .step .step-box .tshirt-design button:hover{ |
157 | background-color: #fa7b7b; | 166 | background-color: #fa7b7b; |
158 | border: 1px solid #fa7b7b; | 167 | border: 1px solid #fa7b7b; |
159 | } | 168 | } |
160 | aside .step .step-box .tshirt-design div{ | 169 | aside .step .step-box .tshirt-design div{ |
161 | float: left; | 170 | float: left; |
162 | } | 171 | } |
163 | aside .step .step-box .tshirt-design .icon{ | 172 | aside .step .step-box .tshirt-design .icon{ |
164 | padding: 4px 4px; | 173 | padding: 4px 4px; |
165 | border-right: 1px solid #cccccc; | 174 | border-right: 1px solid #cccccc; |
166 | 175 | ||
167 | } | 176 | } |
168 | aside .step .step-box .tshirt-design .icon img{ | 177 | aside .step .step-box .tshirt-design .icon img{ |
169 | height: 50px; | 178 | height: 50px; |
170 | } | 179 | } |
171 | aside .step .step-box .tshirt-design .name{ | 180 | aside .step .step-box .tshirt-design .name{ |
172 | padding: 10px 10px; | 181 | padding: 10px 10px; |
173 | 182 | ||
174 | } | 183 | } |
175 | aside .step .step-box .tshirt-design .action{ | 184 | aside .step .step-box .tshirt-design .action{ |
176 | padding: 10px 10px; | 185 | padding: 10px 10px; |
177 | float: right; | 186 | float: right; |
178 | 187 | ||
179 | } | 188 | } |
180 | aside .step .step-box .tshirt-design .action button{ | 189 | aside .step .step-box .tshirt-design .action button{ |
181 | padding: 8px 10px; | 190 | padding: 8px 10px; |
182 | } | 191 | } |
183 | /*Step 2*/ | 192 | /*Step 2*/ |
184 | aside .step .step-box .tshirt-color{ | 193 | aside .step .step-box .tshirt-color{ |
185 | padding: 6px 10px; | 194 | padding: 6px 10px; |
186 | position: relative; | 195 | position: relative; |
187 | } | 196 | } |
188 | aside .step .step-box .tshirt-color ul.choice-color{ | 197 | aside .step .step-box .tshirt-color ul.choice-color{ |
189 | float: left; | 198 | float: left; |
190 | list-style: none; | 199 | list-style: none; |
191 | padding-left: 0; | 200 | padding-left: 0; |
192 | width: 100%; | 201 | width: 100%; |
193 | margin-bottom: 3px; | 202 | margin-bottom: 3px; |
194 | } | 203 | } |
195 | aside .step .step-box .tshirt-color ul.choice-color li{ | 204 | aside .step .step-box .tshirt-color ul.choice-color li{ |
196 | margin: 0 10px 0 0; | 205 | margin: 0 10px 0 0; |
197 | border: 1px solid #cccccc; | 206 | border: 1px solid #cccccc; |
198 | padding: 2px 2px; | 207 | padding: 2px 2px; |
199 | float: left; | 208 | float: left; |
200 | cursor: pointer; | 209 | cursor: pointer; |
201 | } | 210 | } |
202 | aside .step .step-box .tshirt-color ul.choice-color li.action{ | 211 | aside .step .step-box .tshirt-color ul.choice-color li.action{ |
203 | border: 1px solid #ff0000; | 212 | border: 1px solid #ff0000; |
204 | } | 213 | } |
205 | aside .step .step-box .tshirt-color ul.choice-color li:hover{ | 214 | aside .step .step-box .tshirt-color ul.choice-color li:hover{ |
206 | border: 1px solid #ff0000; | 215 | border: 1px solid #ff0000; |
207 | } | 216 | } |
208 | aside .step .step-box .tshirt-color ul.choice-color li div{ | 217 | aside .step .step-box .tshirt-color ul.choice-color li div{ |
209 | height: 30px; | 218 | height: 30px; |
210 | width: 30px; | 219 | width: 30px; |
211 | } | 220 | } |
212 | 221 | ||
213 | aside .step .step-box .tshirt-color ul.choice-color li.white div{ | 222 | aside .step .step-box .tshirt-color ul.choice-color li.white div{ |
214 | background-color: #ece7e4; | 223 | background-color: #ece7e4; |
215 | } | 224 | } |
216 | aside .step .step-box .tshirt-color ul.choice-color li.blue div{ | 225 | aside .step .step-box .tshirt-color ul.choice-color li.blue div{ |
217 | background-color: #e7dfd0; | 226 | background-color: #e7dfd0; |
218 | } | 227 | } |
219 | aside .step .step-box .tshirt-color .color-name{ | 228 | aside .step .step-box .tshirt-color .color-name{ |
220 | width: 100%; | 229 | width: 100%; |
221 | font-size: 10px; | 230 | font-size: 10px; |
222 | } | 231 | } |
223 | aside .step .step-box .tshirt-color .view-more{ | 232 | aside .step .step-box .tshirt-color .view-more{ |
224 | position: absolute; | 233 | position: absolute; |
225 | bottom: 6px; | 234 | bottom: 6px; |
226 | right: 10px; | 235 | right: 10px; |
227 | } | 236 | } |
228 | /*Step 3*/ | 237 | /*Step 3*/ |
229 | aside .step .step-box .tshirt-saveorder{ | 238 | aside .step .step-box .tshirt-saveorder{ |
230 | padding: 10px 10px 6px 10px; | 239 | padding: 10px 10px 6px 10px; |
231 | } | 240 | } |
232 | aside .step .step-box .tshirt-saveorder .action{ | 241 | aside .step .step-box .tshirt-saveorder .action{ |
233 | width: 50%; | 242 | width: 50%; |
234 | float: left; | 243 | float: left; |
235 | } | 244 | } |
236 | aside .step .step-box .tshirt-saveorder .action:first-child{ | 245 | aside .step .step-box .tshirt-saveorder .action:first-child{ |
237 | padding-right: 5px; | 246 | padding-right: 5px; |
238 | } | 247 | } |
239 | aside .step .step-box .tshirt-saveorder .action:last-child{ | 248 | aside .step .step-box .tshirt-saveorder .action:last-child{ |
240 | padding-left: 5px; | 249 | padding-left: 5px; |
241 | } | 250 | } |
242 | aside .step .step-box .tshirt-saveorder .action button{ | 251 | aside .step .step-box .tshirt-saveorder .action button{ |
243 | padding: 8px 10px; | 252 | padding: 8px 10px; |
244 | 253 | ||
245 | } | 254 | } |
246 | aside .step .step-box .tshirt-saveorder .action button .text{ | 255 | aside .step .step-box .tshirt-saveorder .action button .text{ |
247 | float: left; | 256 | float: left; |
248 | width: 80%; | 257 | width: 80%; |
249 | text-align: center; | 258 | text-align: center; |
250 | padding-left: 10px; | 259 | padding-left: 10px; |
251 | vertical-align: bottom; | 260 | vertical-align: bottom; |
252 | } | 261 | } |
253 | aside .step .step-box .tshirt-saveorder .action button .arrow{ | 262 | aside .step .step-box .tshirt-saveorder .action button .arrow{ |
254 | float: left; | 263 | float: left; |
255 | width: 20%; | 264 | width: 20%; |
256 | height: 40px; | 265 | height: 40px; |
257 | position: relative; | 266 | position: relative; |
258 | } | 267 | } |
259 | aside .step .step-box .tshirt-saveorder .action button .arrow i.fa{ | 268 | aside .step .step-box .tshirt-saveorder .action button .arrow i.fa{ |
260 | position: absolute; | 269 | position: absolute; |
261 | top: 50%; | 270 | top: 50%; |
262 | right: -6px; | 271 | right: -6px; |
263 | transform: translateX(-50%) translateY(-50%); | 272 | transform: translateX(-50%) translateY(-50%); |
264 | -webkit-transform: translateX(-50%) translateY(-50%); | 273 | -webkit-transform: translateX(-50%) translateY(-50%); |
265 | } | 274 | } |
266 | aside .step .step-box .tshirt-saveorder .notice{ | 275 | aside .step .step-box .tshirt-saveorder .notice{ |
267 | padding: 5px 0 0 0; | 276 | padding: 5px 0 0 0; |
268 | } | 277 | } |
269 | /*Step 4*/ | 278 | /*Step 4*/ |
270 | aside .step .title-notice{ | 279 | aside .step .title-notice{ |
271 | 280 | ||
272 | } | 281 | } |
273 | aside .step .step-box .change-design{ | 282 | aside .step .step-box .change-design{ |
274 | padding: 4px 4px; | 283 | padding: 4px 4px; |
275 | } | 284 | } |
276 | aside .step .step-box .change-design table{ | 285 | aside .step .step-box .change-design table{ |
277 | 286 | ||
278 | } | 287 | } |
279 | aside .step .step-box .change-design table tr{ | 288 | aside .step .step-box .change-design table tr{ |
280 | border-bottom: 1px dotted #cccccc; | 289 | border-bottom: 1px dotted #cccccc; |
281 | } | 290 | } |
282 | aside .step .step-box .change-design table tr:last-child{ | 291 | aside .step .step-box .change-design table tr:last-child{ |
283 | border-bottom: 0; | 292 | border-bottom: 0; |
284 | } | 293 | } |
285 | 294 | ||
286 | /*Step 5- finish*/ | 295 | /*Step 5- finish*/ |
287 | aside .step .finish-design{ | 296 | aside .step .finish-design{ |
288 | padding: 20px 0; | 297 | padding: 20px 0; |
289 | } | 298 | } |
290 | aside .step .finish-design button{ | 299 | aside .step .finish-design button{ |
291 | width: 100%; | 300 | width: 100%; |
292 | padding: 8px 10px; | 301 | padding: 8px 10px; |
293 | } | 302 | } |
294 | 303 | ||
295 | /*DESIGN CONTENT*/ | 304 | /*DESIGN CONTENT*/ |
296 | #tshirt-content{ | 305 | #tshirt-content{ |
297 | position: relative; | 306 | position: relative; |
298 | } | 307 | } |
299 | #tshirt-content .switch-border-design{ | 308 | #tshirt-content .switch-border-design{ |
300 | position: absolute; | 309 | position: absolute; |
301 | top: 5px; | 310 | top: 5px; |
302 | right: 10px; | 311 | right: 10px; |
303 | color: red; | 312 | color: red; |
304 | font-size: 11px; | 313 | font-size: 11px; |
305 | } | 314 | } |
306 | #tshirt-content .tshirt-image{ | 315 | #tshirt-content .tshirt-image{ |
307 | padding: 20px 0 0 0; | 316 | padding: 20px 0 0 0; |
317 | position: relative; | ||
318 | height: 100%; | ||
319 | width: 100%; | ||
308 | } | 320 | } |
309 | 321 | ||
310 | #tshirt-content .tshirt-image img{ | 322 | #tshirt-content .tshirt-image img{ |
311 | width: 100%; | 323 | width: 100%; |
312 | } | 324 | } |
313 | 325 | ||
314 | #preview-design { | 326 | #preview-design { |
315 | position: absolute; | 327 | position: absolute; |
316 | width: 150px; | 328 | width: 190px; |
317 | height: 182px; | 329 | height: 200px; |
318 | border: dashed 2px #DDD; | 330 | border: dashed 2px #DDD; |
319 | bottom: 180px; | 331 | top: 180px; |
320 | left: 200px; | 332 | /*left: 200px;*/ |
333 | cursor: pointer; | ||
321 | } | 334 | } |
322 | 335 | ||
323 | #preview-design img { | 336 | #preview-design img { |
324 | width: 150px; | 337 | width: 150px; |
325 | } | 338 | } |
326 | 339 | ||
327 | #tshirt-content .tshirt-choice{ | 340 | #tshirt-content .tshirt-choice{ |
328 | 341 | ||
329 | } | 342 | } |
330 | #tshirt-content .tshirt-choice ul{ | 343 | #tshirt-content .tshirt-choice ul{ |
331 | list-style: none; | 344 | list-style: none; |
332 | padding-left: 0; | 345 | padding-left: 0; |
333 | display: table; | 346 | display: table; |
334 | margin: auto; | 347 | margin: auto; |
335 | } | 348 | } |
336 | #tshirt-content .tshirt-choice ul li{ | 349 | #tshirt-content .tshirt-choice ul li{ |
337 | float: left; | 350 | float: left; |
338 | margin: 10px 10px; | 351 | margin: 10px 10px; |
339 | cursor: pointer; | 352 | cursor: pointer; |
340 | } | 353 | } |
341 | #tshirt-content .tshirt-choice ul li .image{ | 354 | #tshirt-content .tshirt-choice ul li .image{ |
342 | border: 1px solid #cccccc; | 355 | border: 1px solid #cccccc; |
343 | padding: 3px 3px; | 356 | padding: 3px 3px; |
344 | } | 357 | } |
345 | #tshirt-content .tshirt-choice ul li.focus{ | 358 | #tshirt-content .tshirt-choice ul li.focus{ |
346 | 359 | ||
347 | } | 360 | } |
348 | #tshirt-content .tshirt-choice ul li.focus .image{ | 361 | #tshirt-content .tshirt-choice ul li.focus .image{ |
349 | border: 1px solid #ff0000; | 362 | border: 1px solid #ff0000; |
350 | } | 363 | } |
351 | #tshirt-content .tshirt-choice ul li .image img{ | 364 | #tshirt-content .tshirt-choice ul li .image img{ |
352 | width: 50px; | 365 | width: 50px; |
353 | height: auto; | 366 | height: auto; |
354 | } | 367 | } |
355 | /*MODAL Design*/ | 368 | /*MODAL Design*/ |
356 | #tshirt-design{ | 369 | #tshirt-design{ |
357 | background-color: #666666; | 370 | background-color: #666666; |
358 | } | 371 | } |
359 | #tshirt-design .modal-dialog{ | 372 | #tshirt-design .modal-dialog{ |
360 | width: 75%; | 373 | /*width: 800px!important;*/ |
361 | margin: 0 auto; | 374 | margin: 0 auto; |
362 | } | 375 | } |
363 | #tshirt-design .modal-dialog .modal-content{ | 376 | #tshirt-design .modal-dialog .modal-content{ |
364 | background-color: transparent; | 377 | background-color: transparent; |
365 | border-radius: 0; | 378 | border-radius: 0; |
366 | border: 0; | 379 | border: 0; |
367 | -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, .5)!important; | 380 | -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, .5)!important; |
368 | box-shadow: 0 0 0 rgba(0, 0, 0, .5)!important; | 381 | box-shadow: 0 0 0 rgba(0, 0, 0, .5)!important; |
369 | } | 382 | } |
370 | #tshirt-design .modal-dialog .modal-content .modal-header{ | 383 | #tshirt-design .modal-dialog .modal-content .modal-header{ |
371 | padding: 0 0 10px 0; | 384 | padding: 0 0 10px 0; |
372 | border-bottom: 0; | 385 | border-bottom: 0; |
373 | border-shadow: none!important; | 386 | border-shadow: none!important; |
374 | } | 387 | } |
375 | #tshirt-design .modal-dialog .modal-content .modal-body{ | 388 | #tshirt-design .modal-dialog .modal-content .modal-body{ |
376 | background-color: #f5f5f5; | 389 | background-color: #f5f5f5; |
377 | padding: 0 0; | 390 | padding: 0 0; |
378 | } | 391 | } |
379 | #tshirt-design header{ | 392 | #tshirt-design header{ |
380 | border-bottom: 1px solid #cccccc; | 393 | border-bottom: 1px solid #cccccc; |
381 | background-color: #dddddd; | 394 | background-color: #dddddd; |
382 | } | 395 | } |
383 | #tshirt-design header ul.nav{ | 396 | #tshirt-design header ul.nav{ |
384 | padding-left: 0; | 397 | padding-left: 0; |
385 | list-style: none; | 398 | list-style: none; |
386 | } | 399 | } |
387 | #tshirt-design header ul.nav li{ | 400 | #tshirt-design header ul.nav li{ |
388 | float: left; | 401 | float: left; |
389 | padding: 8px 26px; | 402 | padding: 8px 26px; |
390 | border-right: 1px solid #cccccc; | 403 | border-right: 1px solid #cccccc; |
391 | font-size: 14px; | 404 | font-size: 14px; |
392 | cursor: pointer; | 405 | cursor: pointer; |
393 | } | 406 | } |
394 | #tshirt-design header ul.nav li:hover, #tshirt-design header ul.nav li.active{ | 407 | #tshirt-design header ul.nav li:hover, #tshirt-design header ul.nav li.active{ |
395 | background-color: red; | 408 | background-color: red; |
396 | color: #ffffff; | 409 | color: #ffffff; |
397 | } | 410 | } |
398 | #tshirt-design header ul.nav li:hover i.fa, #tshirt-design header ul.nav li.active i.fa{ | 411 | #tshirt-design header ul.nav li:hover i.fa, #tshirt-design header ul.nav li.active i.fa{ |
399 | color: #ffffff; | 412 | color: #ffffff; |
400 | } | 413 | } |
401 | #tshirt-design header ul.nav li i.fa{ | 414 | #tshirt-design header ul.nav li i.fa{ |
402 | color: #fe070f; | 415 | color: #fe070f; |
403 | font-size: 20px; | 416 | font-size: 20px; |
404 | margin-right: 10px; | 417 | margin-right: 10px; |
405 | } | 418 | } |
406 | #tshirt-design header .action{ | 419 | #tshirt-design header .action{ |
407 | 420 | ||
408 | } | 421 | } |
409 | #tshirt-design header .action button{ | 422 | #tshirt-design header .action button{ |
410 | padding: 2px 10px; | 423 | padding: 2px 10px; |
411 | margin: 6px 10px; | 424 | margin: 6px 10px; |
412 | } | 425 | } |
413 | #tshirt-design header .action button:hover{ | 426 | #tshirt-design header .action button:hover{ |
414 | background-color: red; | 427 | background-color: red; |
415 | color: #ffffff; | 428 | color: #ffffff; |
416 | } | 429 | } |
417 | 430 | ||
418 | /*Aside modal*/ | 431 | /*Aside modal*/ |
419 | .aside{ | 432 | .aside{ |
420 | } | 433 | } |
421 | 434 | ||
422 | .aside .box-design-option{ | 435 | .aside .box-design-option{ |
423 | list-style: none; | 436 | list-style: none; |
424 | padding-left: 0; | 437 | padding-left: 0; |
425 | margin-top: 10px; | 438 | margin-top: 10px; |
426 | } | 439 | } |
427 | 440 | ||
428 | .aside .box-design-option li{ | 441 | .aside .box-design-option li{ |
429 | border: 1px solid #cdcdcd; | 442 | border: 1px solid #cdcdcd; |
430 | position: relative; | 443 | position: relative; |
431 | /*cursor: pointer;*/ | 444 | /*cursor: pointer;*/ |
432 | margin-bottom: 10px; | 445 | margin-bottom: 10px; |
433 | } | 446 | } |
434 | .aside .box-design-option li .hover{ | 447 | .aside .box-design-option li .hover{ |
435 | background-color: #fddad4; | 448 | background-color: #fddad4; |
436 | opacity: 0.6; | 449 | opacity: 0.6; |
437 | position: absolute; | 450 | position: absolute; |
438 | width: 100%; | 451 | width: 100%; |
439 | height: 100%; | 452 | height: 100%; |
440 | display: none; | 453 | display: none; |
441 | } | 454 | } |
442 | .aside .box-design-option li:hover .hover{ | 455 | .aside .box-design-option li:hover .hover{ |
443 | display: block; | 456 | display: block; |
444 | } | 457 | } |
445 | 458 | ||
446 | .aside .box-design-option li .title{ | 459 | .aside .box-design-option li .title{ |
447 | background: url("../images/bg1.png") repeat #cdcdcd; | 460 | background: url("../images/bg1.png") repeat #cdcdcd; |
448 | padding: 3px 10px; | 461 | padding: 3px 10px; |
449 | } | 462 | } |
450 | .aside .box-design-option li .title i.fa{ | 463 | .aside .box-design-option li .title i.fa{ |
451 | color: #000000; | 464 | color: #000000; |
452 | } | 465 | } |
453 | 466 | ||
454 | .aside .box-design-option li .content{ | 467 | .aside .box-design-option li .content{ |
455 | 468 | ||
456 | } | 469 | } |
457 | .aside .box-design-option li .content i.fa{ | 470 | .aside .box-design-option li .content i.fa{ |
458 | font-size: 30px; | 471 | font-size: 30px; |
459 | color: #fe070f; | 472 | color: #fe070f; |
460 | margin: 8px 0; | 473 | margin: 8px 0; |
461 | } | 474 | } |
462 | .aside .box-design-option li .content .des{ | 475 | .aside .box-design-option li .content .des{ |
463 | padding: 3px 10px 3px 0; | 476 | padding: 3px 10px 3px 0; |
464 | } | 477 | } |
465 | .aside .box-design-option li .content .color-patterns { | 478 | .aside .box-design-option li .content .color-patterns { |
466 | width: 100%; | 479 | width: 100%; |
467 | border: #bbb solid 1px; | 480 | border: #bbb solid 1px; |
468 | background: #FFF; | 481 | background: #FFF; |
469 | margin-top: 5px; | 482 | margin-top: 5px; |
470 | min-height: 65px; | 483 | min-height: 65px; |
471 | } | 484 | } |
472 | 485 | ||
473 | .aside .box-design-option li .content .color-patterns .color-pattern-item{ | 486 | .aside .box-design-option li .content .color-patterns .color-pattern-item{ |
474 | height: 20px; | 487 | height: 20px; |
475 | float: left; | 488 | float: left; |
476 | margin-left: 4px; | 489 | margin-left: 4px; |
477 | margin-top: 2px; | 490 | margin-top: 2px; |
478 | width: 20px; | 491 | width: 20px; |
479 | cursor: pointer; | 492 | cursor: pointer; |
480 | border: 1px solid #ddd; | 493 | border: 1px solid #ddd; |
481 | } | 494 | } |
482 | 495 | ||
483 | .aside .box-design-option li .content .color-patterns .color-pattern-item:hover { | 496 | .aside .box-design-option li .content .color-patterns .color-pattern-item:hover { |
484 | outline: 1px solid #ed1d24; | 497 | outline: 1px solid #ed1d24; |
485 | } | 498 | } |
486 | 499 | ||
487 | .aside .box-design-option li .title .reset-color-patterns { | 500 | .aside .box-design-option li .title .reset-color-patterns { |
488 | cursor: pointer; | 501 | cursor: pointer; |
489 | } | 502 | } |
490 | 503 | ||
491 | .aside .box-design-option li .title .reset-color-patterns:hover { | 504 | .aside .box-design-option li .title .reset-color-patterns:hover { |
492 | opacity: 0.6; | 505 | opacity: 0.6; |
493 | } | 506 | } |
494 | 507 | ||
495 | .aside .box-design-option li .content .layer-item { | 508 | .aside .box-design-option li .content .layer-item { |
496 | text-align: center; | 509 | text-align: center; |
497 | border: 1px #ddd solid; | 510 | border: 1px #ddd solid; |
498 | background: #FFF; | 511 | background: #FFF; |
499 | padding: 5px; | 512 | padding: 5px; |
500 | font-size: 12px; | 513 | font-size: 12px; |
501 | cursor: pointer; | 514 | cursor: pointer; |
502 | } | 515 | } |
503 | 516 | ||
504 | .aside .box-design-option li .content .layer-item:hover { | 517 | .aside .box-design-option li .content .layer-item:hover { |
505 | background: #ffcccc; | 518 | background: #ffcccc; |
506 | } | 519 | } |
507 | 520 | ||
508 | 521 | ||
509 | /*Design Text*/ | 522 | /*Design Text*/ |
510 | .aside #choice-text{ | 523 | .aside #choice-text{ |
511 | 524 | ||
512 | } | 525 | } |
513 | .aside #choice-text .content{ | 526 | .aside #choice-text .content{ |
514 | padding: 10px 10px; | 527 | padding: 10px 10px; |
515 | } | 528 | } |
516 | .aside #choice-text .content ul.font-family-box{ | 529 | .aside #choice-text .content ul.font-family-box{ |
517 | list-style: none; | 530 | list-style: none; |
518 | margin: 10px 0; | 531 | margin: 10px 0; |
519 | padding-left: 0; | 532 | padding-left: 0; |
520 | height: 180px; | 533 | height: 180px; |
521 | width: 100%; | 534 | width: 100%; |
522 | overflow-y: scroll; | 535 | overflow-y: scroll; |
523 | border: 1px solid #c0c0c0; | 536 | border: 1px solid #c0c0c0; |
524 | } | 537 | } |
525 | 538 | ||
526 | .aside #choice-text .content .font-family-box li{ | 539 | .aside #choice-text .content .font-family-box li{ |
527 | cursor: pointer; | 540 | cursor: pointer; |
528 | padding: 4px 8px; | 541 | padding: 4px 8px; |
529 | border: 0; | 542 | border: 0; |
530 | border-bottom: 1px solid #c0c0c0; | 543 | border-bottom: 1px solid #c0c0c0; |
531 | border-right: 1px solid #c0c0c0; | 544 | border-right: 1px solid #c0c0c0; |
532 | font-size: 16px; | 545 | font-size: 16px; |
546 | margin-bottom: 0; | ||
533 | } | 547 | } |
548 | .aside #choice-text .content .font-family-box li.active{ | ||
549 | border: 1px solid #fe070f; | ||
550 | } | ||
534 | .aside #choice-text .content .spacing-letter{ | 551 | .aside #choice-text .content .spacing-letter{ |
535 | 552 | ||
536 | } | 553 | } |
537 | .aside #choice-text .content .spacing-letter .text-label{ | 554 | .aside #choice-text .content .spacing-letter .text-label{ |
538 | font-size: 16px; | 555 | font-size: 16px; |
539 | padding: 4px 0; | 556 | padding: 4px 0; |
540 | } | 557 | } |
541 | .aside #choice-text .content .spacing-letter .box{ | 558 | .aside #choice-text .content .spacing-letter .box{ |
542 | border: 1px solid #8c8c8c; | 559 | border: 1px solid #8c8c8c; |
543 | box-shadow: 0 0 5px #888888; | 560 | box-shadow: 0 0 5px #888888; |
544 | background-color: #f0f0f0; | 561 | background-color: #f0f0f0; |
545 | } | 562 | } |
546 | .aside #choice-text .content .spacing-letter .item{ | 563 | .aside #choice-text .content .spacing-letter .item{ |
547 | float: left; | 564 | float: left; |
548 | } | 565 | } |
566 | .aside #choice-text .content .spacing-letter .item:hover{ | ||
567 | background-color: #fddad4; | ||
568 | } | ||
549 | 569 | ||
550 | .aside #choice-text .content .spacing-letter .item i.fa{ | 570 | .aside #choice-text .content .spacing-letter .item i.fa{ |
551 | font-size: 22px; | 571 | font-size: 22px; |
552 | margin: 0 0; | 572 | margin: 0 0; |
553 | color: #000000; | 573 | color: #000000; |
554 | } | 574 | } |
555 | .aside #choice-text .content .spacing-letter .item-text{ | 575 | .aside #choice-text .content .spacing-letter .item-text{ |
556 | padding: 6px 20px; | 576 | padding: 6px 20px; |
557 | font-size: 12px; | 577 | font-size: 13px; |
558 | } | 578 | } |
559 | .aside #choice-text .content .spacing-letter .item-plus{ | 579 | .aside #choice-text .content .spacing-letter .item-plus{ |
560 | border-right: 1px solid #8c8c8c; | 580 | border-right: 1px solid #8c8c8c; |
561 | } | 581 | } |
562 | .aside #choice-text .content .spacing-letter .item-minus{ | 582 | .aside #choice-text .content .spacing-letter .item-minus{ |
563 | border-left: 1px solid #8c8c8c; | 583 | border-left: 1px solid #8c8c8c; |
564 | } | 584 | } |
565 | .aside #choice-text .content .spacing-letter .item-plus, .aside #choice-text .content .spacing-letter .item-minus { | 585 | .aside #choice-text .content .spacing-letter .item-plus, .aside #choice-text .content .spacing-letter .item-minus { |
566 | padding: 5px 6px 1px 6px; | 586 | padding: 5px 6px 1px 6px; |
567 | cursor: pointer; | 587 | cursor: pointer; |
568 | } | 588 | } |
569 | /*Design Choice Illustration*/ | 589 | /*Design Choice Illustration*/ |
570 | .aside #choice-illustration li .content { | 590 | .aside #choice-illustration li .content { |
571 | padding: 10px 10px; | 591 | padding: 10px 10px; |
572 | } | 592 | } |
573 | 593 | ||
574 | .aside #choice-illustration li .content select{ | 594 | .aside #choice-illustration li .content select{ |
575 | width: 100%; | 595 | width: 100%; |
576 | } | 596 | } |
577 | 597 | ||
578 | .aside #choice-illustration li .content .illustration-list { | 598 | .aside #choice-illustration li .content .illustration-list { |
579 | width: 100%; | 599 | width: 100%; |
580 | border: #bbb solid 1px; | 600 | border: #bbb solid 1px; |
581 | background: #FFF; | 601 | background: #FFF; |
582 | margin-top: 5px; | 602 | margin-top: 5px; |
583 | min-height: 310px; | 603 | min-height: 310px; |
584 | padding-bottom: 20px; | 604 | padding-bottom: 20px; |
585 | } | 605 | } |
586 | 606 | ||
587 | .aside #choice-illustration li .content .illustration-list .illstration-item{ | 607 | .aside #choice-illustration li .content .illustration-list .illstration-item{ |
588 | height: 60px; | 608 | height: 60px; |
589 | overflow: hidden; | 609 | overflow: hidden; |
590 | float: left; | 610 | float: left; |
591 | margin-left: 6px; | 611 | margin-left: 6px; |
592 | margin-top: 5px; | 612 | margin-top: 5px; |
593 | margin-bottom: 5px; | 613 | margin-bottom: 5px; |
594 | padding: 2px; | 614 | padding: 2px; |
595 | background: #e2e2e2; | 615 | background: #e2e2e2; |
596 | border: solid 2px #d7d7d7; | 616 | border: solid 2px #d7d7d7; |
597 | cursor: pointer; | 617 | cursor: pointer; |
598 | } | 618 | } |
599 | 619 | ||
600 | .aside #choice-illustration li .content .illustration-list .illstration-item:hover { | 620 | .aside #choice-illustration li .content .illustration-list .illstration-item:hover { |
601 | outline: 2px solid #ed1d24; | 621 | outline: 2px solid #ed1d24; |
602 | } | 622 | } |
603 | 623 | ||
604 | .aside #choice-illustration li .content .illustration-list .illstration-item img { | 624 | .aside #choice-illustration li .content .illustration-list .illstration-item img { |
605 | width: 50px; | 625 | width: 50px; |
606 | cursor: pointer; | 626 | cursor: pointer; |
607 | } | 627 | } |
608 | 628 | ||
609 | .aside #choice-illustration li .content .illustration-list .footer-bar { | 629 | .aside #choice-illustration li .content .illustration-list .footer-bar { |
610 | text-align: center; | 630 | text-align: center; |
611 | margin-top: 5px; | 631 | margin-top: 5px; |
612 | bottom: 10px; | 632 | bottom: 10px; |
613 | position: absolute; | 633 | position: absolute; |
614 | width: 100%; | 634 | width: 100%; |
615 | padding-right: 20px; | 635 | padding-right: 20px; |
616 | } | 636 | } |
617 | .aside #choice-illustration li .content .illustration-list .footer-bar .footer-pagination { | 637 | .aside #choice-illustration li .content .illustration-list .footer-bar .footer-pagination { |
618 | margin-right: 5px; | 638 | margin-right: 5px; |
619 | cursor: pointer; | 639 | cursor: pointer; |
620 | font-size: 9px; | 640 | font-size: 9px; |
621 | color: #FFF; | 641 | color: #FFF; |
622 | background: #666666; | 642 | background: #666666; |
623 | text-transform: uppercase; | 643 | text-transform: uppercase; |
624 | padding: 2px 5px; | 644 | padding: 2px 5px; |
625 | } | 645 | } |
626 | 646 | ||
627 | .aside #choice-illustration li .content .illustration-list .footer-bar .footer-pagination:hover { | 647 | .aside #choice-illustration li .content .illustration-list .footer-bar .footer-pagination:hover { |
628 | background: #999999; | 648 | background: #999999; |
629 | } | 649 | } |
630 | .tooltip-arrow, | 650 | .tooltip-arrow, |
631 | .red-tooltip + .tooltip > .tooltip-inner { | 651 | .red-tooltip + .tooltip > .tooltip-inner { |
632 | background-color: #FFF; | 652 | background-color: #FFF; |
633 | margin:0; | 653 | margin:0; |
634 | padding:0; | 654 | padding:0; |
635 | } | 655 | } |
636 | 656 | ||
637 | /* Insert image*/ | 657 | /* Insert image*/ |
638 | #btn-choose-image { | 658 | #btn-choose-image { |
639 | background: #ff0f00; | 659 | background: #ff0f00; |
640 | cursor: pointer; | 660 | cursor: pointer; |
641 | margin: 10px 0px; | 661 | margin: 10px 0px; |
642 | padding: 0 10px; | 662 | padding: 0 10px; |
643 | color: #FFF; | 663 | color: #FFF; |
644 | font-size: 12px; | 664 | font-size: 12px; |
645 | } | 665 | } |
646 | 666 | ||
647 | #btn-choose-image:hover { | 667 | #btn-choose-image:hover { |
648 | background: #f8aeae; | 668 | background: #f8aeae; |
649 | } | 669 | } |
650 | 670 | ||
651 | .aside #choice-image li .content { | 671 | .aside #choice-image li .content { |
652 | margin: 0 10px; | 672 | margin: 0 10px; |
653 | padding: 10px 0; | 673 | padding: 10px 0; |
654 | } | 674 | } |
655 | 675 | ||
656 | .aside #choice-image li .content .small-text { | 676 | .aside #choice-image li .content .small-text { |
657 | font-size:10px; | 677 | font-size:10px; |
658 | margin-bottom: 10px; | 678 | margin-bottom: 10px; |
659 | } | 679 | } |
660 | 680 | ||
661 | .aside #choice-image { | 681 | .aside #choice-image { |
662 | font-size: 13px; | 682 | font-size: 13px; |
663 | } | 683 | } |
664 | 684 | ||
665 | .aside #imgLoader{ | 685 | .aside #imgLoader{ |
666 | display: none; | 686 | display: none; |
667 | } | 687 | } |
668 | 688 | ||
669 | .aside #choice-image li .content .list-images { | 689 | .aside #choice-image li .content .list-images { |
670 | height: 300px; | 690 | height: 300px; |
671 | background: #FFF; | 691 | background: #FFF; |
672 | border: 1px solid #DDD; | 692 | border: 1px solid #DDD; |
673 | } | 693 | } |
674 | 694 | ||
675 | .aside #choice-image li .content .list-images .recent-img{ | 695 | .aside #choice-image li .content .list-images .recent-img{ |
676 | height: 60px; | 696 | height: 60px; |
677 | overflow: hidden; | 697 | overflow: hidden; |
678 | float: left; | 698 | float: left; |
679 | margin-left: 6px; | 699 | margin-left: 6px; |
680 | margin-top: 5px; | 700 | margin-top: 5px; |
681 | margin-bottom: 5px; | 701 | margin-bottom: 5px; |
682 | padding: 2px; | 702 | padding: 2px; |
683 | background: #e2e2e2; | 703 | background: #e2e2e2; |
684 | border: solid 2px #d7d7d7; | 704 | border: solid 2px #d7d7d7; |
685 | cursor: pointer; | 705 | cursor: pointer; |
686 | } | 706 | } |
687 | 707 | ||
688 | .aside #choice-image li .content .list-images .recent-img:hover { | 708 | .aside #choice-image li .content .list-images .recent-img:hover { |
689 | outline: 2px solid #ed1d24; | 709 | outline: 2px solid #ed1d24; |
690 | } | 710 | } |
691 | 711 | ||
692 | .aside #choice-image li .content .list-images .recent-img img { | 712 | .aside #choice-image li .content .list-images .recent-img img { |
693 | width: 50px; | 713 | width: 50px; |
694 | cursor: pointer; | 714 | cursor: pointer; |
695 | } | 715 | } |
696 | 716 | ||
697 | /*Design content*/ | 717 | /*Design content*/ |
698 | .tshirt-design-container{ | 718 | .tshirt-design-container{ |
699 | position: relative; | 719 | position: relative; |
700 | } | 720 | } |
701 | .tshirt-design-container .design-content{ | 721 | .tshirt-design-container .design-content{ |
702 | padding: 10px 30px 10px 15px; | 722 | padding: 10px 0; |
723 | /*width: 100%;*/ | ||
703 | } | 724 | } |
704 | .tshirt-design-container .design-content .content{ | 725 | .tshirt-design-container .design-content .content{ |
705 | width: 100%; | 726 | width: 100%; |
727 | height: 100%; | ||
706 | min-height: 650px; | 728 | min-height: 650px; |
707 | background-color: #f0efea; | 729 | background-color: #f0efea; |
708 | padding: 40px 40px; | 730 | padding: 40px 40px; |
709 | height: 100%; | 731 | /*display: table-cell;*/ |
710 | } | 732 | } |
711 | .tshirt-design-container .design-content .content .selection-design{ | 733 | .tshirt-design-container .design-content .content .selection-design{ |
712 | border: 1px solid #ff0000; | 734 | border: 1px solid #ff0000; |
713 | width: 100%; | 735 | width: 100%; |
714 | height: 620px; | 736 | height: 620px; |
715 | } | 737 | } |
716 | .tshirt-design-container .agree-design{ | 738 | .tshirt-design-container .agree-design{ |
717 | position: absolute; | 739 | position: absolute; |
718 | right: -16px; | 740 | right: -16px; |
719 | top: 40%; | 741 | top: 40%; |
720 | cursor: pointer; | 742 | cursor: pointer; |
721 | } | 743 | } |
722 | .tshirt-design-container .agree-design:hover{ | 744 | .tshirt-design-container .agree-design:hover{ |
723 | opacity: 0.8; | 745 | opacity: 0.8; |
724 | } | 746 | } |
725 | .tshirt-design-container .trash-design{ | 747 | .tshirt-design-container .trash-design{ |
726 | position: absolute; | 748 | position: absolute; |
727 | right: 5px; | 749 | right: 5px; |
728 | bottom: 0; | 750 | bottom: 0; |
729 | } | 751 | } |
730 | .tshirt-design-container .trash-design:hover{ | 752 | .tshirt-design-container .trash-design:hover{ |
731 | opacity: 0.5; | 753 | opacity: 0.5; |
732 | } | 754 | } |
733 | 755 | ||
734 | 756 | ||
735 | 757 | ||
736 | /*FOOTER*/ | 758 | /*FOOTER*/ |
737 | footer{ | 759 | footer{ |
738 | background-color: #333333; | 760 | background-color: #333333; |
739 | } | 761 | } |
740 | footer ul.nav-footer{ | 762 | footer ul.nav-footer{ |
741 | padding-left: 0; | 763 | padding-left: 0; |
742 | list-style: none; | 764 | list-style: none; |
743 | } | 765 | } |
744 | footer ul.nav-footer li{ | 766 | footer ul.nav-footer li{ |
745 | float: left; | 767 | float: left; |
746 | padding: 3px 10px; | 768 | padding: 3px 10px; |
747 | border-right: 1px dotted #ffffff; | 769 | border-right: 1px dotted #ffffff; |
748 | 770 | ||
749 | } | 771 | } |
750 | footer ul.nav-footer li a{ | 772 | footer ul.nav-footer li a{ |
751 | color: #ffffff; | 773 | color: #ffffff; |
752 | font-size: 11px; | 774 | font-size: 11px; |
753 | } | 775 | } |
754 | /* Customize container */ | 776 | /* Customize container */ |
755 | @media (min-width: 768px) { | 777 | @media (min-width: 768px) { |
756 | .container { | 778 | .container { |
757 | /*max-width: 730px;*/ | 779 | /*max-width: 730px;*/ |
758 | } | 780 | } |
759 | } | 781 | } |
760 | 782 | ||
761 | /* Responsive: Portrait tablets and up */ | 783 | /* Responsive: Portrait tablets and up */ |
762 | @media screen and (min-width: 768px) { | 784 | @media screen and (min-width: 768px) { |
763 | /* Remove the padding we set earlier */ | 785 | /* Remove the padding we set earlier */ |
764 | 786 | ||
765 | } | 787 | } |
766 | 788 | ||
767 | @media (min-width: 1024px) { | 789 | @media (min-width: 1024px) { |
768 | #tshirt-design .modal-dialog{ | 790 | #tshirt-design .modal-dialog{ |
769 | min-width: 1000px; | 791 | min-width: 1000px; |
792 | width: 1000px; | ||
770 | } | 793 | } |
771 | } | 794 | } |
772 | 795 | ||
773 | @media (max-width: 1200px) { | 796 | @media (max-width: 1200px) { |
774 | #preview-design { | 797 | #preview-design { |
775 | left: 155px; | 798 | left: 155px; |
776 | } | 799 | } |
777 | } | 800 | } |
778 | 801 | ||
779 | @media (max-width: 990px) { | 802 | @media (max-width: 990px) { |
780 | #preview-design { | 803 | #preview-design { |
781 | left: 115px; | 804 | /*left: 115px;*/ |
782 | width: 120px; | 805 | width: 110px; |
783 | height: 162px; | 806 | height: 200px; |
784 | bottom: 150px; | 807 | top: 100px; |
808 | } | ||
809 | } | ||
810 | |||
811 | @media (max-width: 762px) { | ||
812 | .modal-dialog{ | ||
813 | /*width: 100%!important;*/ | ||
814 | margin: 0 0!important; | ||
815 | } | ||
816 | #tshirt-design header .menu-nav{ | ||
817 | overflow-x: scroll!important; | ||
818 | -webkit-overflow-scrolling: touch; | ||
819 | } | ||
820 | |||
821 | #tshirt-design header ul.nav { | ||
822 | text-align: justify; | ||
823 | width: 680px; | ||
824 | |||
825 | } | ||
826 | |||
827 | #tshirt-design header ul.nav li { | ||
828 | display: inline-block; /* 6 */ | ||
829 | } | ||
830 | |||
831 | .tshirt-design-container .design-content .content{ | ||
832 | padding: 14px 14px; | ||
833 | } | ||
834 | .tshirt-design-container .design-content{ | ||
835 | padding: 0 0; | ||
785 | } | 836 | } |
786 | } | 837 | } |
app/views/design_part/text.html
1 | <li> | 1 | <li> |
2 | <div class="title"> | 2 | <div class="title"> |
3 | <!--<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>--> | 3 | <!--<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>--> |
4 | 文字入力 | 4 | 文字入力 |
5 | </div> | 5 | </div> |
6 | <div class="content clearfix"> | 6 | <div class="content clearfix"> |
7 | <div> | 7 | <div> |
8 | <input type="text" class="form-control" placeholder="ここに入力してください。" id="input-design-text" ng-focus="focusInputText(designText)" ng-change="inputText(designText)" ng-model="designText" ng-value="designTextValue"> | 8 | <input type="text" class="form-control" placeholder="ここに入力してください。" id="input-design-text" ng-focus="focusInputText(designText)" ng-change="inputText(designText)" ng-model="designText" ng-value="designTextValue"> |
9 | </div> | 9 | </div> |
10 | <div> | 10 | <div> |
11 | <ul class="font-family-box"> | 11 | <ul class="font-family-box"> |
12 | <li ng-repeat="item in listFontFamily" ng-click="setFontFamily(item.slug)" ng-style="{'font-family' : item.slug}">{{ item.name }}</li> | 12 | <li ng-repeat="(index,item) in listFontFamily" ng-click="setFontFamily(item.slug, index)" ng-style="{'font-family' : item.slug}" ng-class="{active: itemFont == index}">{{ item.name }}</li> |
13 | </ul> | 13 | </ul> |
14 | </div> | 14 | </div> |
15 | <div> | 15 | |
16 | <div ng-click="rotateText('1')">文字を変形する</div> | ||
17 | </div> | ||
18 | <div class="clearfix spacing-letter "> | 16 | <div class="clearfix spacing-letter "> |
19 | <div class="pull-left text-label"> | 17 | <div class="pull-left text-label"> |
20 | 文字間隔 : | 18 | 文字間隔 : |
21 | </div> | 19 | </div> |
22 | <div class="pull-right"> | 20 | <div class="pull-right"> |
23 | <div class="box clearfix"> | 21 | <div class="box clearfix"> |
24 | <div class="item item-plus" ng-click="setLetterSpacingText('plus')"> | 22 | <div class="item item-plus" ng-click="setLetterSpacingText('plus')"> |
25 | <i class="fa fa-plus-square-o" aria-hidden="true"></i> | 23 | <i class="fa fa-plus-square-o" aria-hidden="true"></i> |
26 | </div> | 24 | </div> |
27 | <div class="item item-text"> | 25 | <div class="item item-text" style="cursor: pointer" ng-click="setLetterSpacingTextDefault()"> |
28 | リセット | 26 | リセット |
29 | </div> | 27 | </div> |
30 | <div class="item item-minus" ng-click="setLetterSpacingText('minus')"> | 28 | <div class="item item-minus" ng-click="setLetterSpacingText('minus')"> |
31 | <i class="fa fa-minus-square-o" aria-hidden="true"></i> | 29 | <i class="fa fa-minus-square-o" aria-hidden="true"></i> |
32 | </div> | 30 | </div> |
33 | </div> | 31 | </div> |
34 | </div> | 32 | </div> |
35 | </div> | 33 | </div> |
36 | </div> | 34 | </div> |
37 | </li> | 35 | </li> |
38 | <li> | 36 | <li> |
39 | <div class="title"> | 37 | <div class="title"> |
40 | <!--<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>--> | 38 | <!--<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>--> |
41 | カラー変更 | 39 | カラー変更 |
42 | <!--<div class="pull-right">元の色に戻す</div>--> | 40 | <!--<div class="pull-right">元の色に戻す</div>--> |
43 | </div> | 41 | </div> |
44 | <div class="content clearfix"> | 42 | <div class="content clearfix"> |
45 | <div class="color-patterns"> | 43 | <div class="color-patterns"> |
46 | <div class="color-pattern-item" ng-repeat="color in listColorPatterns track by $index" ng-click="changeColorPattern(color)" ng-style="{'background-color': color}"> | 44 | <div class="color-pattern-item" ng-repeat="color in listColorPatterns track by $index" ng-click="changeColorPattern(color)" ng-style="{'background-color': color}"> |
47 | </div> | 45 | </div> |
48 | <div class="clearfix"></div> | 46 | <div class="clearfix"></div> |
49 | </div> | 47 | </div> |
50 | </div> | 48 | </div> |
51 | </li> | 49 | </li> |
52 | 50 | ||
53 | <li> | 51 | <li> |
54 | <div class="title"> | 52 | <div class="title"> |
55 | <!--<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>--> | 53 | <!--<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>--> |
56 | 重ね順変更 | 54 | 重ね順変更 |
57 | </div> | 55 | </div> |
58 | <div class="content clearfix"> | 56 | <div class="content clearfix"> |
59 | <div class="col-xs-3 layer-item" ng-click="layerProcess(1)"> | 57 | <div class="col-xs-3 layer-item" ng-click="layerProcess(1)"> |
60 | <img src="images/layer-icon-1.png"/> | 58 | <img src="images/layer-icon-1.png"/> |
61 | <div>前面へ</div> | 59 | <div>前面へ</div> |
62 | </div> | 60 | </div> |
63 | <div class="col-xs-3 layer-item" ng-click="layerProcess(2)"> | 61 | <div class="col-xs-3 layer-item" ng-click="layerProcess(2)"> |
64 | <img src="images/layer-icon-2.png"/> | 62 | <img src="images/layer-icon-2.png"/> |
65 | <div>背面へ</div> | 63 | <div>背面へ</div> |
66 | </div> | 64 | </div> |
67 | <div class="col-xs-3 layer-item" ng-click="layerProcess(3)"> | 65 | <div class="col-xs-3 layer-item" ng-click="layerProcess(3)"> |
68 | <img src="images/layer-icon-3.png"/> | 66 | <img src="images/layer-icon-3.png"/> |
69 | <div>最前面へ</div> | 67 | <div>最前面へ</div> |
70 | </div> | 68 | </div> |
71 | <div class="col-xs-3 layer-item" ng-click="layerProcess(4)"> | 69 | <div class="col-xs-3 layer-item" ng-click="layerProcess(4)"> |
72 | <img src="images/layer-icon-4.png"/> | 70 | <img src="images/layer-icon-4.png"/> |
73 | <div>最前面へ</div> | 71 | <div>最前面へ</div> |
74 | </div> | 72 | </div> |
75 | </div> | 73 | </div> |
76 | </li> | 74 | </li> |
77 | 75 |
app/views/tshirt-design.html
1 | <!-- Modal --> | 1 | <!-- Modal --> |
2 | <div class="modal fade" id="tshirt-design" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" ng-controller="TshirtdesignCtrl"> | 2 | <div class="modal fade" id="tshirt-design" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" ng-controller="TshirtdesignCtrl"> |
3 | 3 | ||
4 | <div class="modal-dialog" role="document"> | 4 | <div class="modal-dialog" role="document"> |
5 | <div class="modal-content"> | 5 | <div class="modal-content"> |
6 | <div class="modal-header"> | 6 | <div class="modal-header"> |
7 | <button class="black" ng-click="modalClose()"><i class="fa fa-times" aria-hidden="true"></i> キャンセル</button> | 7 | <button class="black" ng-click="modalClose()"><i class="fa fa-times" aria-hidden="true"></i> キャンセル</button> |
8 | <button class="black"> <i class="fa fa-angle-right" aria-hidden="true"></i> はじめての方へ</button> | 8 | <button class="black"> <i class="fa fa-angle-right" aria-hidden="true"></i> はじめての方へ</button> |
9 | </div> | 9 | </div> |
10 | <div class="modal-body"> | 10 | <div class="modal-body"> |
11 | <header class="clearfix"> | 11 | <header class="clearfix"> |
12 | <ul class="nav pull-left"> | 12 | <div class="menu-nav"> |
13 | <li ng-class="{'active': isShowLeftPanel=='text'}" ng-click="showDesignTab('text')"> | 13 | <ul class="nav pull-left"> |
14 | <i class="fa fa-jpy" aria-hidden="true"></i> 文字 | 14 | <li ng-class="{'active': isShowLeftPanel=='text'}" ng-click="showDesignTab('text')"> |
15 | </li> | 15 | <i class="fa fa-jpy" aria-hidden="true"></i> 文字 |
16 | <li ng-class="{'active': isShowLeftPanel=='illustration'}" ng-click="showDesignTab('illustration')"> | 16 | </li> |
17 | <i class="fa fa-btc" aria-hidden="true"></i> イラスト・イメージ | 17 | <li ng-class="{'active': isShowLeftPanel=='illustration'}" ng-click="showDesignTab('illustration')"> |
18 | </li> | 18 | <i class="fa fa-btc" aria-hidden="true"></i> イラスト・イメージ |
19 | <li ng-class="{'active': isShowLeftPanel=='image'}" ng-click="showDesignTab('image')"> | 19 | </li> |
20 | <i class="fa fa-money" aria-hidden="true"></i> 自分の画像・写真 | 20 | <li ng-class="{'active': isShowLeftPanel=='image'}" ng-click="showDesignTab('image')"> |
21 | </li> | 21 | <i class="fa fa-money" aria-hidden="true"></i> 自分の画像・写真 |
22 | <li ng-click="canvasClearAll()"> | 22 | </li> |
23 | <i class="fa fa-minus-circle" aria-hidden="true"></i> 全消去 | 23 | <li ng-click="canvasClearAll()"> |
24 | </li> | 24 | <i class="fa fa-minus-circle" aria-hidden="true"></i> 全消去 |
25 | </ul> | 25 | </li> |
26 | </ul> | ||
27 | </div> | ||
28 | |||
26 | <div class="action pull-right"> | 29 | <div class="action pull-right"> |
27 | <button class="white"> | 30 | <button class="white"> |
28 | アルバムを開く | 31 | アルバムを開く |
29 | </button> | 32 | </button> |
30 | <button class="white"> | 33 | <button class="white"> |
31 | アルバムに入れる | 34 | アルバムに入れる |
32 | </button> | 35 | </button> |
33 | </div> | 36 | </div> |
34 | </header> | 37 | </header> |
35 | <section class="tshirt-design-container clearfix"> | 38 | <section class="tshirt-design-container clearfix"> |
36 | <div class="aside col-sm-4"> | 39 | <div class="aside col-sm-4"> |
37 | <!-- Default--> | 40 | <!-- Default--> |
38 | <ul class="box-design-option" id="choice-design-option" ng-show="isShowLeftPanel=='default' " ng-include="designPartDefault"> | 41 | <ul class="box-design-option" id="choice-design-option" ng-show="isShowLeftPanel=='default' " ng-include="designPartDefault"> |
39 | </ul> | 42 | </ul> |
40 | <!-- Illustration design--> | 43 | <!-- Illustration design--> |
41 | <ul class="box-design-option" id="choice-illustration" ng-show="isShowLeftPanel=='illustration'" ng-include="designPartIllustration"> | 44 | <ul class="box-design-option" id="choice-illustration" ng-show="isShowLeftPanel=='illustration'" ng-include="designPartIllustration"> |
42 | </ul> | 45 | </ul> |
43 | <!-- Custom image design--> | 46 | <!-- Custom image design--> |
44 | <ul class="box-design-option" id="choice-image" ng-show="isShowLeftPanel=='image'" ng-include="designPartImage"> | 47 | <ul class="box-design-option" id="choice-image" ng-show="isShowLeftPanel=='image'" ng-include="designPartImage"> |
45 | </ul> | 48 | </ul> |
46 | <!-- Text design--> | 49 | <!-- Text design--> |
47 | <ul class="box-design-option" id="choice-text" ng-show="isShowLeftPanel=='text'" ng-include="designPartText"> | 50 | <ul class="box-design-option" id="choice-text" ng-show="isShowLeftPanel=='text'" ng-include="designPartText"> |
48 | </ul> | 51 | </ul> |
49 | </div> | 52 | </div> |
50 | <div class="design-content col-sm-8"> | 53 | <div class="col-sm-8"> |
51 | <div class="content" ng-style="{'background-color' : tShirtColorCode}"> | 54 | <div class="design-content " id="main-design-content"> |
52 | <canvas id="main-design-container" width="510px" height="620px" class="selection-design lower-canvas"> | 55 | <!--<button ng-click="objectDone()" >OK</button>--> |
53 | 56 | <div class="content" id="main-design" ng-style="{'background-color' : tShirtColorCode}"> | |
54 | </canvas> | 57 | <canvas id="main-design-container" class="selection-design lower-canvas" style="width: 100%"> |
58 | </canvas> | ||
59 | </div> | ||
60 | <div class="agree-design" ng-click="outputDesign()"> | ||
61 | <img src="images/agree-design.png" alt="agree design" /> | ||
62 | </div> | ||
63 | <div class="trash-design"> | ||
64 | <!--<span ng-click="undoCanvas()" class="fa fa-undo"> Undo</span><br>--> | ||
65 | <!--<span ng-click="redoCanvas()" class="fa fa-repeat"> Redo</span><br>--> | ||
66 | <img src="images/trash.png" alt="trash design" /> | ||
67 | </div> | ||
55 | </div> | 68 | </div> |
56 | <div class="agree-design" ng-click="outputDesign()"> | ||
57 | <img src="images/agree-design.png" alt="agree design" /> | ||
58 | </div> | ||
59 | <div class="trash-design"> | ||
60 | <!--<span ng-click="undoCanvas()" class="fa fa-undo"> Undo</span><br>--> | ||
61 | <!--<span ng-click="redoCanvas()" class="fa fa-repeat"> Redo</span><br>--> | ||
62 | <img src="images/trash.png" alt="trash design" /> | ||
63 | </div> |