SlideShare a Scribd company logo
1 of 11
DSC Ewha
김민정
Image Styling with
Web Components
#DeveloperStudentClubs
Custom Elements(codelab-dragdrop)와 shadow DOM(codelab-effects)을 사용해서
WebComponent를 만든다.
이것들을 결합하여 페이지로 드래그된 이미지를 조작 할 수있는 웹 사이트를 만든다.
참고 한글 사이트 https://jyami.tistory.com/37
#DeveloperStudentClubs
• Custom Elements를 선언하는 방법
• Component에 리스너와 핸들러를 추가하는 방법
• Custom Design을 캡슐화하기위한 Shadow Root를 만드는 방법
• 여러 응용 프로그램을 구성하여 작은 응용 프로그램을 만드는 방법
참고 한글 사이트 https://jyami.tistory.com/37
#DeveloperStudentClubs
1. Custom Element 만들기
Custom Element HTMLElement라는 ES6의 클래스를 상속받은 것
connectedCallback() : document의 DOM에 정의한 custom element가 맨 처음 호출되었을 때 실행
문법 > customElements.defind(DOMString, class, { extends: '[tag-name]' })
#DeveloperStudentClubs
1. Custom Element 만들기
<codelab-dragdrop></codelab-dragdrop>
#DeveloperStudentClubs
2. Drag And Drop
[이벤트를 부착하려는 element].addEventListener( ‘event 이름’ , (ev) => {
[해당 이벤트가 발생할 때 실행할 동작들]
console.log(ev);
});
const ev = new CustomEvent('image', params);
#DeveloperStudentClubs
<codelab-dragdrop></codelab-dragdrop>
2. Drag And Drop
eventListener : dragover
eventListener : drop -> _getfile()
_getfile() : ’image’ event emit
#DeveloperStudentClubs
3. Connecting Element
https://developer.mozilla.org/ko/docs/Web/Web_Components/Using_shadow_DOM
Shadow DOM: DOM안에 있는 새로운 DOM
#DeveloperStudentClubs
<codelab-dragdrop id=“dragdrop” />
3. Connecting Element
<codelab-effects id =“effects”/>
ㄴ<canvas>
ㄴ<table>
ㄴ<tr><td><input>
eventListener : dragover
eventListener : drop -> _getfile()
_getfile() : ’image’ event emit
set image(image) -> draw()
draw()
#DeveloperStudentClubs
<codelab-dragdrop id=“dragdrop” /> <codelab-effects id =“effects”/>
ㄴ<canvas>
ㄴ<a>download</a>
ㄴ<table>
ㄴ<tr><td><input>
4. Saving Images
eventListener : dragover
eventListener : drop -> _getfile()
_getfile() : ’image’ event emit
set image(image) -> draw()
draw()
<a> : eventListener : click -> download
#DeveloperStudentClubs
<codelab-dragdrop id=“dragdrop” />
eventListener : dragover
eventListener : drop -> _getfile()
_getfile() : ’image’ event emit
<codelab-effects id =“effects”/>
set image(image) -> draw()
draw()
<a> : eventListener : click -> download
eventListener : change -> draw()
eventListener : input -> draw()
ㄴ<canvas>
ㄴ<a>download</a>
ㄴ<table>
ㄴ<tr><td><input>
5. Control 추가

More Related Content

Similar to Image styling with_web_components

Polymer, lego같이 만드는 웹어플리케이션
Polymer, lego같이 만드는 웹어플리케이션Polymer, lego같이 만드는 웹어플리케이션
Polymer, lego같이 만드는 웹어플리케이션Jeado Ko
 
Polymer따라잡기
Polymer따라잡기Polymer따라잡기
Polymer따라잡기Han Jung Hyun
 
Web Components - Part.I, @KIG 30th
Web Components - Part.I, @KIG 30thWeb Components - Part.I, @KIG 30th
Web Components - Part.I, @KIG 30thChang W. Doh
 
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]WSConf.
 
드래그홈2013표준제안서
드래그홈2013표준제안서드래그홈2013표준제안서
드래그홈2013표준제안서draghome
 
도구를 활용한 더 나은 웹 개발: Yeoman
도구를 활용한 더 나은 웹 개발: Yeoman도구를 활용한 더 나은 웹 개발: Yeoman
도구를 활용한 더 나은 웹 개발: YeomanJae Sung Park
 
Project anarchy로 3 d 게임 만들기 part_1
Project anarchy로 3 d 게임 만들기 part_1Project anarchy로 3 d 게임 만들기 part_1
Project anarchy로 3 d 게임 만들기 part_1Dong Chan Shin
 
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발Dreamweaver CS5.5 를 이용한 jQueryMobile 개발
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발JongKwang Kim
 
Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기Jiam Seo
 
드래그홈2010홈페이지제안서
드래그홈2010홈페이지제안서드래그홈2010홈페이지제안서
드래그홈2010홈페이지제안서draghome
 
드래그홈 표준제안서 2014
드래그홈 표준제안서 2014드래그홈 표준제안서 2014
드래그홈 표준제안서 2014draghome
 
김찬웅_그룹웨어에 새 에너지를_NDC15
김찬웅_그룹웨어에 새 에너지를_NDC15김찬웅_그룹웨어에 새 에너지를_NDC15
김찬웅_그룹웨어에 새 에너지를_NDC15Chanwoong Kim
 
Reflow and repaint 성능 비용
Reflow and repaint 성능 비용Reflow and repaint 성능 비용
Reflow and repaint 성능 비용Doo Sung Eom
 
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지Html5 앱과 웹사이트를 보다 빠르게 하는 50가지
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지yongwoo Jeon
 
코드잇-리액트-특강.pdf
코드잇-리액트-특강.pdf코드잇-리액트-특강.pdf
코드잇-리액트-특강.pdf이정환
 
How to build Design System?
How to build Design System?How to build Design System?
How to build Design System?John Kim
 
프로그래밍 패러다임의 진화 및 Spring의 금융권 적용
프로그래밍 패러다임의 진화 및 Spring의 금융권 적용프로그래밍 패러다임의 진화 및 Spring의 금융권 적용
프로그래밍 패러다임의 진화 및 Spring의 금융권 적용중선 곽
 
디자인 시스템 디자인하기
디자인 시스템 디자인하기디자인 시스템 디자인하기
디자인 시스템 디자인하기sangyong lee
 
프론트엔드 개발 첫걸음
프론트엔드 개발 첫걸음프론트엔드 개발 첫걸음
프론트엔드 개발 첫걸음DataUs
 

Similar to Image styling with_web_components (20)

Polymer, lego같이 만드는 웹어플리케이션
Polymer, lego같이 만드는 웹어플리케이션Polymer, lego같이 만드는 웹어플리케이션
Polymer, lego같이 만드는 웹어플리케이션
 
Polymer따라잡기
Polymer따라잡기Polymer따라잡기
Polymer따라잡기
 
Web Components - Part.I, @KIG 30th
Web Components - Part.I, @KIG 30thWeb Components - Part.I, @KIG 30th
Web Components - Part.I, @KIG 30th
 
Hacosa jquery 1th
Hacosa jquery 1thHacosa jquery 1th
Hacosa jquery 1th
 
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
 
드래그홈2013표준제안서
드래그홈2013표준제안서드래그홈2013표준제안서
드래그홈2013표준제안서
 
도구를 활용한 더 나은 웹 개발: Yeoman
도구를 활용한 더 나은 웹 개발: Yeoman도구를 활용한 더 나은 웹 개발: Yeoman
도구를 활용한 더 나은 웹 개발: Yeoman
 
Project anarchy로 3 d 게임 만들기 part_1
Project anarchy로 3 d 게임 만들기 part_1Project anarchy로 3 d 게임 만들기 part_1
Project anarchy로 3 d 게임 만들기 part_1
 
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발Dreamweaver CS5.5 를 이용한 jQueryMobile 개발
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발
 
Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기
 
드래그홈2010홈페이지제안서
드래그홈2010홈페이지제안서드래그홈2010홈페이지제안서
드래그홈2010홈페이지제안서
 
드래그홈 표준제안서 2014
드래그홈 표준제안서 2014드래그홈 표준제안서 2014
드래그홈 표준제안서 2014
 
김찬웅_그룹웨어에 새 에너지를_NDC15
김찬웅_그룹웨어에 새 에너지를_NDC15김찬웅_그룹웨어에 새 에너지를_NDC15
김찬웅_그룹웨어에 새 에너지를_NDC15
 
Reflow and repaint 성능 비용
Reflow and repaint 성능 비용Reflow and repaint 성능 비용
Reflow and repaint 성능 비용
 
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지Html5 앱과 웹사이트를 보다 빠르게 하는 50가지
Html5 앱과 웹사이트를 보다 빠르게 하는 50가지
 
코드잇-리액트-특강.pdf
코드잇-리액트-특강.pdf코드잇-리액트-특강.pdf
코드잇-리액트-특강.pdf
 
How to build Design System?
How to build Design System?How to build Design System?
How to build Design System?
 
프로그래밍 패러다임의 진화 및 Spring의 금융권 적용
프로그래밍 패러다임의 진화 및 Spring의 금융권 적용프로그래밍 패러다임의 진화 및 Spring의 금융권 적용
프로그래밍 패러다임의 진화 및 Spring의 금융권 적용
 
디자인 시스템 디자인하기
디자인 시스템 디자인하기디자인 시스템 디자인하기
디자인 시스템 디자인하기
 
프론트엔드 개발 첫걸음
프론트엔드 개발 첫걸음프론트엔드 개발 첫걸음
프론트엔드 개발 첫걸음
 

More from 민정 김

About dsc ewha
About dsc ewhaAbout dsc ewha
About dsc ewha민정 김
 
DSC Networking Day Keynote
DSC Networking Day KeynoteDSC Networking Day Keynote
DSC Networking Day Keynote민정 김
 
Git cooperation
Git cooperationGit cooperation
Git cooperation민정 김
 
Web and server
Web and serverWeb and server
Web and server민정 김
 
0327.web&ruby&rails
0327.web&ruby&rails0327.web&ruby&rails
0327.web&ruby&rails민정 김
 
0508. git basic
0508. git basic0508. git basic
0508. git basic민정 김
 
0515. view helper
0515. view helper0515. view helper
0515. view helper민정 김
 

More from 민정 김 (12)

200531 jandi
200531 jandi200531 jandi
200531 jandi
 
About dsc ewha
About dsc ewhaAbout dsc ewha
About dsc ewha
 
Dsc ewha 1st
Dsc ewha 1stDsc ewha 1st
Dsc ewha 1st
 
DSC Networking Day Keynote
DSC Networking Day KeynoteDSC Networking Day Keynote
DSC Networking Day Keynote
 
Git cooperation
Git cooperationGit cooperation
Git cooperation
 
Git basic
Git basicGit basic
Git basic
 
Web and server
Web and serverWeb and server
Web and server
 
Sw design
Sw designSw design
Sw design
 
0327.web&ruby&rails
0327.web&ruby&rails0327.web&ruby&rails
0327.web&ruby&rails
 
0503.1 vs n
0503.1 vs n0503.1 vs n
0503.1 vs n
 
0508. git basic
0508. git basic0508. git basic
0508. git basic
 
0515. view helper
0515. view helper0515. view helper
0515. view helper
 

Image styling with_web_components