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 ์ดํ๋ก ๊ฐ๋ก ์คํฌ๋กค์ด ์๊ธฐ๋ ํ์์ด ์์ด ์ฌ์ด์ฆ๋ฅผ ๊ฐ์ ํ๋ค.
์ ์ฒด์ ์ผ๋ก body์ min-width๊ฐ์ด ์์ด์ ๋นผ์ฃผ์๊ณ , ๋ฉ์ธ ์น์ ์์์ด ํ๋ฉด์ ๋ฒ์ด๋ over-flow:hidden;์ ์ฃผ์ด ๊ฐ๋จํ๊ฒ ํด๊ฒฐํ๋ค!!
๊ฐ์ (์ ) : ํ๋ฉด ํฌ๊ธฐ๋ณด๋ค ํฐ ์ฝํ ์ธ ๋ก ๊ฐ๋ก์คํฌ๋กค์ด ์๊น ๊ฐ์ (ํ) : ํ๋ฉด ํฌ๊ธฐ์ ์ฝํ ์ธ ๋ฅผ ๋ง์ถค
2. scroll ์์
๊ธฐ์กด ์ฌ์ดํธ ์ฌ์ด๋ ๋ฉ๋ด๋ฅผ ๋ณด๋ฉด ๋ฉ์ธ ์คํฌ๋กค๊ณผ, ์ฌ์ด๋ ๋ฉ๋ด์ overflowY: scroll;์ด ๋๋ค ๋ณด์ด๋ ํ์์ด ์์ด์ ์ ์ ์ด ์๋ค. ๐จ
๋ฉ๋ด ํด๋ฆญ์ body์ overflow : 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>
๊ฐ์ (์ ) : ํ์ ์ฐฝ ๋ค์ ๋ฉ์ธ์ฝํ ์ธ ์ ์คํฌ๋กค์ด ๋จ์์์ ๊ฐ์ (ํ) : ์คํฌ๋กค ์ญ์
๐ ๋ฐ์ํ
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๋ ์ปค์คํ ํ๋ ๋ง์ด ์๋ค.๐ swiper-button-disabled์ด๋ผ๋ ํด๋์ค๊ฐ ์๋๋ฐ ์ฒ์๊ณผ ๋ง์ง๋ง button์ ์ ํํ๋ class๋ช ์ด๋ค.
๊ทธ๋์ ์๋์ ๊ฐ์ด ์ปจํ ์ธ ๋ฅผ ๋๊ธฐ๋ค๊ฐ ๋ค์ ์ปจํ ์ธ ๊ฐ ์์ผ๋ฉด ๋ฒํผ์ด ๋นํ์ฑํ๊ฐ ๋๊ฒ ์ฒ๋ผ opacity:0.5;์ ์ฃผ์ด ์ฌ์ฉ์์๊ฒ ์์์ ์ผ๋ก ๋ง์ง๋ง ํ์ด์ง๋ผ๋ ๊ฒ์ ์๋ ค์ฃผ์๋ค. ์ข ๋ ๋ณด๊ธฐ ํธํด์ง๊ฑฐ ๊ฐ๋ค!
2. swiper-slide-active
๋ฐ๋๋ก swiper-slide-active ํ์ฌ ๋ณด์ด๋ slide์ class๋ช ๋ ์๋ค. ๋ฉ์ธ ๋์์์ด ์ค์์ดํผ ํ ๋ ํ์ ์ฌ๋ผ์ดํธ๋ ํ ์คํธ๊ฐ opacity:0 ์์ 1๋ก ๋ฐ๋๊ฒ ํ์๋ค.
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 ์ด์์ผ ๋
},
});
๐ ํฌ๊ธฐ๊ฐ ๋ค๋ฅธ ์ด๋ฏธ์ง ์ฌ์ด์ฆ ํต์ผ์ํค๊ธฐ
์ ๊ณต๋๋ ์ด๋ฏธ์ง์ ์ฌ์ด์ฆ๊ฐ ๋ค๋ฅธ ์ํ์์ ํต์ผ์ํค๋ ๋ฐฉ๋ฒ!
์ฌ์ด์ฆ๋ฅผ ํต์ผ ์ํค๋ ๋ฐฉ๋ฒ์๋ ์ฌ๋ฌ๊ฐ์ง๊ฐ ์์ง๋ง, ์ด๋ฒ์ ํ์์ ์์ฐ๋ ์ฌ์ฉํด ๋ณด์๋ค!
์๋๋ img๋ฅผ ๊ฐ์ธ๋ ํ๊ทธ์ ์ํ๋ ๋์ด, ๋์ด ๊ฐ์ ์ฃผ๊ณ img์๋ wudth:100%, height:100%, object-fit:cover์ ์ฃผ์ด ๊ฐ๋จํ ๋๋ด์ง๋ง ์ด๋ฒ์ img๋ฅผ ๊ฐ์ธ๋ ํ๊ทธ์ padding์ ์ฌ์ฉํด ์ฌ์ด์ฆ๋ฅผ ์ฃผ์๋ค.
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);
});
'Code Review' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
์ฌ๋ฆฌ๋ธ์ ์จ๋ผ์ธ๋ชฐ (์ ์ํ PC, Mobile) (1) | 2024.01.31 |
---|---|
์ํฐํ๋ผ์ด์ฆ๋ธ๋ก์ฒด์ธ (0) | 2024.01.10 |
๋ค์ฐ์คํผ์ค (0) | 2023.09.19 |
์์ธ์์ฒญ (0) | 2023.02.17 |
์์คํ ๊ณต๊ฐ ๊ฐ์ฌํฉ๋๋ค