์›น์—์„œ ๋งŒ๋‚˜๋Š” ์ „๊ธฐ์ฐจ์˜ ๋ฏธํ•™: ํฌ๋ฅด์‰ ๋””์ž์ธ ๊ฐœ๋ฐœ๊ธฐ

2023. 11. 29. 20:47ใ†Development๐Ÿ‘ฉ๐Ÿป‍๐Ÿฆณ/Dynamic Web

 

 

 

์›น์‚ฌ์ดํŠธ์˜ ํ•ต์‹ฌ ์š”์†Œ: FOOTER, LOGOS, ๋„ค๋น„๊ฒŒ์ด์…˜ ๋ฉ”๋‰ด ๊ตฌํ˜„ํ•˜๊ธฐ
์›น ๊ฐœ๋ฐœ์˜ ์„ธ๊ณ„์—์„œ, ์‚ฌ์šฉ์ž ๊ฒฝํ—˜(UX)๋Š” ์ตœ์šฐ์„ ์ž…๋‹ˆ๋‹ค. ์˜ค๋Š˜์€ ์›น์‚ฌ์ดํŠธ์—์„œ ์ค‘์š”ํ•œ ์„ธ ๋ถ€๋ถ„์ธ FOOTER, LOGOS, ๊ทธ๋ฆฌ๊ณ  ๋„ค๋น„๊ฒŒ์ด์…˜ ๋ฉ”๋‰ด๋ฅผ ์–ด๋–ป๊ฒŒ ๊ตฌํ˜„ํ•˜๋Š”์ง€ ์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

1. FOOTER์˜ ์ค‘์š”์„ฑ๊ณผ ๊ตฌํ˜„
์›น์‚ฌ์ดํŠธ์˜ ํ•˜๋‹จ์— ์œ„์น˜ํ•˜๋Š” FOOTER๋Š” ์‚ฌ์šฉ์ž์—๊ฒŒ ์œ ์šฉํ•œ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•˜๋Š” ์ค‘์š”ํ•œ ์˜์—ญ์ž…๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—๋Š” ์ €์ž‘๊ถŒ ์ •๋ณด, ์—ฐ๋ฝ์ฒ˜, ์‚ฌ์ดํŠธ ๋งต, ์†Œ์…œ ๋ฏธ๋””์–ด ๋งํฌ ๋“ฑ์ด ํฌํ•จ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํšจ๊ณผ์ ์ธ FOOTER ๋””์ž์ธ์€ ์‚ฌ์šฉ์ž์˜ ์›น์‚ฌ์ดํŠธ ํƒ์ƒ‰์„ ๋•๊ณ , ํ•„์š”ํ•œ ์ •๋ณด๋ฅผ ์‰ฝ๊ฒŒ ์ฐพ์„ ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

 

(์ด์ „ ์ฝ”๋“œ์‚ฌ์šฉ์‹œ ๋ฉ”๋‰ด๋ฐ”๊ฐ€ ์—ด๋ฆฐ์ดํ›„ ํ•˜๋‹จ ์Šคํฌ๋กค๋ง์‹œ ํ•จ๊ป˜ ๋ธ”๋Ÿฌ์ฒ˜๋ฆฌ๊ฐ€๋˜์„œ ํ™”๋ฉด๊ตฌ์„ฑ์ด ํˆฌ๋ช…ํ•˜๊ฒŒ ๋ณด์ด๋Š” ์˜ค๋ฅ˜๋ฅผ

์ œ์ž‘์ค‘ ๋งŒ๋‚˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ์ฝ”๋“œ์— ๊ทธ๋ž˜์„œ ๋ฉ”๋‰ด๊ฐ€ ์—ด๋ฆฌ๊ณ  ๋‹ซํž๋•Œ ๋ธ”๋Ÿฌํšจ๊ณผ๊ฐ€ ์ ์šฉ๋˜๊ณ  ์ œ๊ฑฐ๋˜๋„๋ก ๋‹ค์‹œ ์„ค๊ณ„ํ•˜์˜€์Šต๋‹ˆ๋‹ค)

2. LOGOS ์„น์…˜
LOGOS ์„น์…˜์€ ๋ธŒ๋žœ๋“œ ์ธ์ง€๋„๋ฅผ ๋†’์ด๋Š” ๋ฐ ์ค‘์š”ํ•œ ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—์„œ๋Š” ์›น์‚ฌ์ดํŠธ๊ฐ€ ํ˜‘๋ ฅํ•˜๋Š” ๋‹ค์–‘ํ•œ ๋ธŒ๋žœ๋“œ๋‚˜ ํ›„์›์‚ฌ์˜ ๋กœ๊ณ ๋ฅผ ํ‘œ์‹œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋กœ๊ณ ๋Š” ์‹œ๊ฐ์ ์œผ๋กœ ๋งค๋ ฅ์ ์ด๋ฉด์„œ๋„ ์›น์‚ฌ์ดํŠธ์˜ ์ „๋ฐ˜์ ์ธ ๋””์ž์ธ๊ณผ ์กฐํ™”๋ฅผ ์ด๋ฃจ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

3. ๋™์ ์ธ ๋„ค๋น„๊ฒŒ์ด์…˜ ๋ฉ”๋‰ด
์‚ฌ์šฉ์ž์˜ ์›น์‚ฌ์ดํŠธ ๋‚ด ํƒ์ƒ‰์„ ์‰ฝ๊ฒŒ ๋งŒ๋“œ๋Š” ์š”์†Œ ์ค‘ ํ•˜๋‚˜๋Š” ๋„ค๋น„๊ฒŒ์ด์…˜ ๋ฉ”๋‰ด์ž…๋‹ˆ๋‹ค. ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ด์šฉํ•ด ๋ฉ”๋‰ด๋ฅผ ํšจ๊ณผ์ ์œผ๋กœ ์ œ์–ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ๋ฉ”๋‰ด ํ‘œ์‹œ ๋ฐ ์ˆจ๊น€, ๋ธ”๋Ÿฌ ํšจ๊ณผ ์ ์šฉ, ๋ชจ๋ฐ”์ผ์—์„œ์˜ ๋ฉ”๋‰ด ๊ด€๋ฆฌ ๋“ฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ๊ธฐ๋Šฅ์€ ์›น์‚ฌ์ดํŠธ์˜ ์‚ฌ์šฉ์ž ์นœํ™”์„ฑ์„ ํฌ๊ฒŒ ํ–ฅ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค.

์ด ํฌ์ŠคํŠธ์—์„œ๋Š” ๊ฐ ์„น์…˜์˜ ๊ตฌ์ฒด์ ์ธ ๊ตฌํ˜„ ๋ฐฉ๋ฒ•๊ณผ ์ฝ”๋“œ ์˜ˆ์‹œ๋ฅผ ์ œ๊ณตํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์›น ๊ฐœ๋ฐœ์— ๊ด€์‹ฌ ์žˆ๋Š” ๋ถ„๋“ค์—๊ฒŒ ์ด ์ •๋ณด๊ฐ€ ๋„์›€์ด ๋˜๊ธฐ๋ฅผ ๋ฐ”๋ž๋‹ˆ๋‹ค.

 

๋ณ€๊ฒฝ๋œ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ฝ”๋“œ

const navMenu = document.getElementById('nav-menu'),
      navToggle = document.getElementById('nav-toggle'),
      navClose = document.getElementById('nav-close'),
      header = document.getElementById('header'); // ํ—ค๋” ์š”์†Œ

/*===== MENU SHOW =====*/
/* Validate if constant exists */
if(navToggle){
    navToggle.addEventListener('click', () =>{
        navMenu.classList.add('show-menu');
        header.style.backdropFilter = 'none'; // ๋ฉ”๋‰ด๊ฐ€ ์—ด๋ฆด ๋•Œ ๋ธ”๋Ÿฌ ํšจ๊ณผ ์ œ๊ฑฐ
    })
}

/*===== MENU HIDDEN =====*/
/* Validate if constant exists */
if(navClose){
    navClose.addEventListener('click', () =>{
        navMenu.classList.remove('show-menu');
        header.style.backdropFilter = 'blur(10px)'; // ๋ฉ”๋‰ด๊ฐ€ ๋‹ซํž ๋•Œ ๋ธ”๋Ÿฌ ํšจ๊ณผ ์ ์šฉ
    })
}

/*===== SCROLL EVENT FOR BLUR EFFECT =====*/
window.addEventListener('scroll', () => {
  if (!navMenu.classList.contains('show-menu')) {
    // ๋ฉ”๋‰ด๊ฐ€ ๋‹ซํ˜€ ์žˆ์„ ๋•Œ ์Šคํฌ๋กค์— ๋”ฐ๋ผ ๋ธ”๋Ÿฌ ํšจ๊ณผ ์กฐ์ ˆ
    header.style.backdropFilter = window.scrollY > 50 ? 'blur(10px)' : 'none';
  }
});

/*=============== REMOVE MENU MOBILE ===============*/
const navLink = document.querySelectorAll('.nav__link')

const linkAction = () =>{
    const navMenu = document.getElementById('nav-menu')
    // When we click on each nav__link, we remove the show-menu class
    navMenu.classList.remove('show-menu')
}
navLink.forEach(n => n.addEventListener('click', linkAction))

/*=============== CHANGE BACKGROUND HEADER ===============*/

function scrollHeader  () {
    const header = document.getElementById('header')
    // When the scroll is greater than 50 viewport height, add the scroll-header class to the header tag
    if(this.scrollY >= 50) header.classList.add('scroll-header'); 
    else header.classList.remove('scroll-header')
}
window.addEventListener('scroll', scrollHeader)


/*=============== CHANGE BACKGROUND HEADER ===============*/
document.querySelectorAll('.home__car-number').forEach(number => {
    const updateCount = () => {
        const target = +number.getAttribute('data-target');
        const count = +number.innerText;
        const increment = target / 100; 

        if (count < target) {
            number.innerText = Math.ceil(count + increment);
            number.classList.add('is-visible'); // ์—ฌ๊ธฐ์— ํด๋ž˜์Šค ์ถ”๊ฐ€
            setTimeout(updateCount, 10);
        } else {
            number.innerText = target;
            number.classList.add('is-visible'); // ๋ชฉํ‘œ์— ๋„๋‹ฌํ–ˆ์„ ๋•Œ๋„ ํด๋ž˜์Šค ์ถ”๊ฐ€
        }
    };

    updateCount();
});

/*=============== POPULAR SWIPER ===============*/

let swiperPopular = new Swiper(".popular__container", {
    loop: true,
    spaceBetween: 24,
    slidesPerView: 'auto',
    grabCursor: true,

  pagination: {
    el: ".swiper-pagination",
    dynamicBullets: true,
  },
  
  breakpoints: {
  768: {
    slidesPerView: 3,
  },
  1024: {
    spaceBetween: 48,
  },
},
});

/*=============== MIXITUP FILTER FEATURED ===============*/
let mixerFeatured = mixitup('.featured__content', {
    selectors: {
        target: '.featured__card'
    },
    animation: {
        duration: 300
    }
});

/* Link active featured */ 
const linkFeatured = document.querySelectorAll('.featured__item')


function activeFeatured(){
    linkFeatured.forEach(l=> l.classList.remove('active-featured'))
    this.classList.add('active-featured')
}
linkFeatured.forEach(l=> l.addEventListener('click',activeFeatured))
/*=============== SHOW SCROLL UP ===============*/ 
const scrollUp = () =>{
	const scrollUp = document.getElementById('scroll-up')
    // When the scroll is higher than 350 viewport height, add the show-scroll class to the a tag with the scrollup class
	this.scrollY >= 350 ? scrollUp.classList.add('show-scroll')
						: scrollUp.classList.remove('show-scroll')
}
window.addEventListener('scroll', scrollUp)

/*=============== SCROLL SECTIONS ACTIVE LINK ===============*/
const sections = document.querySelectorAll('section[id]')
    
const scrollActive = () =>{
  	const scrollDown = window.scrollY

	sections.forEach(current =>{
		const sectionHeight = current.offsetHeight,
			  sectionTop = current.offsetTop - 58,
			  sectionId = current.getAttribute('id'),
			  sectionsClass = document.querySelector('.nav__menu a[href*=' + sectionId + ']')

		if(scrollDown > sectionTop && scrollDown <= sectionTop + sectionHeight){
			sectionsClass.classList.add('active-link')
		}else{
			sectionsClass.classList.remove('active-link')
		}                                                    
	})
}
window.addEventListener('scroll', scrollActive)

 

 

 

 

์˜ค์ž‘๋™ํ•˜๋Š” ํ™”๋ฉด์ž…๋‹ˆ๋‹ค
์ •์ƒ ์ž‘๋™ํ•˜๋Š” ํ™”๋ฉด์ž…๋‹ˆ๋‹ค

 

 

 

/*=============== OFFER ===============*/
.offer{
  position: relative;
}

.offer__container{
  grid-template-rows: max-content 224px;
}

.offer__bg{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.offer__data,
.offer__img{
  position: relative;
}

.offer__data{
  text-align: center;
}

.offer__title{
  margin-bottom: 2rem;
}

.offer__description{
  margin-bottom: 3rem;
}

.offer__img{
  position: absolute;
  max-width: initial;
  width: 400px;
  bottom: 2rem;
  right: -5.5rem;
}
/*=============== LOGOS ===============*/
.logos__img{
  width: 40px;
  opacity: .4;
  transition: .3s;
}

.logos__container{
  grid-template-columns: repeat(3, max-content);
  justify-content: center;
  align-items: center;
  gap: 4rem;
  padding-bottom: 2rem;
}

.logos__img:hover{
  opacity: 1;
}
/*=============== FOOTER ===============*/
.footer{
  position: relative;
  overflow: hidden;
}

.footer .shape__big,
.footer .shape__small{
  position: absolute;
}

.footer .shape__big{
  width: 300px;
  height: 300px;
  left: -12rem;
  top: 6rem;
}

.footer .shape__small{
  right: -13rem;
  bottom: -6rem;
}

.footer__container{
  row-gap: 2.5rem;
  position: relative;
}

.footer__logo{
  display: inline-flex;
  align-items: center;
  column-gap: .25rem;
  color: var(--title-color);
  font-size: var(--h2-font-size);
  font-weight: var(--font-semi-bold);
  margin-bottom: 1.25rem;
  transition: .3s;
}

.footer__logo i{
  font-size: 1.5rem;
  font-weight: 500;
}

.footer__logo:hover{
  color: var(--first-color);
}

.footer__title{
  font-size: var(--h3-font-size);
  margin-bottom: 1.25rem;
}

.footer__links{
  display: flex;
  flex-direction: column;
  row-gap: .5rem;
}

.footer__link,
.footer__social-link{
  color: var(--text-color);
  transition: .3s;
}

.footer__link:hover,
.footer__social-link:hover{
  color: var(--title-color);
}

.footer__social{
  display: flex;
  column-gap: 1.5rem;
}

.footer__social-link{
  font-size: 1.25rem;
}

.footer__copy{
  display: block;
  margin-top: 4.5rem;
  text-align: center;
  font-size: var(--small-font-size);
  color: var(--text-color-light);
}
/*=============== SCROLL BAR ===============*/
::-webkit-scrollbar{
  width: .6rem;
  background-color: hsl(219, 4%, 16%);
  border-radius: 1rem;
}

::-webkit-scrollbar-thumb{
  background-color: hsl(219, 4%, 24%);
}

::-webkit-scrollbar-thumb:hover{
  background-color: hsl(219, 4%, 32%);
}

/*=============== SCROLL UP ===============*/
.scrollup{
  position: fixed;
  right: 1rem;
  bottom: -30%;
  background-color: hsla(0, 0%, 100%, .1);
  backdrop-filter: blur(16px);
  display: inline-flex;
  padding: .45rem;
  border-radius: .5rem;
  font-size: 1.15rem;
  color: var(--white-color);
  z-index: var(--z-tooltip);
  transition: .4s;
}

.scrollup:hover{
  transform: translateY(-.25rem);
}
/* Show Scroll Up*/
.show-scroll{
  bottom: 3rem;
}

์Šคํƒ€์ผ๋ง์„ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค

 

์ด๋ฒˆ์— ์‚ฌ์šฉํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค

 

Featured Luxury Cars

์ƒˆ๋กœ์šด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ kunkalabs๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ Featured Luxury Cars๋ฉ”๋‰ด๋ฅผ ๊ตฌ์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค

 

 

๋ฒ„ํŠผ ๊ตฌํ˜„์ž์ฒด๊ฐ€ ๋งค์šฐ ๋ถ€๋“œ๋Ÿฝ๊ฒŒ๋ฉ๋‹ˆ๋‹ค ใ…Žใ…Ž

ํด๋ฆญ์‹œ ์ปฌ๋Ÿฌ๊ฐ€ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ์‚ฝ์ž…๋˜๋ฉด์„œ ์˜ฌ๋ผ์˜ค๋Š”๊ฒŒ ์˜ˆ์˜๋‹ค๊ณ  ์ƒ๊ฐ๋ฌ๋˜ ๋ถ€๋ถ„์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค

 

 

์‚ฌ์šฉ๋œ ํ•จ์ˆ˜ ๋ฆฌ๋ทฐํ•ด๋ณด์ž๋ฉด

 

 

const linkFeatured = document.querySelectorAll('.featured__item'): .featured__item ํด๋ž˜์Šค๋ฅผ ๊ฐ€์ง„ ๋ชจ๋“  ์š”์†Œ๋ฅผ ์„ ํƒํ•˜๊ณ , linkFeatured ์ƒ์ˆ˜์— ์ด๋“ค์˜ ๋ชฉ๋ก์„ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.

function activeFeatured() { ... }: activeFeatured๋ผ๋Š” ํ•จ์ˆ˜๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. 

์ด ํ•จ์ˆ˜๋Š” ํด๋ฆญ๋œ ์š”์†Œ์— 'active-featured' ํด๋ž˜์Šค๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ , ๋‹ค๋ฅธ ๋ชจ๋“  ์š”์†Œ์—์„œ ์ด ํด๋ž˜์Šค๋ฅผ ์ œ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.

linkFeatured.forEach(l => l.classList.remove('active-featured')): linkFeatured์— 

์ €์žฅ๋œ ๋ชจ๋“  ์š”์†Œ๋ฅผ ์ˆœํšŒํ•˜๋ฉด์„œ, ๊ฐ ์š”์†Œ์—์„œ 'active-featured' ํด๋ž˜์Šค๋ฅผ ์ œ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.

this.classList.add('active-featured'): ํ˜„์žฌ ํด๋ฆญ๋œ ์š”์†Œ(this๋ฅผ ํ†ตํ•ด ์ฐธ์กฐ)์— 'active-featured' ํด๋ž˜์Šค๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. 

์ด๋Š” ์‚ฌ์šฉ์ž๊ฐ€ ํด๋ฆญํ•œ ์š”์†Œ๋ฅผ ์‹œ๊ฐ์ ์œผ๋กœ ๊ฐ•์กฐํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

linkFeatured.forEach(l => l.addEventListener('click', activeFeatured)): linkFeatured์— ์ €์žฅ๋œ ๋ชจ๋“  ์š”์†Œ์— ๋Œ€ํ•ด 

ํด๋ฆญ ์ด๋ฒคํŠธ ๋ฆฌ์Šค๋„ˆ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๊ฐ€ ์ด ์š”์†Œ๋“ค ์ค‘ ํ•˜๋‚˜๋ฅผ ํด๋ฆญํ•˜๋ฉด activeFeatured ํ•จ์ˆ˜๊ฐ€ ์‹คํ–‰๋˜์–ด, 

ํด๋ฆญ๋œ ์š”์†Œ์— 'active-featured' ํด๋ž˜์Šค๊ฐ€ ์ถ”๊ฐ€๋˜๊ณ  ๋‹ค๋ฅธ ์š”์†Œ๋“ค์—์„œ๋Š” ์ œ๊ฑฐ๋ฉ๋‹ˆ๋‹ค.

์ด ์ฝ”๋“œ๋Š” ์‚ฌ์šฉ์ž๊ฐ€ 'featured' ์„น์…˜์˜ ๋‹ค๋ฅธ ํ•ญ๋ชฉ์„ ํด๋ฆญํ•  ๋•Œ๋งˆ๋‹ค ์‹œ๊ฐ์  ํ”ผ๋“œ๋ฐฑ์„ ์ œ๊ณตํ•˜์—ฌ, ํ˜„์žฌ ์„ ํƒ๋œ ํ•ญ๋ชฉ์„ ๋ช…ํ™•ํ•˜๊ฒŒ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

 

 

scrollrevealjs์˜ ํ™ˆํŽ˜์ด์ง€ ๋ฉ”์ธ์ด๋‹ค

์ด๋ ‡๊ฒŒ ๋‘๋ฒˆ์งธ ํ”„๋กœ์ ํŠธ๋„ ์„ฑํ™ฉ๋ฆฌ์— ๋งˆ์ณค์Šต๋‹ˆ๋‹ค 

๋‹ค์Œ ํ”„๋กœ์ ํŠธ๋Š” ๋ฆฌ์•กํŠธ๋กœ ๋Œ์•„์˜ค๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค๐Ÿค—