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