E. m.apping1907@gmail.com

   Insta. @uxui_web_lab

   P. +82(0)70-7799-6299


[아임웹 코드] 비주얼 섹션보다 더 비주얼한 섹션 구현하기

시연 동영상 보기


※ 홈페이지에 코드를 추가하고 코드가 추가된 섹션 우클릭 후 설정에서 가로 100%/ 좌우 여백 0px로 설정한 후 사용하세요!




<div class="morethanvisual03">

<main class="mainsection">

  <ul class='slider'>

    <li class='item' style="background-image: url('https://cdn.imweb.me/upload/S20220110de20c90fdecb7/19430cf288a81.jpg')">

      <div class='content'>

        <h2 class='title'>Starter 이상의 요금제</h2>

        <p class='description'> 아임웹 스타터 이상의 요금제에서만 적용됩니다  </p>

        <button>Read More</button>

      </div>

    </li>

    <li class='item' style="background-image: url('https://cdn.imweb.me/upload/S20220110de20c90fdecb7/0aeb08264bd39.jpg')">

      <div class='content'>

        <h2 class='title'>아임웹 코드 위젯</h2>

        <p class='description'> 아임웹 비주얼 섹션보다<br> 동적인 메인 페이지 </p>

        <button>Read More</button>

      </div>

    </li>

    <li class='item' style="background-image: url('https://cdn.imweb.me/upload/S20220110de20c90fdecb7/d8989d526c3f3.jpg')">

      <div class='content'>

        <h2 class='title'>상단 겹치기는 제한되지만</h2>

        <p class='description'> 보다 동적인 페이지는 고객들의 눈길을 사로잡을 수 있습니다.  </p>

        <button>Read More</button>

      </div>

    </li>

    <li class='item' style="background-image: url('https://cdn.imweb.me/upload/S20220110de20c90fdecb7/517fc6abeef6e.jpg')">

      <div class='content'>

        <h2 class='title'>코드는 설명란의 링크 확인</h2>

        <p class='description'>

          전체 코드 삽입은 설명란의 링크를 확인해주세요

        </p>

        <button>Read More</button>

      </div>

    </li>

    <li class='item' style="background-image: url('https://cdn.imweb.me/upload/S20220110de20c90fdecb7/e77f9f0c17edc.jpg')">

      <div class='content'>

        <h2 class='title'>코드 커스텀 문의는</h2>

        <p class='description'>

        홈페이지 우측 하단의 톡상담을 통해 문의주세요

        </p>

        <button>Read More</button>

      </div>

    </li>

    <li class='item' style="background-image: url('https://cdn.imweb.me/upload/S20220110de20c90fdecb7/e89c89546b044.jpg')">

      <div class='content'>

        <h2 class='title'>본 애니메이션은</h2>

        <p class='description'>아임웹 코드 위젯으로 작동된 애니메이션입니다.  </p>

        <button>Read More</button>

      </div>

    </li>

  </ul>

  <nav class='nav03'>

    <ion-icon class='btn prev' name="arrow-back-outline"></ion-icon>

    <ion-icon class='btn next' name="arrow-forward-outline"></ion-icon>

  </nav>

</main>


<script type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>

<script nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>

</div>


<style>

  * {

  margin: 0;

  padding: 0;

  box-sizing: border-box;

}


.morethanvisual03 {

  height: 100vh;

  display: grid;

  place-items: center;

  overflow: hidden;

}


.mainsection {

  position: relative;

  width: 100%;

  height: 100%;

  box-shadow: 0 3px 10px rgba(0,0,0,0.3);

}


.item {

  width: 200px;

  height: 300px;

  list-style-type: none;

  position: absolute;

  top: 50%;

  transform: translateY(-50%);

  z-index: 1;

  background-position: center;

  background-size: cover;

  border-radius: 20px;

  box-shadow: 0 20px 30px rgba(255,255,255,0.3) inset;

  transition: transform 0.1s, left 0.75s, top 0.75s, width 0.75s, height 0.75s;


  &:nth-child(1), &:nth-child(2) {

    left: 0;

    top: 0;

    width: 100%;

    height: 100%;

    transform: none;

    border-radius: 0;

    box-shadow: none;

    opacity: 1;

  }


  &:nth-child(3) { left: 50%; }

  &:nth-child(4) { left: calc(50% + 220px); }

  &:nth-child(5) { left: calc(50% + 440px); }

  &:nth-child(6) { left: calc(50% + 660px); opacity: 0; }

}


.content {

  width: min(30vw,400px);

  position: absolute;

  top: 50%;

  left: 150px;

  transform: translateY(-50%);

  font: 400 0.85rem helvetica,sans-serif;

  color: white;

  text-shadow: 0 3px 8px rgba(0,0,0,0.5);

  opacity: 0;

  display: none;

  width:400px;


  & .title {

    font-family: 'arial-black';

    text-transform: uppercase;

    font-size:32px;

  }


  & .description {

    line-height: 1.7;

    margin: 1rem 0 1.5rem;

    font-size: 24px;

  }


  & button {

    width: fit-content;

    background-color: rgba(0,0,0,0.1);

    color: white;

    border: 2px solid white;

    border-radius: 0.25rem;

    padding: 0.75rem;

    cursor: pointer;

    font-size:18px;

  }

}


.item:nth-of-type(2) .content {

  display: block;

  animation: show 0.75s ease-in-out 0.3s forwards;

}


@keyframes show {

  0% {

    filter: blur(5px);

    transform: translateY(calc(-50% + 75px));

  }

  100% {

    opacity: 1;

    filter: blur(0);

  }

}


.nav03 {

  position: absolute;

  bottom: 5rem;

  left: 50%;

  transform: translateX(-50%);

  z-index: 5;

  user-select: none;

  width:200px;

  height:auto;


  & .btn {

    background-color: rgba(255,255,255,0.5);

    color: rgba(0,0,0,0.7);

    border: 2px solid rgba(0,0,0,0.6);

    margin: 0 0.25rem;

    padding: 0.75rem;

    border-radius: 50%;

    cursor: pointer;

    width:30px;

    height:30px;


    &:hover {

      background-color: rgba(255,255,255,0.3);

    }

  }

}


@media (width > 650px) and (width < 900px) {

  .content {

    & .title        { font-size: 1rem; }

    & .description  { font-size: 0.7rem; }

    & button        { font-size: 0.7rem; }

  }

  .item {

    width: 160px;

    height: 270px;


    &:nth-child(3) { left: 50%; }

    &:nth-child(4) { left: calc(50% + 170px); }

    &:nth-child(5) { left: calc(50% + 340px); }

    &:nth-child(6) { left: calc(50% + 510px); opacity: 0; }

  }

}


@media (width < 650px) {

  .content {

    & .title        { font-size: 0.9rem; }

    & .description  { font-size: 0.65rem; }

    & button        { font-size: 0.7rem; }

  }

  .item {

    width: 130px;

    height: 220px;


    &:nth-child(3) { left: 50%; }

    &:nth-child(4) { left: calc(50% + 140px); }

    &:nth-child(5) { left: calc(50% + 280px); }

    &:nth-child(6) { left: calc(50% + 420px); opacity: 0; }

  }

}

  

</style>


<script>

  const slider = document.querySelector('.slider');


function activate(e) {

  const items = document.querySelectorAll('.item');

  e.target.matches('.next') && slider.append(items[0])

  e.target.matches('.prev') && slider.prepend(items[items.length-1]);

}


document.addEventListener('click',activate,false);

</script>





Copyright 2022. MAPPING All right reserved.

카카오톡 채널 채팅하기 버튼