Commit 0136530e3c6af7db3441f90b2946d319da581c73
1 parent
21f9ba3164
Exists in
master
and in
1 other branch
Commit code
Showing 5 changed files with 57 additions and 33 deletions Side-by-side Diff
app/scripts/controllers/main.js
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | $scope.designPartText = 'views/design_part/text.html?ver='+VERSION; |
10 | 10 | $scope.designPartDefault = 'views/design_part/default.html?ver='+VERSION; |
11 | 11 | var currentTShirtKey = 0; |
12 | - var placeTShirt; | |
12 | + var placeTShirtKey = ''; | |
13 | 13 | var tShirtColorFirstKey = 0; |
14 | 14 | $scope.tShirtChoiceBackFrontKey = 'front'; |
15 | 15 | $scope.tShirtColorKey = tShirtColorFirstKey; |
... | ... | @@ -23,7 +23,8 @@ |
23 | 23 | if(typeof _routeParams.tShirt != 'undefined') |
24 | 24 | currentTShirtKey = _routeParams.tShirt - 1; |
25 | 25 | if(typeof _routeParams.place != 'undefined') |
26 | - placeTShirt = _routeParams.place; | |
26 | + placeTShirtKey = _routeParams.place; | |
27 | + console.log(placeTShirtKey); | |
27 | 28 | |
28 | 29 | |
29 | 30 | /** |
... | ... | @@ -31,6 +32,8 @@ |
31 | 32 | * @param: id |
32 | 33 | * @return: object |
33 | 34 | */ |
35 | + $scope.placeTshirt = $t_shirt.getTShirtPlace(currentTShirtKey, placeTShirtKey); | |
36 | + console.log($scope.placeTshirt); | |
34 | 37 | $scope.tShirtColor = $t_shirt.getTShirtColor(currentTShirtKey); |
35 | 38 | $rootScope.tShirtColorCode = $scope.tShirtColor[tShirtColorFirstKey].code; |
36 | 39 | $scope.tShirtColorName = $scope.tShirtColor[tShirtColorFirstKey].name; |
app/scripts/services/tshirt.js
... | ... | @@ -12,15 +12,15 @@ |
12 | 12 | image: '' |
13 | 13 | }, |
14 | 14 | place_design: { |
15 | - 'place_1' : { | |
15 | + place_1 : { | |
16 | 16 | 'face' : 'front', |
17 | 17 | 'place' : 't_shirt_p_1' |
18 | 18 | }, |
19 | - 'place_2' : { | |
20 | - 'face' : 'front', | |
19 | + place_2 : { | |
20 | + 'face' : 'back', | |
21 | 21 | 'place' : 't_shirt_p_2' |
22 | 22 | }, |
23 | - 'place_3' : { | |
23 | + place_3 : { | |
24 | 24 | 'face' : 'front', |
25 | 25 | 'place' : 't_shirt_p_3' |
26 | 26 | } |
... | ... | @@ -60,7 +60,16 @@ |
60 | 60 | gender: '', |
61 | 61 | image: '' |
62 | 62 | }, |
63 | - place_design: {}, | |
63 | + place_design: { | |
64 | + place_1 : { | |
65 | + 'face' : 'front', | |
66 | + 'place' : 't_shirt_p_1' | |
67 | + }, | |
68 | + place_2 : { | |
69 | + 'face' : 'front', | |
70 | + 'place' : 't_shirt_p_2' | |
71 | + } | |
72 | + }, | |
64 | 73 | color: [ |
65 | 74 | { |
66 | 75 | name: 'color:03 GRAY', |
67 | 76 | |
... | ... | @@ -146,10 +155,10 @@ |
146 | 155 | return DATA[key]['color']; |
147 | 156 | }, |
148 | 157 | getTShirtPlace : function(key, place) { |
149 | - if(typeof DATA[key].place_design.place == 'undefined' || typeof DATA[key].place_design.place == 'null') | |
158 | + if(typeof DATA[key].place_design[place] == 'undefined' || typeof DATA[key].place_design[place] == 'null') | |
150 | 159 | return []; |
151 | 160 | |
152 | - return DATA[key].place_design.place; | |
161 | + return DATA[key].place_design[place]; | |
153 | 162 | }, |
154 | 163 | |
155 | 164 | getAll: function(){ |
app/styles/main.css
1 | 1 | /* Space out content a bit */ |
2 | 2 | @import "../fonts/font.css"; |
3 | 3 | @import "../fonts/font_canvas/font-canvas.css"; |
4 | +@import "placedesign.css"; | |
4 | 5 | html{ |
5 | 6 | height:100%; |
6 | 7 | width:100%; |
... | ... | @@ -323,20 +324,6 @@ |
323 | 324 | width: 100%; |
324 | 325 | } |
325 | 326 | |
326 | -#preview-design { | |
327 | - position: absolute; | |
328 | - width: 190px; | |
329 | - height: 200px; | |
330 | - border: dashed 2px #DDD; | |
331 | - top: 180px; | |
332 | - /*left: 200px;*/ | |
333 | - cursor: pointer; | |
334 | -} | |
335 | - | |
336 | -#preview-design img { | |
337 | - width: 150px; | |
338 | -} | |
339 | - | |
340 | 327 | #tshirt-content .tshirt-choice{ |
341 | 328 | |
342 | 329 | } |
343 | 330 | |
... | ... | @@ -807,18 +794,11 @@ |
807 | 794 | } |
808 | 795 | |
809 | 796 | @media (max-width: 1200px) { |
810 | - #preview-design { | |
811 | - left: 155px; | |
812 | - } | |
797 | + | |
813 | 798 | } |
814 | 799 | |
815 | 800 | @media (max-width: 990px) { |
816 | - #preview-design { | |
817 | - /*left: 115px;*/ | |
818 | - width: 110px; | |
819 | - height: 160px; | |
820 | - top: 110px; | |
821 | - } | |
801 | + | |
822 | 802 | } |
823 | 803 | @media (max-width: 762px) and (min-width: 600px) { |
824 | 804 |
app/styles/placedesign.css
1 | +#preview-design { | |
2 | + position: absolute; | |
3 | + width: 190px; | |
4 | + height: 200px; | |
5 | + border: dashed 2px #DDD; | |
6 | + top: 180px; | |
7 | + /*left: 200px;*/ | |
8 | + cursor: pointer; | |
9 | +} | |
10 | + | |
11 | +#preview-design img { | |
12 | + width: 150px; | |
13 | +} | |
14 | + | |
15 | +@media (max-width: 1200px) { | |
16 | + #preview-design { | |
17 | + left: 155px; | |
18 | + } | |
19 | +} | |
20 | + | |
21 | +@media (max-width: 990px) { | |
22 | + #preview-design { | |
23 | + /*left: 115px;*/ | |
24 | + width: 110px; | |
25 | + height: 160px; | |
26 | + top: 110px; | |
27 | + } | |
28 | +} | |
29 | + | |
30 | +.t_shirt_p_1{ | |
31 | + | |
32 | +} |
app/views/main.html
... | ... | @@ -149,7 +149,7 @@ |
149 | 149 | </div> |
150 | 150 | <div class="tshirt-image"> |
151 | 151 | <img ng-src="{{ tShirtImg }}" alt="" /> |
152 | - <div id="preview-design" ng-click="modalTShirtDesign()"> | |
152 | + <div id="preview-design" ng-show="placeTshirt.face === tShirtChoiceBackFrontKey" class="{{ placeTshirt.place }}" ng-click="modalTShirtDesign()"> | |
153 | 153 | <img ng-src="{{outputImage}}" ng-show="outputImage"/> |
154 | 154 | </div> |
155 | 155 | </div> |