반응형 웹 : 응용 예제

Study/반응형 웹

 

  • UI/UX 반응형 웹디자인&웹퍼블리셔 개발자 과정 - DAY 75



Review


 요즘은 포트폴리오 작업때문에 정신이 없다.

반응형을 늦게 배워서 그동안 만들었던 포트폴리오를 반응형으로 수정도 해야하고,

새로운 포트폴리오를 기획하고 있다.

 

지난주에는 GTQ 시험을 보고 왔는데, 1교시 일러스트 시험에서는 시험장이 정말 심하게

추웠다. 히터를 늦게 틀어주셔서 일단 손이 언 채로 입실했고, 시험 치는 내내 손이 얼어

있었다. 긴장도 한 탓인지 2문제를 풀 때까지는 계속 손이 얼어 있었던 것 같다.  

 

우왕자왕 1교시가 끝났고, 2교시 포토샵 시험을 칠 때는 긴장이 조금 풀렸다.

3-2-1-4의 순서로 풀 계획이었는데, 2번 문제를 풀 때 갑자기 한/영 키가 먹히지 않으면서

컴퓨터가 다운되었다. 음 계속 저장을 하고 있었지만 psd 파일이 아닌 jpg 파일로 저장하고

있어서 나는 처음부터 다시 풀었다 ^_^ 꺅

왜 그렇게 다들 저장을 강조하시는지 이제서야 알게 되다니... 이런 똥멍청이 !

그래도 선생님께서 추가 시간을 10분 정도 더 주신 덕분에 모든 문제를 완성했다.

포토샵 시험은 잘하면 합격할 수도 있겠지만,, 일러스트는 정말 똥망한 것 같다 하하

 

일러스트는 날이 따뜻할 때 재도전을 하기로...

일러스트는 진짜 스마일컴쌤, 은냐쌤 두 분 덕에 많은 것을 알게 되었당 !

아무것도 모르고 있었는데 개인적으로 스마일컴쌤 유튜브로 인해 신세계를 경험했다. 

스마일컴쌤은 교보문고에서 한 권 한 권 읽어보면서 알게 된 선생님이당 최고 -

 

여튼 요즘 아주 바쁘게 살고 있고, 필라테스 학원에서 매니저 일도 열심히 하고 있다.

필라테스 학원 웹 페이지를 포트폴리오로 만들어볼까 하는데 지금 하고 있는 것부터 

다 하고 차근차근 할 생각이다.

 

파이팅 !

 

 


 

  • UI/UX 반응형 웹디자인&웹퍼블리셔 개발자 과정 - DAY 75

 

 

<예제 1>

 

 

- HTML

 

    <div id="wrap">
      <header>
        <div id="header_wrap">
          <div class="logo">
            <h1>Web Design</h1>
          </div>
          <div class="gnb">
            <ul>
              <li><a href="#">Home</a></li>
              <li><a href="#">About us</a></li>
              <li><a href="#">Service</a></li>
              <li><a href="#">Contact us</a></li>
              <li><a href="#">Blog</a></li>
            </ul>
          </div>
          <div class="search">
            <input type="text" value="search" />
            <a href="#">
              <span class="material-symbols-outlined" style="cursor: pointer">
                search
              </span>
            </a>
          </div>
        </div>
      </header>

      <section>
        <article>
          What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing
          and typesetting industry. Lorem Ipsum has been the industry's standard
          dummy text ever since the 1500s, when an unknown printer took a galley
          of type and scrambled it to make a type specimen book. It has survived
          not only five centuries, but also the leap into electronic
          typesetting, remaining essentially unchanged. It was popularised in
          the 1960s with the release of Letraset sheets containing Lorem Ipsum
          passages, and more recently with desktop publishing software like
          Aldus PageMaker including versions of Lorem Ipsum. Why do we use it?
          It is a long established fact that a reader will be distracted by the
          readable content of a page when looking at its layout. The point of
          using Lorem Ipsum is that it has a more-or-less normal distribution of
          letters, as opposed to using 'Content here, content here', making it
          look like readable English. Many desktop publishing packages and web
          page editors now use Lorem Ipsum as their default model text, and a
          search for 'lorem ipsum' will uncover many web sites still in their
          infancy. Various versions have evolved over the years, sometimes by
          accident, sometimes on purpose (injected humour and the like). Where
          does it come from? Contrary to popular belief, Lorem Ipsum is not
          simply random text. It has roots in a piece of classical Latin
          literature from 45 BC, making it over 2000 years old. Richard
          McClintock, a Latin professor at Hampden-Sydney College in Virginia,
          looked up one of the more obscure Latin words, consectetur, from a
          Lorem Ipsum passage, and going through the cites of the word in
          classical literature, discovered the undoubtable source. Lorem Ipsum
          comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et
          Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC.
          This book is a treatise on the theory of ethics, very popular during
          the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit
          amet..", comes from a line in section 1.10.32. The standard chunk of
          Lorem Ipsum used since the 1500s is reproduced below for those
          interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et
          Malorum" by Cicero are also reproduced in their exact original form,
          accompanied by English versions from the 1914 translation by H.
          Rackham.
          <br />
          <br />
          What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing
          and typesetting industry. Lorem Ipsum has been the industry's standard
          dummy text ever since the 1500s, when an unknown printer took a galley
          of type and scrambled it to make a type specimen book. It has survived
          not only five centuries, but also the leap into electronic
          typesetting, remaining essentially unchanged. It was popularised in
          the 1960s with the release of Letraset sheets containing Lorem Ipsum
          passages, and more recently with desktop publishing software like
          Aldus PageMaker including versions of Lorem Ipsum. Why do we use it?
          It is a long established fact that a reader will be distracted by the
          readable content of a page when looking at its layout. The point of
          using Lorem Ipsum is that it has a more-or-less normal distribution of
          letters, as opposed to using 'Content here, content here', making it
          look like readable English. Many desktop publishing packages and web
          page editors now use Lorem Ipsum as their default model text, and a
          search for 'lorem ipsum' will uncover many web sites still in their
          infancy. Various versions have evolved over the years, sometimes by
          accident, sometimes on purpose (injected humour and the like). Where
          does it come from? Contrary to popular belief, Lorem Ipsum is not
          simply random text. It has roots in a piece of classical Latin
          literature from 45 BC, making it over 2000 years old. Richard
          McClintock, a Latin professor at Hampden-Sydney College in Virginia,
          looked up one of the more obscure Latin words, consectetur, from a
          Lorem Ipsum passage, and going through the cites of the word in
          classical literature, discovered the undoubtable source. Lorem Ipsum
          comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et
          Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC.
          This book is a treatise on the theory of ethics, very popular during
          the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit
          amet..", comes from a line in section 1.10.32. The standard chunk of
          Lorem Ipsum used since the 1500s is reproduced below for those
          interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et
          Malorum" by Cicero are also reproduced in their exact original form,
          accompanied by English versions from the 1914 translation by H.
          Rackham.
        </article>
      </section>
      <div class="btn">
        <span></span>
        <span></span>
        <span></span>
      </div>
    </div>

 

 

 

- CSS

 

      @font-face {
        font-family: montserrat;
        src: url(../fontawesome-free-6.2.0-web/webfonts/Montserrat-Medium.woff)
          format("woff");
      }

      @font-face {
        font-family: notosans;
        src: url(../fontawesome-free-6.2.0-web/webfonts/NotoSansKR-Regular.woff)
          format("woff");
      }

      * {
        margin: 0;
        padding: 0;

        font-family: montserrat, notosans;
      }

      ul,
      li {
        list-style: none;
      }

      a {
        text-decoration: none;

        color: #222222;
      }

      #wrap {
        position: relative;

        width: 100%;
        max-width: 1280px;

        margin: 0 auto;

        overflow: hidden;
      }

      header {
        width: 100%;

        background: skyblue;

        text-align: center;

        padding: 15px 0;
      }

      #header_wrap {
        display: flex;

        justify-content: space-around;
      }

      .gnb {
        display: flex;

        align-items: center;
      }

      .gnb ul {
        display: flex;
        justify-content: center;
      }

      .gnb ul li {
        margin: 0 20px;
      }

      .gnb ul li a:hover {
        font-weight: bolder;
      }

      .search {
        display: flex;
        align-items: center;
      }

      .search input {
        font-size: 16px;
      }

      section {
        width: 100%;

        border: 1px solid #222222;
        box-sizing: border-box;

        margin-top: 20px;
      }

      section > article {
        padding: 20px;

        background: #eee;

        text-align: justify;
      }

      .btn {
        position: absolute;
        top: 30px;
        right: 30px;

        width: 23px;
        height: 18px;

        display: none;

        cursor: pointer;
      }

      .btn span {
        position: absolute;
        width: 100%;
        height: 3px;

        background: #222222;

        border-radius: 5px;

        display: block;

        transition: transform 0.5s;
      }

      .btn span:first-child {
        top: 0;
      }

      .btn span:nth-child(2) {
        top: 50%;

        transform: translateY(-50%);
      }

      .btn span:last-child {
        bottom: 0;
      }

      .btn.on span:first-child {
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
      }

      .btn.on span:nth-child(2) {
        opacity: 0;
      }

      .btn.on span:last-child {
        bottom: 50%;
        transform: translateY(50%) rotate(-45deg);
      }

      @media screen and (max-width: 1024px) {
        #wrap {
          width: 99%;
        }

        #header_wrap {
          flex-direction: column;
        }

        #header_wrap div:first-child,
        #header_wrap div:nth-child(2) {
          margin-bottom: 20px;
        }

        .gnb {
          display: none;
        }

        .search {
          justify-content: center;
        }

        .btn {
          display: block;
        }
      }

      @media screen and (max-width: 480px) {
        #header_wrap .gnb ul li {
          margin: 0 10px;

          white-space: nowrap;
        }

        .logo {
          font-size: 12px;
        }

        .btn {
          top: 27px;
          right: 13px;
        }

        .btn span {
          width: 90%;
        }

        .search input {
          width: 50%;
        }
      }

 

 

 

- jQuery

 

      $(function () {
        $(".btn").click(function () {
          $(this).toggleClass("on");
          $(".gnb").slideToggle();
        });
      });

 

 

 

전체 페이지 (모니터 화면: 1900px)

 

0
가로 크기가 1024px일 때, 480px일 때

 

 


 

 

<예제 2>

 

 

- HTML

 

    <div id="wrap">
      <header>
        <div id="header_wrap">
          <div class="logo">
            <h1>Web Design</h1>
          </div>
          <div class="gnb">
            <ul>
              <li><a href="#">Home</a></li>
              <li><a href="#">About us</a></li>
              <li><a href="#">Service</a></li>
              <li><a href="#">Contact us</a></li>
              <li><a href="#">Blog</a></li>
            </ul>
          </div>
          <div class="sns">
            <ul>
              <li>
                <a href="#">
                  <i class="fa-brands fa-facebook-f"></i>
                </a>
              </li>
              <li>
                <a href="#">
                  <i class="fa-brands fa-twitter"></i>
                </a>
              </li>
              <li>
                <a href="#">
                  <i class="fa-brands fa-youtube"></i>
                </a>
              </li>
            </ul>
          </div>
        </div>
      </header>

      <section>
        <article>
          What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing
          and typesetting industry. Lorem Ipsum has been the industry's standard
          dummy text ever since the 1500s, when an unknown printer took a galley
          of type and scrambled it to make a type specimen book. It has survived
          not only five centuries, but also the leap into electronic
          typesetting, remaining essentially unchanged. It was popularised in
          the 1960s with the release of Letraset sheets containing Lorem Ipsum
          passages, and more recently with desktop publishing software like
          Aldus PageMaker including versions of Lorem Ipsum. Why do we use it?
          It is a long established fact that a reader will be distracted by the
          readable content of a page when looking at its layout. The point of
          using Lorem Ipsum is that it has a more-or-less normal distribution of
          letters, as opposed to using 'Content here, content here', making it
          look like readable English. Many desktop publishing packages and web
          page editors now use Lorem Ipsum as their default model text, and a
          search for 'lorem ipsum' will uncover many web sites still in their
          infancy. Various versions have evolved over the years, sometimes by
          accident, sometimes on purpose (injected humour and the like). Where
          does it come from? Contrary to popular belief, Lorem Ipsum is not
          simply random text. It has roots in a piece of classical Latin
          literature from 45 BC, making it over 2000 years old. Richard
          McClintock, a Latin professor at Hampden-Sydney College in Virginia,
          looked up one of the more obscure Latin words, consectetur, from a
          Lorem Ipsum passage, and going through the cites of the word in
          classical literature, discovered the undoubtable source. Lorem Ipsum
          comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et
          Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC.
          This book is a treatise on the theory of ethics, very popular during
          the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit
          amet..", comes from a line in section 1.10.32. The standard chunk of
          Lorem Ipsum used since the 1500s is reproduced below for those
          interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et
          Malorum" by Cicero are also reproduced in their exact original form,
          accompanied by English versions from the 1914 translation by H.
          Rackham.
          <br />
          <br />
          What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing
          and typesetting industry. Lorem Ipsum has been the industry's standard
          dummy text ever since the 1500s, when an unknown printer took a galley
          of type and scrambled it to make a type specimen book. It has survived
          not only five centuries, but also the leap into electronic
          typesetting, remaining essentially unchanged. It was popularised in
          the 1960s with the release of Letraset sheets containing Lorem Ipsum
          passages, and more recently with desktop publishing software like
          Aldus PageMaker including versions of Lorem Ipsum. Why do we use it?
          It is a long established fact that a reader will be distracted by the
          readable content of a page when looking at its layout. The point of
          using Lorem Ipsum is that it has a more-or-less normal distribution of
          letters, as opposed to using 'Content here, content here', making it
          look like readable English. Many desktop publishing packages and web
          page editors now use Lorem Ipsum as their default model text, and a
          search for 'lorem ipsum' will uncover many web sites still in their
          infancy. Various versions have evolved over the years, sometimes by
          accident, sometimes on purpose (injected humour and the like). Where
          does it come from? Contrary to popular belief, Lorem Ipsum is not
          simply random text. It has roots in a piece of classical Latin
          literature from 45 BC, making it over 2000 years old. Richard
          McClintock, a Latin professor at Hampden-Sydney College in Virginia,
          looked up one of the more obscure Latin words, consectetur, from a
          Lorem Ipsum passage, and going through the cites of the word in
          classical literature, discovered the undoubtable source. Lorem Ipsum
          comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et
          Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC.
          This book is a treatise on the theory of ethics, very popular during
          the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit
          amet..", comes from a line in section 1.10.32. The standard chunk of
          Lorem Ipsum used since the 1500s is reproduced below for those
          interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et
          Malorum" by Cicero are also reproduced in their exact original form,
          accompanied by English versions from the 1914 translation by H.
          Rackham.
        </article>
      </section>

      <div class="btn">
        <span></span>
        <span></span>
        <span></span>
      </div>
    </div>

 

 

 

- CSS

 

      @font-face {
        font-family: montserrat;
        src: url(../fontawesome-free-6.2.0-web/webfonts/Montserrat-Medium.woff)
          format("woff");
      }

      @font-face {
        font-family: notosans;
        src: url(../fontawesome-free-6.2.0-web/webfonts/NotoSansKR-Regular.woff)
          format("woff");
      }

      * {
        margin: 0;
        padding: 0;

        font-family: montserrat, notosans;
      }

      ul,
      li {
        list-style: none;
      }

      a {
        text-decoration: none;

        color: #222222;
      }

      #wrap {
        position: relative;

        width: 100%;
        max-width: 1280px;

        margin: 0 auto;

        overflow: hidden;
      }

      header {
        width: 100%;

        background: #eee;

        text-align: center;

        padding: 15px 0;
      }

      #header_wrap {
        display: flex;

        justify-content: space-around;
      }

      .logo h1:hover {
        color: #ffbb00;
      }

      .gnb {
        display: flex;
        justify-content: center;
        align-items: center;
      }

      .gnb ul {
        display: flex;

        width: 100%;
      }

      .gnb ul li {
        margin: 0 20px;
      }

      .gnb ul li a {
        display: block;
      }

      .gnb ul li a:hover {
        font-weight: bolder;
      }

      .sns {
        display: flex;
        justify-content: center;
        align-items: center;
      }

      .sns ul {
        display: flex;
      }

      .sns ul li {
        margin: 0 10px;
      }

      .sns ul li i {
        font-size: 20px;
        align-items: center;
      }

      .sns ul li:first-child a i {
        color: #1d98f0;
      }

      .sns ul li:nth-child(2) a i {
        color: #1d98f0;
      }

      .sns ul li:last-child a i {
        color: #fb3411;
      }

      section {
        width: 100%;

        border: 1px solid #222222;
        box-sizing: border-box;

        margin-top: 20px;
      }

      section > article {
        padding: 20px;

        background: #eee;

        text-align: justify;
      }

      .btn {
        position: absolute;
        top: 30px;
        right: 30px;

        width: 23px;
        height: 18px;

        display: none;

        cursor: pointer;
      }

      .btn span {
        position: absolute;
        width: 100%;
        height: 3px;

        background: #fff;

        border-radius: 5px;

        display: block;

        transition: transform 0.5s;
      }

      .btn span:first-child {
        top: 0;
      }

      .btn span:nth-child(2) {
        top: 50%;

        transform: translateY(-50%);
      }

      .btn span:last-child {
        bottom: 0;
      }

      .btn.on span:first-child {
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
      }

      .btn.on span:nth-child(2) {
        opacity: 0;
      }

      .btn.on span:last-child {
        bottom: 50%;
        transform: translateY(50%) rotate(-45deg);
      }

      nav {
        display: ;
      }

      @media screen and (max-width: 821px) {
        #wrap {
          width: 99%;
        }

        #header_wrap {
          flex-direction: column;
        }

        header {
          margin: 0;
          padding: 0;
        }

        .logo {
          background: #001b2e;

          padding: 20px 0;
        }

        .logo h1 {
          color: #fff;
        }

        .gnb {
          background: #fff;
        }

        .gnb ul {
          flex-direction: column;
        }

        .gnb ul li {
          border-bottom: 1px solid #ededed;
        }

        .gnb ul li a {
          padding: 30px 0;
        }

        .sns {
          background: #fecd47;

          padding: 20px 0;
        }

        .sns ul li:first-child a i,
        .sns ul li:nth-child(2) a i,
        .sns ul li:last-child a i {
          color: #fff;
        }

        section {
          display: none;
        }

        .btn {
          display: block;
        }
      }

      @media screen and (max-width: 480px) {
        .logo {
          font-size: 12px;
        }

        .btn {
          top: 27px;
          right: 13px;
        }

        .btn span {
          width: 90%;
        }
      }

 

 

 

- jQuery

 

      $(function () {
        function resizefn() {
          let wd = $(window).width();

          if (wd < 822) {
            $(".gnb, .sns").hide();
          } else {
            $(".gnb, .sns").show();
          }
        }

        $(window).resize(function () {
          resizefn();
        });

        $(".btn").click(function () {
          $(this).toggleClass("on");
          $(".gnb, .sns").slideToggle();
        });
      });

 

두 번째 예제에서는 JavaScript에서 조금 더 추가해봤다. 메뉴와 sns div가 사라졌다 생겼다.

slideToggle() 메소드를 이용하니 아주 간단하구만-

 

 

전체 페이지 (모니터 화면: 1900px)

 

 

0
가로 크기가 821px일 때, 480px일 때

 

 

반응형 너무 재밌는 것 같다. 나는 CSS가 제일 재밌어서 걱정이다... 허허

자바스크립트로 빨리빨리 배워서 더 예쁘고 멋진 걸 만들어야지 !!!!

 

 

 

 

 

반응형