์ƒˆ์†Œ์‹

์ธ๊ธฐ ๊ฒ€์ƒ‰์–ด

Code Review

NAVER Careers

  • -

 

 

๐Ÿ“๋„ค์ด๋ฒ„ ์ปค๋ฆฌ์–ด

๐Ÿ‘‰ ์‚ฌ์ดํŠธ๋ช… : ๋„ค์ด๋ฒ„์ปค๋ฆฌ์–ด
๐Ÿ‘‰ ์ž‘์—…๊ธฐ๊ฐ„ : 3์ผ
๐Ÿ‘‰ ์‚ฌ์šฉ์–ธ์–ด : HTML5, CSS3, JQuery
๐Ÿ‘‰ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ : Swiper
๐Ÿ‘‰ ๋ถ„๋ฅ˜ : ๋ฐ˜์‘ํ˜• ์›น์‚ฌ์ดํŠธ
๐Ÿ‘‰ URL : https://codenablog.github.io/Naver-careers/


โœจPOINT

โœ”๏ธ Medis query ๋ฐ˜์‘ํ˜•
โœ”๏ธ label ์‚ฌ์šฉ๊ณผ custum
โœ”๏ธ swiper ํ™œ์šฉ๊ณผ custum


๐Ÿ’ก ๊ฐœ์„ ํ•œ ์ 

1. ํƒœ๋ธ”๋ฆฟ ํฌ๊ธฐ ๋ฐ˜์‘ํ˜• ๋ณด์™„

๊ธฐ์กด NAVER Careers๋Š” 1230px(ํƒœ๋ธ”๋ฆฟ) ํฌ๊ธฐ์—์„œ ๊ฐ€๋กœ ์Šคํฌ๋กค์ด ์ƒ๊ธฐ๋Š” ํ˜„์ƒ์ด ์žˆ์–ด ํƒœ๋ธ”๋ฆฟ ํฌ๊ธฐ์— ๋งž๊ฒŒ ๋ณด์ผ ์ˆ˜ ์žˆ๋„๋ก ๊ฐœ์„ ์„ ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

์ „์ฒด์ ์œผ๋กœ min-width๊ฐ’์„ ๋นผ์ฃผ์—ˆ๊ณ   ํ™”๋ฉด์„ ๋ฒ—์–ด๋‚˜๋Š” swiper๋ถ€๋ชจ์—๋งŒ over-flow:hidden;์„ ์ฃผ์–ด ์™„์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.

 

๊ฐœ์„  (์ „) : ํ™”๋ฉด ํฌ๊ธฐ๋ณด๋‹ค ํฐ ์ฝ˜ํ…์ธ ๋กœ ๊ฐ€๋กœ์Šคํฌ๋กค์ด ์ƒ๊น€                 ๊ฐœ์„  (ํ›„) : ํ™”๋ฉด ํฌ๊ธฐ์— ์ฝ˜ํ…์ธ ๋ฅผ ๋งž์ถค

 

 

2. scroll ์ˆ˜์ •

ํŒ์—… ์ฐฝ์— ๋ฉ”์ธ์ปจํ…์ธ ์˜ ์Šคํฌ๋กค์ด ๊ทธ๋Œ€๋กœ ๋ณด์ด๋Š” ํ˜„์ƒ์ด ์žˆ์–ด์„œ  over-flow-y : hidden;์œผ๋กœ ์‚ญ์ œํ•˜์˜€์Šต๋‹ˆ๋‹ค.

 

 <script>
  $('.search-area-mo').click(function(){
    $('body').addClass('scroll');
  });
  $('.sc-popup .btn-close').click(function(){
    $('body').removeClass('scroll');
  });
  </script>
  
  <style>
    body.scroll{
      overflow-y: hidden;
    }
  </style>

 

ss

๊ฐœ์„  (์ „) : ํŒ์—… ์ฐฝ ๋’ค์— ๋ฉ”์ธ์ฝ˜ํ…์ธ ์˜ ์Šคํฌ๋กค์ด ๋‚จ์•„์žˆ์Œ                                    ๊ฐœ์„  (ํ›„) : ์Šคํฌ๋กค ์‚ญ์ œ

 


๐Ÿ“ ๋ฐ˜์‘ํ˜•

1. ๋ฐ˜์‘ํ˜• ์‚ฌ์ด์ฆˆ ๊ทœ๊ฒฉ

 

2. ๋ฏธ๋””์–ด ์ฟผ๋ฆฌ (Media Query)

๋ฏธ๋””์–ด ์ฟผ๋ฆฌ๋Š” ํŠน์ • ์กฐ๊ฑด์ด true์ธ ๊ฒฝ์šฐ์—๋งŒ ์ฝ”๋“œ ๋ธ”๋ก{ } ๋‚ด๋ถ€์˜ CSS ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•ด ์ฃผ๋Š” ๊ตฌ๋ฌธ์ด๋‹ค. ๋ฏธ๋””์–ด ์ฟผ๋ฆฌ๋Š” ์ฃผ๋กœ ํฌ๊ฒŒ 3๊ฐ€์ง€ ๊ตฌ๊ฐ„์œผ๋กœ ๋‚˜๋ˆ„๋Š”๋ฐ ๋‚˜๋Š” ์•„๋ž˜์ฒ˜๋Ÿผ ๊ตฌ๊ฐ„์„ ์„ค์ •ํ–ˆ๋‹ค.

@media(max-width:1230px){} //laptop, tablet

@media(max-width:1024px){} //tablet

@media(max-width:767px){} //mbile

 

TIP) ๋ฐ˜์‘ํ˜• ํŽ˜์ด์ง€๋ฅผ ์ž‘์„ฑ ํ• ๋•Œ ์ตœ์†Œ ๋ทฐ๋ฅผ ๊ธฐ์ค€์„ ์ž‘์—…ํ•˜๋Š” ๊ฒƒ์ด ์ข‹๋‹ค.

๋งŒ์•ฝ ๋ชจ๋ฐ”์ผ์„ ์ž‘์„ฑํ•˜๋‹ค๊ณ  ํ•˜๋ฉด, ๋ชจ๋ฐ”์ผ ํ™”๋ฉด ํฌ๊ธฐ๋Š” 320px  ~ 767px์ด๊ธฐ ๋•Œ๋ฌธ์— ์ตœ์†Œ์‚ฌ์ด์ฆˆ๋ฅผ ๊ณ ๋ คํ•ด์„œ 320pxํ™”๋ฉด์„ ๊ธฐ์ค€์œผ๋กœ ์ž‘์„ฑํ•˜๋ฉด ๋œ๋‹ค. ํ…Œ๋ธ”๋ฆฟ๋„ 768px ~ 1024px์ด๊ธฐ ๋•Œ๋ฌธ์— 768px์„ ๊ธฐ์ค€์œผ๋กœ ์ž‘์„ฑ.

TIP) ๋ถ„๊ธฐ๋ณ„๋กœ ๋””์ž์ธ์ด ์™„์ „ํžˆ ๋ฐ”๋€๋‹ค๋ฉด max- ์™€  min- ๋™์‹œ์‚ฌ์šฉ, ๋น„์Šทํ•˜๊ฒŒ ์ผ๋ถ€๋งŒ ๋ฐ”๋€๋‹ค๋ฉด ๋‘˜ ์ค‘ ํ•˜๋‚˜ ์„ ํƒ์‚ฌ์šฉ.

 

 


๐Ÿ“ swiper custum

1. swiper-button-disabled

swiper-button-disabled : navigation button ์ค‘์—์„œ ์ฒ˜์Œ๊ณผ ๋งˆ์ง€๋ง‰ button์„ ์„ ํƒํ•˜๋Š” class๋ช…

 

slide๊ฐ€ ๋๋‚˜๋ฉด button์— opacity:0.5;์„ ์ฃผ์–ด ์‚ฌ์šฉ์ž์—๊ฒŒ ์‹œ์ž‘์ ์œผ๋กœ ๋งˆ์ง€๋ง‰ ํŽ˜์ด์ง€๋ผ๋Š” ๊ฒƒ์„ ์•Œ๋ ค์ฃผ์—ˆ๋‹ค.

 

2. swiper-slide-active

swiper-slide-active : ํ˜„์žฌ ๋ณด์ด๋Š” slide์˜ class๋ช…

 

swiperํ• ๋•Œ text๊ฐ€ fade-in/out ๋˜๊ฒŒ ํ•˜์˜€๋‹ค.

 

3. breakpoints

 const benefitsSlide = new Swiper(".benefits-slide", {
    slidesPerView: 1, // ํ™”๋ฉด์˜ ๋„“์ด๊ฐ€ 768px ์ดํ•˜์ผ๋•Œ
    spaceBetween: 30,
    navigation: {
      nextEl: ".btn.next",
      prevEl: ".btn.prev",
    },
    breakpoints: {
      768: { slidesPerView: 2, spaceBetween: 30, }, // ํ™”๋ฉด์˜ ๋„“์ด๊ฐ€ 768px ์ด์ƒ์ผ ๋•Œ
      1024: { slidesPerView: 3, spaceBetween: 30, }, // ํ™”๋ฉด์˜ ๋„“์ด๊ฐ€ 1024px ์ด์ƒ์ผ ๋•Œ
    },
  });
 
 

 


๐Ÿ“ ํฌ๊ธฐ๊ฐ€ ๋‹ค๋ฅธ ์ด๋ฏธ์ง€ ์‚ฌ์ด์ฆˆ ํ†ต์ผ์‹œํ‚ค๊ธฐ

์ œ๊ณต๋˜๋Š” ์ด๋ฏธ์ง€์˜ ์‚ฌ์ด์ฆˆ๊ฐ€ ๋‹ค๋ฅธ ์ƒํƒœ์—์„œ  ํ†ต์ผ์‹œํ‚ค๋Š” ๋ฐฉ๋ฒ•!

 

1. ์ด๋ฏธ์ง€๋“ค์˜ width๊ฐ€ ๊ฐ™์„ ๋•Œ pabbing-bottom์— ์›ํ•˜๋Š” height๊ฐ’์„ ์ค€๋‹ค.

.sc-people .people-slide .swiper-slide .img-area{
  padding-bottom: 47.403%;  // ์ด ๊ฐ’์ด height๊ฐ’์ด ๋œ๋‹ค.
  position: relative;
}

 

2. pabbing ํฌ๊ธฐ๊ฐ€ ์›ํ•˜๋Š” ์ด๋ฏธ์ง€ ์‚ฌ์ด์ฆˆ ๊ฐ’์ด ๋˜๋Š” ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

 

3. ์ดํ›„์— ์ด๋ฏธ์ง€๋ฅผ positon:apsolute๋ฅผ ์‚ฌ์šฉํ•ด์„œ  padding ์œ„์— ์˜ฌ๋ ค๋†“์œผ๋ฉด ์ด๋ฏธ์ง€ ์‚ฌ์ด์ฆˆ๋ฅผ ํ†ต์ผ์‹œํ‚ฌ ์ˆ˜ ์žˆ๋‹ค.

.sc-people .people-slide .swiper-slide img{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

 

 


๐Ÿ“ input checkbox custum

 

 ๐Ÿ”Ž๊ธฐ๋ณธ HTML

  <div class="group-filter">
    <ul class="filter-list">
      <span class="title">์ง๊ตฐ/์ง๋ฌด</span>
      <li class="filter-item">
        <button class="title">Tech</button>
        <ul class="sub-list1">
          <li class="sub-item check">
            <input type="checkbox" id="TechAll"><label for="TechAll" class="all-ch">์ „์ฒด</label>
          </li>
          <li class="sub-item">
            <button type="button" class="title">Software Development</button>
            <ul class="sub-list2">
              <li class="sub-item2 check">
                <input type="checkbox" id="Frontend"><label for="Frontend">Frontend</label>
                <input type="checkbox" id="Android"><label for="Android">Android</label>
                <input type="checkbox" id="iOS"><label for="iOS">iOS</label>
                <input type="checkbox" id="AIML"><label for="AIML">AI/ML</label>
                <input type="checkbox" id="DataEngineering"><label for="DataEngineering">Data Engineering</label>
                <input type="checkbox" id="EmbeddedSW"><label for="EmbeddedSW">Embedded SW</label>
                <input type="checkbox" id="Graphics"><label for="Graphics">Graphics</label>
              </li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </div>
  <button class="btn-clear" type="button" aria-label="์ดˆ๊ธฐํ™”">Clear filters</button>
  <button class="btn-close" type="button" aria-label="๋‹ซ๊ธฐ"></button>

 

๐Ÿ”Ž์ฝ”๋“œ๋ถ„์„ css

.check label::before{
    content: '';
    position: absolute;
    left: 0;
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1px solid #d0d0d0;
    border-radius: 50%;
    margin-top: 8px;
  }
  .check input{
    position: absolute;
    clip: rect(0,0,0,0);
  }
  .check input:checked+label::before{
    background: #000;
  }

 

๐Ÿ”Ž์ฝ”๋“œ๋ถ„์„ script

  $('.all-ch').click(function(){
    if ($(this).siblings('input').prop('checked')) {
      $(this).parent().siblings().find('input').prop('checked',false);
    } else {
      $(this).parent().siblings().find('input').prop('checked',true);
    }
    $(this).find('input').prop('checked',true);
  });

  $('.btn-clear').click(function(){
    $('.group-filter input').prop('checked',false);
  });

 

 

 

 

Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.