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 #34

Merged
merged 161 commits into from
Jul 11, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
5d26c93
feat: add design markup - 1
jinwoo-kim-nhn May 4, 2018
1a78ba5
changing: menu bar position change
jinwoo-kim-nhn May 4, 2018
5cf6b84
change markup ing
jinwoo-kim-nhn May 4, 2018
614fd8f
css for markup align left, right, bottom, top
jinwoo-kim-nhn May 8, 2018
9729357
markup middle commit
jinwoo-kim-nhn May 8, 2018
605acd0
feat add ui code
jinwoo-kim-nhn May 10, 2018
19c3ec3
add polyfill and ui class
jinwoo-kim-nhn May 11, 2018
3c0b090
feat: design - add ui middle commit
jinwoo-kim-nhn May 11, 2018
9c31204
feat: design add svg and layout
May 12, 2018
00439d2
change: design middle fixed svg iconf bug
May 12, 2018
d2dae9a
feat: crop menu for add design
jinwoo-kim-nhn May 14, 2018
b9c0d97
change sample style
jinwoo-kim-nhn May 14, 2018
bca7d6f
add color picker design 1
superlucky84 May 14, 2018
2dcc9bf
feat: design add rotate & flip & range control
jinwoo-kim-nhn May 15, 2018
b528822
feat: desing add Range bar
jinwoo-kim-nhn May 15, 2018
a90f560
feat: design - add colorpicker & shape menu
jinwoo-kim-nhn May 16, 2018
4b5bc38
fixed svg export
jinwoo-kim-nhn May 16, 2018
db4b865
fixed makesvg
jinwoo-kim-nhn May 16, 2018
d99c10a
feat: design for text menu and mask menu
jinwoo-kim-nhn May 17, 2018
833635d
add imagetracer
jinwoo-kim-nhn May 17, 2018
6fd6d5d
feat: design - code middle refactoring
May 17, 2018
0321c92
feat: design - add action
May 17, 2018
fd8df5d
feat: design - icon & draw
jinwoo-kim-nhn May 18, 2018
ee38a69
feat: design - code refectoring
jinwoo-kim-nhn May 18, 2018
63b4bea
feat: design - event action refactoring
jinwoo-kim-nhn May 18, 2018
fa08250
feat: design -
May 18, 2018
6b3d1e9
feat: design - css refactoring
May 19, 2018
5012248
feat: design - code refactoring
May 19, 2018
efb6732
action refactoring
May 19, 2018
08e8c81
feat: design - refactoring for action & reaction
May 19, 2018
ac18f6c
feat: design - filter
jinwoo-kim-nhn May 21, 2018
8ce76ea
feat: design - filter2 & add sample image
jinwoo-kim-nhn May 21, 2018
19b7236
feat: design - fixed range input
jinwoo-kim-nhn May 21, 2018
98494d4
feat: design - filter implement and refactoring
May 21, 2018
e453382
feat: design - explode template
May 22, 2018
2d0d1a3
feat: design - menu optional refactoring
May 22, 2018
8ffada9
feat: design - selctionControl and initload error
May 22, 2018
de26748
feat: design - refactoring
May 22, 2018
ab764e4
feat: design - colorpicker refactoring
May 22, 2018
766d20c
feat: design - filter menu refactoring
jinwoo-kim-nhn May 23, 2018
bee9a06
feat: design - filter refactoring2
jinwoo-kim-nhn May 23, 2018
27f0c5e
feat: design - add icon type c , disabeld icon action
May 23, 2018
e918c67
feat: design - Edit the details by menu
jinwoo-kim-nhn May 24, 2018
c2744c3
feat: design - control align at left, right position
jinwoo-kim-nhn May 24, 2018
07af033
feat: design - for left and right position bar
jinwoo-kim-nhn May 24, 2018
47d1695
feat: design - refactoring for action
May 24, 2018
0bd6fc5
feat: design - control align at position left & right
May 26, 2018
ea46d50
feat: design - add stylus config
May 26, 2018
2dab588
feat: design - add document
jinwoo-kim-nhn May 28, 2018
f7689fe
feat: design - add action test - 1
jinwoo-kim-nhn May 28, 2018
49c0c8c
feat: design - add test code
May 28, 2018
66f8a0b
feat: design - add test complete
May 28, 2018
b428950
feat: design - code clean up
jinwoo-kim-nhn May 29, 2018
83c5f06
feat: design - change code position
jinwoo-kim-nhn May 29, 2018
5677d8c
feat: design - change for test code
jinwoo-kim-nhn May 29, 2018
fe11f9b
feat: design-theme - theme job start
jinwoo-kim-nhn May 29, 2018
d069dab
feat: design-theme - middle commit
jinwoo-kim-nhn May 29, 2018
4846cb9
feat: design-theme - add stylemaker
May 29, 2018
6435e44
feat: design-theme add theme code cleanup
May 29, 2018
46a2863
feat: design-theme add style template
May 29, 2018
e79f054
feat: design-theme - add theme complete
jinwoo-kim-nhn May 30, 2018
f5ff9fb
feat: design - edit test code error
jinwoo-kim-nhn May 30, 2018
59ae1a5
feat: design - add stylus
jinwoo-kim-nhn May 30, 2018
16541e5
feat: design - fixed stylus.js
May 30, 2018
7d4e2cb
feat: design - fixed menu active bug
jinwoo-kim-nhn May 31, 2018
3def02a
feat: design - add ui test (theme, ui)
jinwoo-kim-nhn May 31, 2018
8a008af
feat: design - change stylus and bugfix
jinwoo-kim-nhn May 31, 2018
3aa2e87
feat: design - add range subbar
May 31, 2018
3fb49c1
feat: design - fixed mode change original bug
May 31, 2018
dcbe7db
fixed: action filter test
May 31, 2018
320e750
feat: design - apply code review
jinwoo-kim-nhn Jun 1, 2018
0996a5c
feat: design - apply code review
jinwoo-kim-nhn Jun 1, 2018
95aa6c7
feat: design - fixed example review
jinwoo-kim-nhn Jun 1, 2018
c8d2d84
feat: design - apply for codereview
jinwoo-kim-nhn Jun 1, 2018
4197980
feat: design - change theme style
Jun 2, 2018
baf9e7b
feat: design - apply code review (getter setter)
Jun 2, 2018
75aa79b
feat: design - apply codereview (range default value)
Jun 2, 2018
df5d208
apply code review
jinwoo-kim-nhn Jun 4, 2018
f6c0bba
chore: update readme - 1
jinwoo-kim-nhn Jun 4, 2018
00df494
Update representative image
jinwoo-kim-nhn Jun 4, 2018
582624e
Change representative image.
jinwoo-kim-nhn Jun 4, 2018
08d773d
update reade - middle grade
jinwoo-kim-nhn Jun 4, 2018
6c3d397
Update README.md
jinwoo-kim-nhn Jun 5, 2018
c1be888
Update Table of Contents
jinwoo-kim-nhn Jun 5, 2018
39959d7
chore: add - code of conduct
jinwoo-kim-nhn Jun 5, 2018
4bccad1
chore: add - contritute md
jinwoo-kim-nhn Jun 5, 2018
5887a4b
chore: read link update
jinwoo-kim-nhn Jun 5, 2018
31635ec
chore: readme - Table of Contents update
jinwoo-kim-nhn Jun 5, 2018
1019711
Move feature subtitle
jinwoo-kim-nhn Jun 5, 2018
e9cd465
feat: design - code refactoring
jinwoo-kim-nhn Jun 5, 2018
6a906da
fixed: icon and selection defalut option
Jun 5, 2018
c63ec5d
feat: design - change safed id name
Jun 5, 2018
30a03ca
corrected broken test
Jun 5, 2018
6366c86
apply codereview
Jun 5, 2018
d70b3dd
feat: design - fixed icon path and resize function
jinwoo-kim-nhn Jun 7, 2018
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
f8b5bf8
readme 개선 - 1
jinwoo-kim-nhn Jun 20, 2018
d60e2fb
chore: add docs
jinwoo-kim-nhn Jun 20, 2018
f8b5171
chore: features table expression
jinwoo-kim-nhn Jun 20, 2018
8185872
chore: readme main gif image grade up
jinwoo-kim-nhn Jun 20, 2018
7c254bf
fixed change
jinwoo-kim-nhn Jun 20, 2018
60d64da
apply codereview
jinwoo-kim-nhn Jun 20, 2018
be35abf
Merge pull request #38 from nhnent/feat/design-ui-useable
jinwoo-kim-nhn Jun 20, 2018
09a3236
fixed: top position colorpicker tooltip - 1
jinwoo-kim-nhn Jun 20, 2018
4d580c9
chore: Complete the contents of the wiki by reconstructing it.
jinwoo-kim-nhn Jun 21, 2018
700bd83
Merge branch 'feat/readme' of https://github.com/nhnent/tui.image-edi…
jinwoo-kim-nhn Jun 21, 2018
21b807d
fixed Additional translation missing parts.
jinwoo-kim-nhn Jun 21, 2018
70660b7
add test
jinwoo-kim-nhn Jun 21, 2018
b16a75e
fixed boken markdown
jinwoo-kim-nhn Jun 22, 2018
1cff85d
Update Basic-Tutorial.md
jinwoo-kim-nhn Jun 22, 2018
b956162
added filter feature
jinwoo-kim-nhn Jun 22, 2018
dd14d95
Update README.md
jinwoo-kim-nhn Jun 22, 2018
7e8fb5f
Fiexed Table of Contents
jinwoo-kim-nhn Jun 22, 2018
5db3351
chore: Example sequence and name change
jinwoo-kim-nhn Jun 22, 2018
0f64b8a
chore: tutorials and api links to the latest changes.
jinwoo-kim-nhn Jun 22, 2018
a289543
Merge branch 'feat/readme' into feat/design
jinwoo-kim-nhn Jun 22, 2018
da38d5a
feat/design - jsdoc Document reinforcement
jinwoo-kim-nhn Jun 22, 2018
313db0f
fixed colorpicker position bug when top menubar
jinwoo-kim-nhn Jun 22, 2018
50ebdfa
add theme style property bisize
jinwoo-kim-nhn Jun 22, 2018
4fc7b16
fixed jsdoc logo-url and change tagline message
jinwoo-kim-nhn Jun 22, 2018
42c78f9
fixed broken test
jinwoo-kim-nhn Jun 22, 2018
f9b9188
fixed broken test
jinwoo-kim-nhn Jun 26, 2018
d01a382
fixed download bug
jinwoo-kim-nhn Jul 9, 2018
991052c
fixed webpack config for css minifiled
jinwoo-kim-nhn Jul 9, 2018
3e595df
fixed saveAs bug
jinwoo-kim-nhn Jul 9, 2018
5ab706d
Add jsdoc for theme property
jinwoo-kim-nhn Jul 11, 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
chore: Complete the contents of the wiki by reconstructing it.
  • Loading branch information
jinwoo-kim-nhn committed Jun 21, 2018
commit 4d580c95da8315fef3ce9854910bf88162a7cda7
79 changes: 79 additions & 0 deletions docs/Apply-Mobile-Version-Image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Mobile version: image load & save issues

## Load Image

#### Issue
- You can load photos directly from your mobile device into the image editor, but images with too high a resolution are not suitable for use.
- For an action that includes a mouse gesture, such as cropping and drawing in the image editor, the action is determined by the aspect ratio relative to the original image size, so the higher the resolution, the less usable.
- Maximum resolution per device
* iPhone : `3264 * 2448`
* Galaxy4 : `4128 * 3096` (High resolution) / `3264 * 2448` (Normal) / `2048 * 1152` (Low resolution)
- The appropriate image size for usability is `3264 * 2448`. If you receive a file upload event when loading an image taken at high resolution on your Android device, do the following.

#### How to handle high-resolution image uploads
```html
<input type="file" accept="image/*" id="input-image-file">
```
```js
var MAX_RESOLUTION = 3264 * 2448;

$('input-image-file').on('change', function(event) {
var file;
var img;
var resolution;

if (!supportingFileAPI) {
alert('This browser does not support file-api');
}

file = event.target.files[0];

if (file) {
img = new Image();

img.onload = function() {
resolution = this.width * this.height;

if (resolution <= MAX_RESOLUTION) {
imageEditor.loadImageFromFile(file);
} else {
alert('Loaded image\'s resolution is too large!\nRecommended resolution is 3264 * 2448!');
}

URL.revokeObjectURL(file);
};

img.src = URL.createObjectURL(file);
}
});
```

## Save Image

#### Issue
- Saving an edited image does not appear in the current sample page, but the actual service must send the file to the server to save the image.
- Uses Ajax communication.

#### How to Save a Server Image

Step 1. Import image data to be saved in the image editor.
```js
var dataURL = imageEditor.toDataURL();
```

Step 2. `base64` encoded image data is Ajax communicated and sent to the server.
```js
$.ajax({
type: 'POST',
url: serverUrl,
data: {
imgBase64: dataURL // Data from Step 1.
}
}).done(function() {
console.log('saved!');
});
```

Step 3. The server processes the received data and stores it.
- [Using Java](https://sangupta.com/tech/saving-html5-canvas-to-java-server.html)
- [Using Php](http:https://permadi.com/2010/10/html5-saving-canvas-image-data-using-php-and-ajax/)
74 changes: 74 additions & 0 deletions docs/Apply-Mobile-Version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# How to apply the mobile version.

## Image editor How to apply a mobile device

- Some settings are required to use Image Editor components on mobile devices.
- Please refer to the [sample page](http:https://nhnent.github.io/tui.component.image-editor/latest/tutorial-mobile.html) first to check the UI configuration and operation.
#### Step 1. Include the dependency file on the page. (PC version same)
```html
<script src="libs/code-snippet.min.js"></script>
<script src="libs/jquery.min.js"></script>
<script src="libs/fabric.min.js"></script>
<script src="js/image-editor.js"></script>
```

#### Step 2. `body` Add markup to the tag to create an image editor. (PC version same)
```html
<div class="tui-image-editor">
<canvas></canvas>
</div>
```

#### Step 3. `head` Add a meta tag for setting the viewport to the tag.
```html
<meta name="viewport" content="width=device-width, user-scalable=no">
```

#### Step 4. Create an image editor by setting option values for mobile device optimization.
```js
// Create image editor
var imageEditor = new tui.component.ImageEditor('.tui-image-editor canvas', {
cssMaxWidth: document.documentElement.clientWidth,
cssMaxHeight: document.documentElement.clientHeight,
selectionStyle: {
cornerSize: 50,
rotatingPointOffset: 100
}
});
```
- `cssMaxWidth`, `cssMaxHeight` :
* Sets maximum `width` and` height` values in the canvas area.
* Do not set it to a fixed value like the PC version because the value changes depending on the mobile device to be connected.
- `selectionStyle` :
* Selection style setting options that are displayed when an object such as an icon, text, etc. is selected.
* If the corner size is small, it is difficult to resize and rotate, so set the selection style.
* The selection style options are the same as those provided by `fabric.js` and can be set with the following option values: ([Reference](http:https://fabricjs.com/customization))

```js
{
borderColor: 'red', // Selection line color
cornerColor: 'green', // Selection corner color
cornerSize: 6, // Selection corner size
rotatingPointOffset: 100 // Distance from selection area to rotation corner
transparentCorners: false, // Selection corner Transparency
}
```
![2016-08-18 4 52 29](https://cloud.githubusercontent.com/assets/18183560/17766120/86f7c3fc-6564-11e6-86d7-554e8e946843.png)


#### Step 5. Add a CSS file and markup for UI configuration. (PC version same)
```html
<link type="text/css" href="css/tui-image-editor-m.css" rel="stylesheet">
```
>
The CSS file is used on the sample page and should only refer to the UI configuration,
It is recommended to customize image, CSS, and markup files when applying the service.


#### Step 6. Apply the image editor API to the UI
- API : [http:https://nhnent.github.io/tui.component.image-editor/latest/](http:https://nhnent.github.io/tui.component.image-editor/latest/)
- Sample Page : [http:https://nhnent.github.io/tui.component.image-editor/latest/tutorial-mobile.html](http:https://nhnent.github.io/tui.component.image-editor/latest/tutorial-mobile.html)

![all_feature_small](https://cloud.githubusercontent.com/assets/18183560/17803706/034ea17c-6633-11e6-914d-6602d12888f9.gif)
![text_feature_small](https://cloud.githubusercontent.com/assets/18183560/17803707/03530636-6633-11e6-8c03-cd5523716b9b.gif)

7 changes: 5 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
## Tutorials
- [Getting Started](Basic-Tutorial.md)
- [Understand the structure](Structure.md)
- [Simple Reference](Reference.md)
- [Mobile Version](Apply-Mobile-Version.md)
- [Mobile Version - Image Load and Save](Apply-Mobile-Version-Image.md)


## Documents

- [Code of Conducting](../CODE_OF_CONDUCTING.md)
- [Code of Conducting](../CODE_OF_CONDUCT.md)
- [Contributing Guide](../CONTRIBUTING.md)
- [Commit Message Convention](COMMIT_MESSAGE_CONVENTION.md)
- [API & Examples](http:https://nhnent.github.io/tui.image-editor/latest/)
Expand Down
70 changes: 70 additions & 0 deletions docs/Reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

### Text
- Insert text on the canvas and modify text.
- Change text color, weight, align so on.

>**Implementing to insert text on the canvas using the text palette**
- The user can make the specific text palette and edit some text using this palette.
- Call custom event API, it can insert text object and control the text palette.
* `ImageEditor#activateText` : It occurs when the canvas is clicked.
* `ImageEditor#adjustObject` : It occurs when any inserted text object is moved or resized.

```js
imageEditor.on('activateText', function(obj) {
console.log(obj.type); // Whether the current text object is new or aleady created
console.log(obj.text); // Contents of the current text object
console.log(obj.styles); // Styles of the current text object
console.log(obj.originPosition); // Mouse position on the canvas
console.log(obj.clientPosition); // Mouse position on browser - set the text palette's position
});
```
```js
imageEditor.on('adjustObject', function(obj) {
console.log(obj.type); // Whether the selected object's type is "text" or others - control the the text palette's view state
});
```
![image](https://cloud.githubusercontent.com/assets/18183560/16838164/cd200920-4a02-11e6-9c5a-304d1a07d82a.png)


### Icon
- Insert the basic icon on the canvas. (type: _arrow_, _cancel_ icon)
- Register the custom icon.
- Change color of the icon.

>**How to draw SVG path**
- [Link](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths)

>**How to get SVG path value when registering the custom icon**
- [Link](https://css-tricks.com/using-svg/)

![image](https://cloud.githubusercontent.com/assets/18183560/16838300/726f8a68-4a03-11e6-8703-6d0e36a7f3e3.png)


### Mask Filter
- Load the image for using mask filter. (This image is called the "mask image")
- When applying mask filter on the canvas image, the canvas image's areas matching the mask image's black areas should be transparent.

![image](https://cloud.githubusercontent.com/assets/18183560/16837578/07444c46-49ff-11e6-99fc-2355a6777dc0.gif)


### Line Drawing
- Draw the straight line on the canvas.
- Change the color and width value of brush to draw line.

![image](https://cloud.githubusercontent.com/assets/18183560/16837621/4beed348-49ff-11e6-8276-8e0f7e9e85e6.gif)

### Shourtcut
- On the canvas
* `ctrl + z` : undo
* `ctrl + y` : redo
- Crop
* `shift` : making the cropzone of 1:1 ratio

![image](https://cloud.githubusercontent.com/assets/18183560/16837645/73e7614e-49ff-11e6-9460-e596dd683724.gif)


## More
- Get started (Tutorial) : [https://github.com/nhnent/tui.component.image-editor/wiki/Tutorial](https://github.com/nhnent/tui.component.image-editor/wiki/Tutorial)
- API : [http:https://nhnent.github.io/tui.image-editor/latest/](http:https://nhnent.github.io/tui.image-editor/latest/)
- Sample : [http:https://nhnent.github.io/tui.image-editor/latest/tutorial-example01-basic.html](http:https://nhnent.github.io/tui.image-editor/latest/tutorial-example01-basic.html)

Loading