21.08.11

Today I Learned

e-sport.html

<!-- eSport Header -->
<header id="esport-header">
  <nav id="esport-nav">
    <div class="esport-container">
      <div class="nav-wrap esport-flex-between">
        <div class="left esport-flex-start">
          <h1><a href="#">e스포츠</a></h1>
          <ul class="esport-flex-start">
            <li><a href="#">GAME</a></li>
            <li><a href="#">PC게임</a></li>
          </ul>
        </div>
        <div class="center">
          <ul class="esport-flex-center">
            <li><a href="#" class="active"></a></li>
            <li><a href="#">뉴스</a></li>
            <li><a href="#">영상</a></li>
            <li><a href="#">일정</a></li>
            <li><a href="#">순위</a></li>
          </ul>
        </div>
        <div class="right esport-flex-end">
          <a href="#">로그인</a>
          <a href="#">메뉴</a>
        </div>
      </div>  
    </div>
  </nav>
  </div>
</header>

<!-- eSport Main -->
<main id="esport-main" role="main">
  <!-- eSport Main Top -->
  <div id="esport-main-top">
    <div class="esport-container">
      <!-- Timeline Wrap -->
      <div class="timeline-wrap">
        <ul class="esport-flex-start">
          <li>
            <a href="#">
              <span class="date">오늘 (06.05)</span>
              <h2>20201 LCK AS 챔피언십 풀리그 3일차</h2>
              <div class="status-wrap esport-flex-between">
                <span class="live">LIVE</span>
                <span class="status">진행중</span>
              </div>
            </a>
          </li>
          <li>
            <a href="#">
              <span class="date">오늘 (06.05)</span>
              <h2>20201 LCK AS 챔피언십 풀리그 3일차</h2>
              <div class="status-wrap esport-flex-between">
                <span class="live">LIVE</span>
                <span class="status">진행중</span>
              </div>
            </a>
          </li>
          <li>
            <a href="#">
              <span class="date">오늘 (06.05)</span>
              <h2>20201 LCK AS 챔피언십 풀리그 3일차</h2>
              <div class="status-wrap esport-flex-between">
                <span class="live">LIVE</span>
                <span class="status">진행중</span>
              </div>
            </a>
          </li>
          <li>
            <a href="#">
              <span class="date">오늘 (06.05)</span>
              <h2>20201 LCK AS 챔피언십 풀리그 3일차</h2>
              <div class="status-wrap esport-flex-between">
                <span class="live">LIVE</span>
                <span class="status">진행중</span>
              </div>
            </a>
          </li>
          <li>
            <a href="#">
              <span class="date">오늘 (06.05)</span>
              <h2>20201 LCK AS 챔피언십 풀리그 3일차</h2>
              <div class="status-wrap esport-flex-between">
                <span class="live">LIVE</span>
                <span class="status">진행중</span>
              </div>
            </a>
          </li>
          <li>
            <a href="#">
              <span class="date">오늘 (06.05)</span>
              <h2>20201 LCK AS 챔피언십 풀리그 3일차</h2>
              <div class="status-wrap esport-flex-between">
                <span class="live">LIVE</span>
                <span class="status">진행중</span>
              </div>
            </a>
          </li>
        </ul>
      </div>

      <!-- Live Wrap -->
      <div class="live-wrap">
        <h2>라이브중인 경기 <span class="count">2</span></h2>
        <ul class="esport-flex-between">
          <li>
            <a href="#" class="esport-flex-between">
              <img src="https://via.placeholder.com/442x250" alt="live">
              <div class="txt-wrap">
                <span>진행중</span>
                <h3>2021 PMPS S1 WEEKLY FINAL DAY 3</h3>
              </div>
            </a>
          </li>
          <li>
            <a href="#" class="esport-flex-between">
              <img src="https://via.placeholder.com/442x250" alt="live">
              <div class="txt-wrap">
                <span>진행중</span>
                <h3>2021 PMPS S1 WEEKLY FINAL DAY 3</h3>
              </div>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>

  <div class="esport-container">
    <!-- eSport Main Left -->
    <div class="left"></div>

    <!-- eSport Main Right -->
    <div class="right"></div>
  </div>
</main>

style.css

/* 08-11 */
/* eSport Page */
.esport-flex-between {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.esport-flex-start {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
}

.esport-flex-end {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

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

.esport-container {
    width: 1280px;
    margin: 0 auto;
}

/* eSport Header */
#esport-header {
    position: fixed;
    width: 100%;
    background-color: #151618;
    border-bottom: solid 1px gray;

    /* 브라우저의 왼쪽 상단을 기준으로 딱 붙게 된다. */
    left: 0;
    top: 0;
}

#esport-header #esport-nav a {
    color: #fff;
}

#esport-header #esport-nav .nav-wrap {
    height: 60px;
}

#esport-header #esport-nav .left h1 {
    font-size: 20px;
}

#esport-header #esport-nav .left li::before {
    display: inline-block;
    content: '';
    width: 1px;
    height: 14px;
    background-color: rgba(160, 165, 182, 0.3);
    margin: 0 12px;
}

#esport-header #esport-nav .left a {
    color: gray;
}

#esport-header #esport-nav .center li {
    margin-right: 24px;
}

#esport-header #esport-nav .center li:last-child {
    margin-right: 0;
}

#esport-header #esport-nav .center li a {
    display: inline-block;
    height: 60px;

    line-height: 60px; /* y축 중앙 정렬 */
    border-bottom: solid 5px transparent;

    color: gray;
    font-size: 17px;
}

#esport-header #esport-nav .center li a:hover {
    color: darkgrey;
}

#esport-header #esport-nav .center li a.active {
    color: #fff;
    border-bottom: solid 5px #fff;
}

#esport-header #esport-nav .right a {
    border: solid 1px hsla(0, 0%, 80%, 0.3);
    border-radius: 9px;

    padding: 4px 8px;

    font-size: 12px;
}

#esport-header #esport-nav .right a:last-child {
    margin-left: 10px;
}

/* eSpoart Main */
/* 
    만약 padding 속성을 추가하지 않는다면, fixed navbar는 다른 컨텐츠를 잡아 먹을 것이다.
*/
#esport-main {
    padding-top: 61px;
}

/* eSport Main Top */
#esport-main-top {
    background-color: #151618;
}

/* Timeline Wrap */
#esport-main-top .timeline-wrap {
    padding: 20px 0;
}

#esport-main-top .timeline-wrap ul {
}

#esport-main-top .timeline-wrap li {
    width: 16.6%; /* 원래 자바스크립트에 작성되었지만 일단 width 값으로 적용함 */
    background-color: #272b31;
    border-radius: 10px;
    margin-right: 1px;
}

#esport-main-top .timeline-wrap li:last-child {
    margin-right: 0;
}

#esport-main-top .timeline-wrap li a {
    display: block;
    width: 100%;
    padding: 14px 18px;
    color: #fff;
}

#esport-main-top .timeline-wrap li a .date {
    font-size: 12px;
    font-weight: 500;
}

#esport-main-top .timeline-wrap li a h2 {
    font-size: 13px;
    margin-top: 6px;
    color: #a0a5b6;
}

#esport-main-top .timeline-wrap li a .status-wrap {
    margin-top: 35px;
}

#esport-main-top .timeline-wrap li a .status-wrap .live {
    font-size: 12px;
    font-weight: 700;
}

#esport-main-top .timeline-wrap li a .status-wrap .status {
    font-size: 12px;
    font-weight: 500;
    color: red;
}

/* Live Wrap */
#esport-main-top .live-wrap {
    padding-bottom: 60px;
}

#esport-main-top .live-wrap h2 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 20px;
}

#esport-main-top .live-wrap h2 .count {
    color: #8a7cff;
}

#esport-main-top .live-wrap ul li {
    overflow: hidden;
    width: 625px;
    background-color: #1f2227;
    border-radius: 10px;
}

#esport-main-top .live-wrap a {
    /* display: block; */
    /* width: 100%; */
    /* height: 100%; */
    align-items: flex-start;
}

#esport-main-top .live-wrap li img {
    width: 442px;
    height: 250px;
}

#esport-main-top .live-wrap li .txt-wrap {
    width: 183px;
    padding: 17px 20px 22px;
}

#esport-main-top .live-wrap li .txt-wrap span {
    color: red;
    background-color: rgba(255, 0, 0, 0.2);
    border-radius: 3px;
    padding: 3px 7px;
}

#esport-main-top .live-wrap li .txt-wrap h3 {
    font-size: 15px;
    color: #fff;
    margin-top: 8px;
}

Review

오늘은 네이버 e스포츠 페이지 카피캣 작업을 시작했다. 페이지의 네비게이션바와 메인 영역의 상단 부분까지 작업했다. 네비게이션바의 포지션이 fixed인 경우 인접한 다른 컨텐츠를 잡아먹을 수 있다는 것을 알게 되었고, 이를 해결하기 위해서는 padding 속성을 이용해야 된다는 것을 알았다.

좋은 웹페이지 즐겨찾기