Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/design ui useable #38

Merged
merged 37 commits into from
Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4d12fd3
feat: ui improvement start
jinwoo-kim-nhn Jun 8, 2018
6bede58
feat: shape, draw menu Improved usability.
jinwoo-kim-nhn Jun 11, 2018
2e070e8
middle commit
jinwoo-kim-nhn Jun 11, 2018
a65c61b
add icon add with resize
Jun 11, 2018
9c9f738
icon useable resize icon
Jun 11, 2018
3cff2e4
complete icon menu useable
jinwoo-kim-nhn Jun 12, 2018
694ba62
middle commit
jinwoo-kim-nhn Jun 12, 2018
322a05b
middle commit2
Jun 12, 2018
d8d25f5
fixed middlecommit 3
Jun 12, 2018
59f5b5d
fixed bug all
Jun 13, 2018
504fe05
refactoring icon action
Jun 13, 2018
80b3045
feat: group selction style & action for ui usable
jinwoo-kim-nhn Jun 14, 2018
9aa3f67
fixed: shape stroke limit maxsize
jinwoo-kim-nhn Jun 14, 2018
959258c
fixed: submenu transition and mask apply hidden
Jun 14, 2018
d46b595
fixed crop zone bug
Jun 14, 2018
58be310
fixed action test
Jun 14, 2018
5cd6b06
added big menu tooltip
jinwoo-kim-nhn Jun 15, 2018
ebc9292
crop zone Flicker removal.
jinwoo-kim-nhn Jun 15, 2018
cf932dd
fixed shape standard mode
jinwoo-kim-nhn Jun 15, 2018
e5792cd
fixed shpae change stanbymode bug and filter partition height
jinwoo-kim-nhn Jun 15, 2018
3a41377
added iconsize theme
jinwoo-kim-nhn Jun 15, 2018
6d0cc9b
add jsdoc
jinwoo-kim-nhn Jun 15, 2018
f7a650d
add jsdoc & editor-wrap style
jinwoo-kim-nhn Jun 15, 2018
0527890
add test code job - 1
jinwoo-kim-nhn Jun 15, 2018
f065c12
feat: design - ui useable - add test all
Jun 17, 2018
8f3ae35
fixed undo stack bug
Jun 17, 2018
866158c
broken test fixed
jinwoo-kim-nhn Jun 18, 2018
ba1e4f4
fixed broken test2
jinwoo-kim-nhn Jun 18, 2018
4ed8c4b
fixed broken test 3
jinwoo-kim-nhn Jun 18, 2018
040766a
fixed broken test - 4
jinwoo-kim-nhn Jun 18, 2018
140530c
apply ui review
Jun 18, 2018
e05f58f
fixed: added file cleanup and theme properties.
jinwoo-kim-nhn Jun 19, 2018
c9e429b
fixed typpo
jinwoo-kim-nhn Jun 19, 2018
5368e6e
apply codereview
jinwoo-kim-nhn Jun 19, 2018
80bad1f
add sample bg file
jinwoo-kim-nhn Jun 19, 2018
9b51ae1
fixed broken test
jinwoo-kim-nhn Jun 19, 2018
60d64da
apply codereview
jinwoo-kim-nhn Jun 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed: submenu transition and mask apply hidden
  • Loading branch information
jinwoo-kim-nhn authored and jinwoo-kim-nhn committed Jun 14, 2018
commit 959258ce100e435ea4a4ceab94aea5dfdd2a07e5
2 changes: 1 addition & 1 deletion examples/js/theme/black-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var blackTheme = {
'menu.activeIcon.name': 'icon-a',

// submenu primary color
'submenu.backgroundColor': 'transparent',
'submenu.backgroundColor': '#1e1e1e',
'submenu.partition.color': '#858585',

// submenu icons
Expand Down
131 changes: 62 additions & 69 deletions src/css/buttons.styl
Original file line number Diff line number Diff line change
@@ -1,84 +1,77 @@
/* ICON BUTTON */
.{prefix}-container
#tie-icon-add-button
&.icon-bubble .{prefix}-button[data-icontype="icon-bubble"] svg > use.active,
&.icon-heart .{prefix}-button[data-icontype="icon-heart"] svg > use.active,
&.icon-location .{prefix}-button[data-icontype="icon-location"] svg > use.active,
&.icon-polygon .{prefix}-button[data-icontype="icon-polygon"] svg > use.active,
&.icon-star .{prefix}-button[data-icontype="icon-star"] svg > use.active,
&.icon-arrow-3 .{prefix}-button[data-icontype="icon-arrow-3"] svg > use.active,
&.icon-arrow-2 .{prefix}-button[data-icontype="icon-arrow-2"] svg > use.active,
&.icon-arrow .{prefix}-button[data-icontype="icon-arrow"] svg > use.active,
&.icon-bubble .{prefix}-button[data-icontype="icon-bubble"] svg > use.active
display: block;
#tie-icon-add-button
&.icon-bubble .{prefix}-button[data-icontype="icon-bubble"] svg > use.active,
&.icon-heart .{prefix}-button[data-icontype="icon-heart"] svg > use.active,
&.icon-location .{prefix}-button[data-icontype="icon-location"] svg > use.active,
&.icon-polygon .{prefix}-button[data-icontype="icon-polygon"] svg > use.active,
&.icon-star .{prefix}-button[data-icontype="icon-star"] svg > use.active,
&.icon-arrow-3 .{prefix}-button[data-icontype="icon-arrow-3"] svg > use.active,
&.icon-arrow-2 .{prefix}-button[data-icontype="icon-arrow-2"] svg > use.active,
&.icon-arrow .{prefix}-button[data-icontype="icon-arrow"] svg > use.active,
&.icon-bubble .{prefix}-button[data-icontype="icon-bubble"] svg > use.active
display: block;

/* DRAW BUTTON */
.{prefix}-container
#tie-draw-line-select-button
&.line .{prefix}-button.line svg > use.normal,
&.free .{prefix}-button.free svg > use.normal
display: none;
#tie-draw-line-select-button
&.line .{prefix}-button.line svg > use.normal,
&.free .{prefix}-button.free svg > use.normal
display: none;

&.line .{prefix}-button.line svg > use.active,
&.free .{prefix}-button.free svg > use.active
display: block;
&.line .{prefix}-button.line svg > use.active,
&.free .{prefix}-button.free svg > use.active
display: block;

/* FLIP BUTTON */
.{prefix}-container
#tie-flip-button
&.resetFlip .{prefix}-button.resetFlip,
&.flipX .{prefix}-button.flipX,
&.flipY .{prefix}-button.flipY
svg > use.normal
display: none;
svg > use.active
display: block;
#tie-flip-button
&.resetFlip .{prefix}-button.resetFlip,
&.flipX .{prefix}-button.flipX,
&.flipY .{prefix}-button.flipY
svg > use.normal
display: none;
svg > use.active
display: block;

/* MASK BUTTON */
.{prefix}-container
#tie-mask-apply.apply.active .{prefix}-button.apply
label
color: #fff;
svg > use.active
display: block;
#tie-mask-apply.apply.active .{prefix}-button.apply
label
color: #fff;
svg > use.active
display: block;

/* CROP BUTTON */
.{prefix}-container
#tie-crop-button
.{prefix}-button.apply
margin-right: 24px;
.{prefix}-button.apply.active svg > use.active
display: block;
#tie-crop-button
.{prefix}-button.apply
margin-right: 24px;
.{prefix}-button.apply.active svg > use.active
display: block;


/* SHAPE BUTTON */
.{prefix}-container
#tie-shape-button
&.rect .{prefix}-button.rect,
&.circle .{prefix}-button.circle,
&.triangle .{prefix}-button.triangle
svg > use.normal
display: none;
svg > use.active
display: block;
#tie-shape-button
&.rect .{prefix}-button.rect,
&.circle .{prefix}-button.circle,
&.triangle .{prefix}-button.triangle
svg > use.normal
display: none;
svg > use.active
display: block;

/* TEXT BUTTON */
.{prefix}-container
#tie-text-effect-button
.{prefix}-button.active svg > use.active
display: block;
#tie-text-align-button
&.left .{prefix}-button.left svg > use.active,
&.center .{prefix}-button.center svg > use.active,
&.right .{prefix}-button.right svg > use.active
display: block;
#tie-mask-image-file,
#tie-icon-image-file
opacity: 0;
position: absolute;
width: 100%;
height: 100%;
border: 1px solid green;
cursor: inherit;
left: 0;
top: 0;
#tie-text-effect-button
.{prefix}-button.active svg > use.active
display: block;
#tie-text-align-button
&.left .{prefix}-button.left svg > use.active,
&.center .{prefix}-button.center svg > use.active,
&.right .{prefix}-button.right svg > use.active
display: block;
#tie-mask-image-file,
#tie-icon-image-file
opacity: 0;
position: absolute;
width: 100%;
height: 100%;
border: 1px solid green;
cursor: inherit;
left: 0;
top: 0;
4 changes: 2 additions & 2 deletions src/css/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ body > textarea
bottom: 150px;
width: 100%;
overflow: auto;
transition: all .3s ease;
.
position: absolute;
position: static;
display: inline-block;
transition: all .3s ease;


/* BIG MENU */
Expand Down
14 changes: 13 additions & 1 deletion src/css/submenu.styl
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,16 @@
.{prefix}-main.tui-image-editor-menu-icon .{prefix}-submenu > div.tui-image-editor-menu-icon,
.{prefix}-main.tui-image-editor-menu-draw .{prefix}-submenu > div.tui-image-editor-menu-draw,
.{prefix}-main.tui-image-editor-menu-filter .{prefix}-submenu > div.tui-image-editor-menu-filter
display: table-cell;
display: table-cell;
.{prefix}-main.tui-image-editor-menu-crop,
.{prefix}-main.tui-image-editor-menu-flip,
.{prefix}-main.tui-image-editor-menu-rotate,
.{prefix}-main.tui-image-editor-menu-shape,
.{prefix}-main.tui-image-editor-menu-text,
.{prefix}-main.tui-image-editor-menu-mask,
.{prefix}-main.tui-image-editor-menu-icon,
.{prefix}-main.tui-image-editor-menu-draw,
.{prefix}-main.tui-image-editor-menu-filter
.{prefix}-submenu
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

프리픽스 매번 붙여줄 필요 없이 아래 함수 쓰면 될 것 같아요.

+prefix-classes(prefix)

display: table;

12 changes: 9 additions & 3 deletions src/js/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,15 @@ export default {
if (obj.type === 'i-text') {
this.ui.text.fontSize = util.toInteger(obj.fontSize);
} else if (['rect', 'circle', 'triangle'].indexOf(obj.type) >= 0) {
this.ui.shape._els.strokeRange.max = Math.min(obj.width, obj.height) - 1;
this.ui.shape.setMaxStrokeValue(obj);
// here job remaining
const {width, height} = obj;
const strokeValue = this.ui.shape.getStrokeValue();

if (width < strokeValue) {
this.ui.shape.setStrokeValue(width);
}
if (height < strokeValue) {
this.ui.shape.setStrokeValue(height);
}
}
},
selectionCleared: () => {
Expand Down
2 changes: 1 addition & 1 deletion src/js/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ module.exports = {
},

defaultShapeStrokeValus: {
realTimeEvent: true,
realTimeEvent: false,
min: 2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지난번과 비슷한데 상수 빠져있으면 좋겠습니다.

max: 300,
value: 3
Expand Down
9 changes: 0 additions & 9 deletions src/js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,6 @@ export default class Ui {
this._editorElementWrap.style.top = `${top}px`;
this._editorElementWrap.style.left = `${left}px`;
this._editorElementWrap.style.width = `calc(100% - ${right}px)`;

const {offsetWidth, offsetHeight} = this._editorElementWrap;

const editortop = (offsetHeight > height) ? (offsetHeight - height) / 2 : 0;
const editorleft = (offsetWidth - width) / 2;

this._editorElement.style.top = `${editortop}px`;
this._editorElement.style.left = `${editorleft}px`;
}

/**
Expand Down Expand Up @@ -460,7 +452,6 @@ export default class Ui {
this[this.submenu].changeStartMode();
}

this._subMenuElement.style.display = this.submenu ? 'table' : 'none';
this.resizeEditor();
}

Expand Down
9 changes: 9 additions & 0 deletions src/js/ui/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ export default class Shape extends Submenu {
this._els.strokeRange.max = strokeMaxValue;
}

getStrokeValue() {
return this._els.strokeRange.value;
}

setStrokeValue(value) {
this._els.strokeRange.value = value;
this._els.strokeRange.trigger('change');
}

/**
* Change icon color
* @param {object} event - add button event object
Expand Down
6 changes: 5 additions & 1 deletion src/js/ui/template/mainContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export default ({biImage, commonStyle, headerStyle, loadButtonStyle, downloadBut
<div class="tui-image-editor-submenu" style="${submenuStyle}">
</div>
<div class="tui-image-editor-wrap">
<div class="tui-image-editor"></div>
<div style="display: table;vertical-align: middle; width: 100%; height: 100%">
<div style="display: table-cell;vertical-align: middle;">
<div class="tui-image-editor"></div>
</div>
</div>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/js/ui/template/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default ({
#tie-text-align-button.left .tui-image-editor-button.left label,
#tie-text-align-button.center .tui-image-editor-button.center label,
#tie-text-align-button.right .tui-image-editor-button.right label,
#tie-mask-apply.apply.active .tui-image-editor-button.apply label,
.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label,
.tui-image-editor-container .tui-image-editor-checkbox input + label {
${subMenuLabelActive}
Expand Down
4 changes: 4 additions & 0 deletions src/js/ui/tools/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class Range {
this.value = this._value;
}

get max() {
return this._max;
}

/**
* Get range value
* @returns {Number} range value
Expand Down