SlideShare a Scribd company logo
1 of 26
HTML5 & CSS3

3장. 사용자 중심의 웹 폼 만들기

                          김홍준
            twitter.com/jun0683
HTML 기본적인 폼 컨트롤 한계
기본폼
 텍스트 필드
 라디오 버튼
 체크박스
멀티플 셀렉트 쓸려면... 하루종일...
버튼을 누르고.. 맥이면 다른키값
결국 다른 라이브러리 이용
 폼끼리의 충돌문제
HTML 기본적인 폼 컨트롤 한계
그래서?
새로운 폼 필드 타입

자동 포커스, 힌트 텍스트

contenteditable으로 HTML 요소를 입력 필드
로
HTML5의 새로운 입력 폼
  기본적인 폼
<form method="post" action="/projects/1">

   <fieldset id="personal_information">

   
   <legend>프로젝트 정보</legend>
    
   <ol>

   
   
    <li>

   
   
    
    <label for="name">이름</label>

   
   
    
    <input type="text" name="name" autofocus="autofocus" id="name">

   
   
    </li>

   
   
    <li>
   

      

     <input type="submit" value="Submit">

   
   
    </li>

   
   </ol>

   
   </legend>

   </fieldset>
</form>




  ol : order list
  li : list item
  label(for) : 접근성(id값 참조)
voice over 데모
range로 슬라이더 만들기

<li>
  <label for="priority">중요도</label>
  <input type="range" min="0" max="10"
         name="priority" value="0" id="priority">
</li>
숫자와 스핀박스 다루기

<li>
  <label for="estimated_hours">예상 시간</label>
  <input type="number" name="estimated_hours"
         min="0" max="1000"
         id="estimated_hours">
</li>
날짜
오페라만 제공
   <li>
     <label for="start_date">시작 날짜</label>
     <input type="date" name="start_date"
   id="start_date"
            value="2011-10-22">
   </li>
이메일
모바일에서 유용 키보드 레이아웃이 변함
   <li>
     <label for="email">이메일 연락처</label>
     <input type="email" name="email" id="email">
   </li>
URL
모바일에서 유용
   <li>
     <label for="url">테스트 URL</label>
     <input type="url" name="url" id="url">
   </li>
색깔
오페라는 제공...
    <li>
      <label for="project_color">프로젝트 색상</label>
      <input type="color" name="project_color"
    id="project_color">
    </li>
새로운 타입을 지원하지 않을때..
이해하지 못하는 브라우저는 단순 텍스트 필드로...

jQuery UI나 YUI(야후UI) 사용해서 텍스트 필드와 연
결

나중에.. 브라우저가 지원하면 자바스크립트를 제거하
는 꿈을... 꾸어본다...
색상 선택기 교체(1)
jQuery와 CSS3속성 선택자를 이용 색상 필드
를 찾아서 교체

color 타입의 input요소를 찾아, jQuery플러그
인 simpleColor를 적용
    if (!hasColorSupport()){
      $('input[type=color]').simpleColor();
    }
색상 선택기 교체(2)
브라우저 자체에서 color타입을 지원한다면..
 function hasColorSupport(){
   input = document.createElement("input");
   input.setAttribute("type", "color");            브라우저 지원 체크
   var hasColorType = (input.type !== "text");
   if(hasColorType){
     var testString = "foo";
     input.value=testString;                       브라우저 완벽지원 체크
     hasColorType = (input.value != testString);
   }
   return(hasColorType);
 }

 if (!hasColorSupport()){
   $('input[type=color]').simpleColor();
 }
jQuery
$ == jQuery

     $('input[type=color]').simpleColor();
                ||
jQuery('input[type=color]').simpleColor();




jQuery와 CSS3속성 선택자를 이용 색상 필드를 찾아서 교체
모더나이저(modernizr)
HTML5와 CSS기능의 지원 여부를 검사

브라우저에서 지원하지 않는 기능을 대신 만
들어 주지 않음
has....
autofocus 자동 포커스 이동
페이지 하나에 autofocus 속성 하나만 가능
<label for="name">이름</label>
<input type="text" name="name" autofocus="autofocus" id="name">




지원되지 않을때(jQurey)
if(!hasAutofocus()){
  $('input[autofocus=autofocus]').focus();
}
placeholder 힌트제공
placeholder 속성
<label for="first_name">이름</label>
<input id="first_name" type="text" autofocus="true" name="first_name"
        placeholder="한선용">
자동완성 방지
autocomplete 속성
<label for="password_confirmation">비밀번호 확인</label>
<input id="password_confirmation" type="password"
         name="password_confirmation" value=""
         autocomplete="off" placeholder="비밀번호를 다시 입력하세요" />
지원하지 않을때..
jQuery가.. 갑인듯..
        if(!hasPlaceholderSupport()){
          $("#create_account").placeholder();
        };
contenteditable
 contenteditable을 이용한 즉석 편집

 데이터 입력 부분을 자동으로 처리

 텍스트영역을 감지해서 텍스트 필드로 바꾸는 작업 안해도
 됨 <b>Name</b>
     <span id="name"   contenteditable="true">Hugh   Mann</span>




데모
데이터 유지
새로고침하면 내역이 사라짐

바꾼 내용을 서버로 전송
        <b>Name</b>
        <span id="name" contenteditable="true">Hugh Mann</span>

$(function(){
    var status = $("#status");
    $("span[contenteditable=true]").blur(function(){
        var field = $(this).attr("id");
        var value = $(this).text();
        $.post("http://localhost:4567/users/1",
            field + "=" + value,
            function(data){
                status.text(data);      서버에서 받은        데이터
            }
        );
    });
});




          contenteditable 속성이 true로 설정된
     모든 span 요소에 이벤트 핸들러를 연결(jQuery.blur)
지원되지 않을때..
편집 페이지를 만들어라

      자바스크립트 차단 + HTML5 지원 X




      감지 기능 추가
if(document.getElementById("edit_profile_link").contentEditable != null){
          $("#edit_profile_link").hide();
...
미래엔..
사이트 마다 다른 표현방식들..

모든 브라우저가 HTML5 지원을 한다면..



          -_-)b
참고
http://rintiantta.blog.me/40121658531

생활코딩 http://opentutorials.org/course/1

More Related Content

What's hot

테스트가 뭐예요?
테스트가 뭐예요?테스트가 뭐예요?
테스트가 뭐예요?Kyoung Up Jung
 
처음배우는 자바스크립트, 제이쿼리 #4
처음배우는 자바스크립트, 제이쿼리 #4처음배우는 자바스크립트, 제이쿼리 #4
처음배우는 자바스크립트, 제이쿼리 #4성일 한
 
Django와 flask
Django와 flaskDjango와 flask
Django와 flaskJiho Lee
 
회사에서 써보는 SQLAlchemy
회사에서 써보는 SQLAlchemy회사에서 써보는 SQLAlchemy
회사에서 써보는 SQLAlchemyJc Kim
 
간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기Kyoung Up Jung
 
Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.Kyoung Up Jung
 
처음배우는 자바스크립트, 제이쿼리 #2
처음배우는 자바스크립트, 제이쿼리 #2처음배우는 자바스크립트, 제이쿼리 #2
처음배우는 자바스크립트, 제이쿼리 #2성일 한
 
[XECon+PHPFest 2014] jQuery 개발자에서 AngularJS 개발자 되기
[XECon+PHPFest 2014] jQuery 개발자에서 AngularJS 개발자 되기[XECon+PHPFest 2014] jQuery 개발자에서 AngularJS 개발자 되기
[XECon+PHPFest 2014] jQuery 개발자에서 AngularJS 개발자 되기Jeado Ko
 
자바스크립트 프레임워크 살펴보기
자바스크립트 프레임워크 살펴보기자바스크립트 프레임워크 살펴보기
자바스크립트 프레임워크 살펴보기Jeado Ko
 
[하코사세미나] 한 시간 만에 배우는 Jquery
[하코사세미나] 한 시간 만에 배우는 Jquery[하코사세미나] 한 시간 만에 배우는 Jquery
[하코사세미나] 한 시간 만에 배우는 Jquery정석 양
 
CSS 선택자와 디버그
CSS 선택자와 디버그CSS 선택자와 디버그
CSS 선택자와 디버그성일 한
 
12주차 간단한 방명록 제작 - 두번째
12주차 간단한 방명록 제작 - 두번째12주차 간단한 방명록 제작 - 두번째
12주차 간단한 방명록 제작 - 두번째Yoonwhan Lee
 
처음배우는 자바스크립트, 제이쿼리 #1
처음배우는 자바스크립트, 제이쿼리 #1처음배우는 자바스크립트, 제이쿼리 #1
처음배우는 자바스크립트, 제이쿼리 #1성일 한
 
파이썬 플라스크로 배우는 웹프로그래밍 #3 (ABCD)
파이썬 플라스크로 배우는 웹프로그래밍 #3 (ABCD)파이썬 플라스크로 배우는 웹프로그래밍 #3 (ABCD)
파이썬 플라스크로 배우는 웹프로그래밍 #3 (ABCD)성일 한
 
[JavaScript Library] - Simple jQuery
[JavaScript Library] - Simple jQuery[JavaScript Library] - Simple jQuery
[JavaScript Library] - Simple jQuery문학청년
 
Python/Django를 이용한 쇼핑몰 구축(2018 4월 Django Girls Seoul)
Python/Django를 이용한 쇼핑몰 구축(2018 4월 Django Girls Seoul)Python/Django를 이용한 쇼핑몰 구축(2018 4월 Django Girls Seoul)
Python/Django를 이용한 쇼핑몰 구축(2018 4월 Django Girls Seoul)Youngil Cho
 
XE 레이아웃 제작 실무 노하우 1 - XECon2014 by 고진화
XE 레이아웃 제작 실무 노하우 1 - XECon2014 by 고진화XE 레이아웃 제작 실무 노하우 1 - XECon2014 by 고진화
XE 레이아웃 제작 실무 노하우 1 - XECon2014 by 고진화Jinhwa Ko
 
XE 오픈 세미나(2014-06-28) - (1/3) 레이아웃 제작 기본
XE 오픈 세미나(2014-06-28) - (1/3) 레이아웃 제작 기본XE 오픈 세미나(2014-06-28) - (1/3) 레이아웃 제작 기본
XE 오픈 세미나(2014-06-28) - (1/3) 레이아웃 제작 기본XpressEngine
 

What's hot (20)

테스트가 뭐예요?
테스트가 뭐예요?테스트가 뭐예요?
테스트가 뭐예요?
 
처음배우는 자바스크립트, 제이쿼리 #4
처음배우는 자바스크립트, 제이쿼리 #4처음배우는 자바스크립트, 제이쿼리 #4
처음배우는 자바스크립트, 제이쿼리 #4
 
Django와 flask
Django와 flaskDjango와 flask
Django와 flask
 
회사에서 써보는 SQLAlchemy
회사에서 써보는 SQLAlchemy회사에서 써보는 SQLAlchemy
회사에서 써보는 SQLAlchemy
 
간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기
 
Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.
 
처음배우는 자바스크립트, 제이쿼리 #2
처음배우는 자바스크립트, 제이쿼리 #2처음배우는 자바스크립트, 제이쿼리 #2
처음배우는 자바스크립트, 제이쿼리 #2
 
[XECon+PHPFest 2014] jQuery 개발자에서 AngularJS 개발자 되기
[XECon+PHPFest 2014] jQuery 개발자에서 AngularJS 개발자 되기[XECon+PHPFest 2014] jQuery 개발자에서 AngularJS 개발자 되기
[XECon+PHPFest 2014] jQuery 개발자에서 AngularJS 개발자 되기
 
자바스크립트 프레임워크 살펴보기
자바스크립트 프레임워크 살펴보기자바스크립트 프레임워크 살펴보기
자바스크립트 프레임워크 살펴보기
 
[하코사세미나] 한 시간 만에 배우는 Jquery
[하코사세미나] 한 시간 만에 배우는 Jquery[하코사세미나] 한 시간 만에 배우는 Jquery
[하코사세미나] 한 시간 만에 배우는 Jquery
 
CSS 선택자와 디버그
CSS 선택자와 디버그CSS 선택자와 디버그
CSS 선택자와 디버그
 
12주차 간단한 방명록 제작 - 두번째
12주차 간단한 방명록 제작 - 두번째12주차 간단한 방명록 제작 - 두번째
12주차 간단한 방명록 제작 - 두번째
 
처음배우는 자바스크립트, 제이쿼리 #1
처음배우는 자바스크립트, 제이쿼리 #1처음배우는 자바스크립트, 제이쿼리 #1
처음배우는 자바스크립트, 제이쿼리 #1
 
파이썬 플라스크로 배우는 웹프로그래밍 #3 (ABCD)
파이썬 플라스크로 배우는 웹프로그래밍 #3 (ABCD)파이썬 플라스크로 배우는 웹프로그래밍 #3 (ABCD)
파이썬 플라스크로 배우는 웹프로그래밍 #3 (ABCD)
 
Hacosa j query 11th
Hacosa j query 11thHacosa j query 11th
Hacosa j query 11th
 
[JavaScript Library] - Simple jQuery
[JavaScript Library] - Simple jQuery[JavaScript Library] - Simple jQuery
[JavaScript Library] - Simple jQuery
 
Vue.js 입문 04 조건부 랜더링
Vue.js 입문 04 조건부 랜더링Vue.js 입문 04 조건부 랜더링
Vue.js 입문 04 조건부 랜더링
 
Python/Django를 이용한 쇼핑몰 구축(2018 4월 Django Girls Seoul)
Python/Django를 이용한 쇼핑몰 구축(2018 4월 Django Girls Seoul)Python/Django를 이용한 쇼핑몰 구축(2018 4월 Django Girls Seoul)
Python/Django를 이용한 쇼핑몰 구축(2018 4월 Django Girls Seoul)
 
XE 레이아웃 제작 실무 노하우 1 - XECon2014 by 고진화
XE 레이아웃 제작 실무 노하우 1 - XECon2014 by 고진화XE 레이아웃 제작 실무 노하우 1 - XECon2014 by 고진화
XE 레이아웃 제작 실무 노하우 1 - XECon2014 by 고진화
 
XE 오픈 세미나(2014-06-28) - (1/3) 레이아웃 제작 기본
XE 오픈 세미나(2014-06-28) - (1/3) 레이아웃 제작 기본XE 오픈 세미나(2014-06-28) - (1/3) 레이아웃 제작 기본
XE 오픈 세미나(2014-06-28) - (1/3) 레이아웃 제작 기본
 

Similar to Html5&css 3장

5. html5 웹폼
5. html5 웹폼5. html5 웹폼
5. html5 웹폼은심 강
 
Daejeon IT Developer Conference Hibernate3
Daejeon IT Developer Conference Hibernate3Daejeon IT Developer Conference Hibernate3
Daejeon IT Developer Conference Hibernate3plusperson
 
Android UI Test (Espresso/Kakao)
Android UI Test (Espresso/Kakao)Android UI Test (Espresso/Kakao)
Android UI Test (Espresso/Kakao)MDLicht
 
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발Dreamweaver CS5.5 를 이용한 jQueryMobile 개발
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발JongKwang Kim
 
알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web AnimationsChang W. Doh
 
컴포넌트 관점에서 개발하기
컴포넌트 관점에서 개발하기컴포넌트 관점에서 개발하기
컴포넌트 관점에서 개발하기우영 주
 
Java script 강의자료_ed13
Java script 강의자료_ed13Java script 강의자료_ed13
Java script 강의자료_ed13hungrok
 
Partner Story(Megazone): 금융사 실전 프로젝트 DeepDive
Partner Story(Megazone): 금융사 실전 프로젝트 DeepDive Partner Story(Megazone): 금융사 실전 프로젝트 DeepDive
Partner Story(Megazone): 금융사 실전 프로젝트 DeepDive Elasticsearch
 
FE로 취업 전에 알았으면 좋았을 것들
FE로 취업 전에 알았으면 좋았을 것들FE로 취업 전에 알았으면 좋았을 것들
FE로 취업 전에 알았으면 좋았을 것들Taegon Kim
 
[114]angularvs react 김훈민손찬욱
[114]angularvs react 김훈민손찬욱[114]angularvs react 김훈민손찬욱
[114]angularvs react 김훈민손찬욱NAVER D2
 
Modern web application with meteor
Modern web application with meteorModern web application with meteor
Modern web application with meteorJaeho Lee
 
Client side storage in html5
Client side storage in html5Client side storage in html5
Client side storage in html5yongwoo Jeon
 
First Step In Ajax Korean
First Step In Ajax KoreanFirst Step In Ajax Korean
First Step In Ajax KoreanTerry Cho
 
Servlet design pattern
Servlet design patternServlet design pattern
Servlet design patternSukjin Yun
 
Python 으로 Slackbot 개발하기
Python 으로 Slackbot 개발하기Python 으로 Slackbot 개발하기
Python 으로 Slackbot 개발하기성일 한
 

Similar to Html5&css 3장 (20)

3-2. selector api
3-2. selector api3-2. selector api
3-2. selector api
 
5. html5 웹폼
5. html5 웹폼5. html5 웹폼
5. html5 웹폼
 
Meteor2015 codelab
Meteor2015 codelab Meteor2015 codelab
Meteor2015 codelab
 
Daejeon IT Developer Conference Hibernate3
Daejeon IT Developer Conference Hibernate3Daejeon IT Developer Conference Hibernate3
Daejeon IT Developer Conference Hibernate3
 
Android UI Test (Espresso/Kakao)
Android UI Test (Espresso/Kakao)Android UI Test (Espresso/Kakao)
Android UI Test (Espresso/Kakao)
 
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발Dreamweaver CS5.5 를 이용한 jQueryMobile 개발
Dreamweaver CS5.5 를 이용한 jQueryMobile 개발
 
알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations
 
컴포넌트 관점에서 개발하기
컴포넌트 관점에서 개발하기컴포넌트 관점에서 개발하기
컴포넌트 관점에서 개발하기
 
Java script 강의자료_ed13
Java script 강의자료_ed13Java script 강의자료_ed13
Java script 강의자료_ed13
 
Partner Story(Megazone): 금융사 실전 프로젝트 DeepDive
Partner Story(Megazone): 금융사 실전 프로젝트 DeepDive Partner Story(Megazone): 금융사 실전 프로젝트 DeepDive
Partner Story(Megazone): 금융사 실전 프로젝트 DeepDive
 
FE로 취업 전에 알았으면 좋았을 것들
FE로 취업 전에 알았으면 좋았을 것들FE로 취업 전에 알았으면 좋았을 것들
FE로 취업 전에 알았으면 좋았을 것들
 
[114]angularvs react 김훈민손찬욱
[114]angularvs react 김훈민손찬욱[114]angularvs react 김훈민손찬욱
[114]angularvs react 김훈민손찬욱
 
Xe hack
Xe hackXe hack
Xe hack
 
Modern web application with meteor
Modern web application with meteorModern web application with meteor
Modern web application with meteor
 
Client side storage in html5
Client side storage in html5Client side storage in html5
Client side storage in html5
 
First Step In Ajax Korean
First Step In Ajax KoreanFirst Step In Ajax Korean
First Step In Ajax Korean
 
Servlet design pattern
Servlet design patternServlet design pattern
Servlet design pattern
 
Html5
Html5 Html5
Html5
 
Class10
Class10Class10
Class10
 
Python 으로 Slackbot 개발하기
Python 으로 Slackbot 개발하기Python 으로 Slackbot 개발하기
Python 으로 Slackbot 개발하기
 

More from 홍준 김

1.3장 차수 높은 프로시저(higher order procedure)로 요약하는 방법
1.3장 차수 높은 프로시저(higher order procedure)로 요약하는 방법1.3장 차수 높은 프로시저(higher order procedure)로 요약하는 방법
1.3장 차수 높은 프로시저(higher order procedure)로 요약하는 방법홍준 김
 
11장 윈도우 스레드 풀 + 12장 파이버
11장 윈도우 스레드 풀 + 12장 파이버11장 윈도우 스레드 풀 + 12장 파이버
11장 윈도우 스레드 풀 + 12장 파이버홍준 김
 
11장 윈도우 스레드 풀
11장 윈도우 스레드 풀11장 윈도우 스레드 풀
11장 윈도우 스레드 풀홍준 김
 
Mongo db문서의생성,갱신,삭제
Mongo db문서의생성,갱신,삭제Mongo db문서의생성,갱신,삭제
Mongo db문서의생성,갱신,삭제홍준 김
 
ManagingHumans/chap25~29
ManagingHumans/chap25~29ManagingHumans/chap25~29
ManagingHumans/chap25~29홍준 김
 
DebugIt/chapter9~11
DebugIt/chapter9~11DebugIt/chapter9~11
DebugIt/chapter9~11홍준 김
 
Holub on Patterns 1장 전
Holub on Patterns 1장 전Holub on Patterns 1장 전
Holub on Patterns 1장 전홍준 김
 
2장 상태구도형 에이전트의 디자인
2장 상태구도형 에이전트의 디자인2장 상태구도형 에이전트의 디자인
2장 상태구도형 에이전트의 디자인홍준 김
 
프로그램은 왜 실패 하는가
프로그램은 왜 실패 하는가프로그램은 왜 실패 하는가
프로그램은 왜 실패 하는가홍준 김
 

More from 홍준 김 (15)

1.3장 차수 높은 프로시저(higher order procedure)로 요약하는 방법
1.3장 차수 높은 프로시저(higher order procedure)로 요약하는 방법1.3장 차수 높은 프로시저(higher order procedure)로 요약하는 방법
1.3장 차수 높은 프로시저(higher order procedure)로 요약하는 방법
 
11장 윈도우 스레드 풀 + 12장 파이버
11장 윈도우 스레드 풀 + 12장 파이버11장 윈도우 스레드 풀 + 12장 파이버
11장 윈도우 스레드 풀 + 12장 파이버
 
11장 윈도우 스레드 풀
11장 윈도우 스레드 풀11장 윈도우 스레드 풀
11장 윈도우 스레드 풀
 
Mongo db문서의생성,갱신,삭제
Mongo db문서의생성,갱신,삭제Mongo db문서의생성,갱신,삭제
Mongo db문서의생성,갱신,삭제
 
Taocp 2.3.5
Taocp 2.3.5Taocp 2.3.5
Taocp 2.3.5
 
Taocp 2.3
Taocp 2.3Taocp 2.3
Taocp 2.3
 
Taocp 2.1~2.2
Taocp 2.1~2.2Taocp 2.1~2.2
Taocp 2.1~2.2
 
Taocp
TaocpTaocp
Taocp
 
재테크
재테크재테크
재테크
 
ManagingHumans/chap25~29
ManagingHumans/chap25~29ManagingHumans/chap25~29
ManagingHumans/chap25~29
 
DebugIt/chapter9~11
DebugIt/chapter9~11DebugIt/chapter9~11
DebugIt/chapter9~11
 
Holub on Patterns 1장 전
Holub on Patterns 1장 전Holub on Patterns 1장 전
Holub on Patterns 1장 전
 
2장 상태구도형 에이전트의 디자인
2장 상태구도형 에이전트의 디자인2장 상태구도형 에이전트의 디자인
2장 상태구도형 에이전트의 디자인
 
5장
5장5장
5장
 
프로그램은 왜 실패 하는가
프로그램은 왜 실패 하는가프로그램은 왜 실패 하는가
프로그램은 왜 실패 하는가
 

Recently uploaded

MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionKim Daeun
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)Tae Young Lee
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Wonjun Hwang
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Wonjun Hwang
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Kim Daeun
 

Recently uploaded (6)

MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
 

Html5&css 3장

  • 1. HTML5 & CSS3 3장. 사용자 중심의 웹 폼 만들기 김홍준 twitter.com/jun0683
  • 2. HTML 기본적인 폼 컨트롤 한계 기본폼 텍스트 필드 라디오 버튼 체크박스 멀티플 셀렉트 쓸려면... 하루종일... 버튼을 누르고.. 맥이면 다른키값 결국 다른 라이브러리 이용 폼끼리의 충돌문제
  • 3. HTML 기본적인 폼 컨트롤 한계
  • 4. 그래서? 새로운 폼 필드 타입 자동 포커스, 힌트 텍스트 contenteditable으로 HTML 요소를 입력 필드 로
  • 5. HTML5의 새로운 입력 폼 기본적인 폼 <form method="post" action="/projects/1"> <fieldset id="personal_information"> <legend>프로젝트 정보</legend>      <ol> <li> <label for="name">이름</label> <input type="text" name="name" autofocus="autofocus" id="name"> </li> <li>     <input type="submit" value="Submit"> </li> </ol> </legend> </fieldset> </form> ol : order list li : list item label(for) : 접근성(id값 참조)
  • 7. range로 슬라이더 만들기 <li>   <label for="priority">중요도</label>   <input type="range" min="0" max="10"          name="priority" value="0" id="priority"> </li>
  • 8. 숫자와 스핀박스 다루기 <li>   <label for="estimated_hours">예상 시간</label>   <input type="number" name="estimated_hours"          min="0" max="1000"          id="estimated_hours"> </li>
  • 9. 날짜 오페라만 제공 <li>   <label for="start_date">시작 날짜</label>   <input type="date" name="start_date" id="start_date"          value="2011-10-22"> </li>
  • 10. 이메일 모바일에서 유용 키보드 레이아웃이 변함 <li>   <label for="email">이메일 연락처</label>   <input type="email" name="email" id="email"> </li>
  • 11. URL 모바일에서 유용 <li>   <label for="url">테스트 URL</label>   <input type="url" name="url" id="url"> </li>
  • 12. 색깔 오페라는 제공... <li>   <label for="project_color">프로젝트 색상</label>   <input type="color" name="project_color" id="project_color"> </li>
  • 13. 새로운 타입을 지원하지 않을때.. 이해하지 못하는 브라우저는 단순 텍스트 필드로... jQuery UI나 YUI(야후UI) 사용해서 텍스트 필드와 연 결 나중에.. 브라우저가 지원하면 자바스크립트를 제거하 는 꿈을... 꾸어본다...
  • 14. 색상 선택기 교체(1) jQuery와 CSS3속성 선택자를 이용 색상 필드 를 찾아서 교체 color 타입의 input요소를 찾아, jQuery플러그 인 simpleColor를 적용 if (!hasColorSupport()){   $('input[type=color]').simpleColor(); }
  • 15. 색상 선택기 교체(2) 브라우저 자체에서 color타입을 지원한다면.. function hasColorSupport(){   input = document.createElement("input");   input.setAttribute("type", "color"); 브라우저 지원 체크   var hasColorType = (input.type !== "text");   if(hasColorType){     var testString = "foo";     input.value=testString; 브라우저 완벽지원 체크     hasColorType = (input.value != testString);   }   return(hasColorType); } if (!hasColorSupport()){   $('input[type=color]').simpleColor(); }
  • 16. jQuery $ == jQuery $('input[type=color]').simpleColor(); || jQuery('input[type=color]').simpleColor(); jQuery와 CSS3속성 선택자를 이용 색상 필드를 찾아서 교체
  • 17. 모더나이저(modernizr) HTML5와 CSS기능의 지원 여부를 검사 브라우저에서 지원하지 않는 기능을 대신 만 들어 주지 않음 has....
  • 18. autofocus 자동 포커스 이동 페이지 하나에 autofocus 속성 하나만 가능 <label for="name">이름</label> <input type="text" name="name" autofocus="autofocus" id="name"> 지원되지 않을때(jQurey) if(!hasAutofocus()){   $('input[autofocus=autofocus]').focus(); }
  • 19. placeholder 힌트제공 placeholder 속성 <label for="first_name">이름</label> <input id="first_name" type="text" autofocus="true" name="first_name" placeholder="한선용">
  • 20. 자동완성 방지 autocomplete 속성 <label for="password_confirmation">비밀번호 확인</label> <input id="password_confirmation" type="password"          name="password_confirmation" value=""          autocomplete="off" placeholder="비밀번호를 다시 입력하세요" />
  • 21. 지원하지 않을때.. jQuery가.. 갑인듯.. if(!hasPlaceholderSupport()){   $("#create_account").placeholder(); };
  • 22. contenteditable contenteditable을 이용한 즉석 편집 데이터 입력 부분을 자동으로 처리 텍스트영역을 감지해서 텍스트 필드로 바꾸는 작업 안해도 됨 <b>Name</b> <span id="name" contenteditable="true">Hugh Mann</span> 데모
  • 23. 데이터 유지 새로고침하면 내역이 사라짐 바꾼 내용을 서버로 전송 <b>Name</b> <span id="name" contenteditable="true">Hugh Mann</span> $(function(){ var status = $("#status"); $("span[contenteditable=true]").blur(function(){ var field = $(this).attr("id"); var value = $(this).text(); $.post("http://localhost:4567/users/1", field + "=" + value, function(data){ status.text(data); 서버에서 받은 데이터 } ); }); }); contenteditable 속성이 true로 설정된 모든 span 요소에 이벤트 핸들러를 연결(jQuery.blur)
  • 24. 지원되지 않을때.. 편집 페이지를 만들어라 자바스크립트 차단 + HTML5 지원 X 감지 기능 추가 if(document.getElementById("edit_profile_link").contentEditable != null){           $("#edit_profile_link").hide(); ...
  • 25. 미래엔.. 사이트 마다 다른 표현방식들.. 모든 브라우저가 HTML5 지원을 한다면.. -_-)b

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n