본문 바로가기
SITE

이미지 타입 03

by 코빈_ 2022. 8. 21.

이미지 타입 03

사이트에 기초적인 구조를 가진 이미지 타입 사이트를 만들어 봅시다.

Site HTML

사이트를 코딩하는 데에 필요한 HTML의 구조를 잡아줍니다.
section내에 각 태그에 이름을 부여해주며, articel 영역과 figure태그 내에 img를 사용줍니다.
추가적인 작업으로 image__sns a 영역에 ir를 사용해줍니다.

    <section id="imageType03" class="image__wrap score section">
        <h2>wynd</h2>
        <p>
            사전적 의미로 골목길이라는 뜻을 가지고 있습니다.
        </p>
        <div class="image__inner container-fluid">
            <article class="image">
                <!-- <figure class="image__box">
                    <img src="img/image03_01.jpg" alt="About us">
                </figure> -->
                <div class="image__desc">
                    <h3>About us</h3>
                    <p>슬로우한 캐주얼 웨어</p>
                </div>
                <div class="image__sns">
                    <a href="#" class="link"><span class="ir">icon</span></a>
                    <a href="#" class="link"><span class="ir">icon</span></a>
                    <a href="#" class="link"><span class="ir">icon</span></a>
                    <a href="#" class="link"><span class="ir">icon</span></a>
                    <a href="#" class="link"><span class="ir">icon</span></a>
                </div>
            </article>
            <article class="image">
                <figure class="image__box">
                    <img src="img/image03_02.jpg" alt="Bearded Kid">
                </figure>
                <div class="image__desc">
                    <h3>Bearded Kid</h3>
                    <p>다양성의 존중이라는 슬로건</p>
                </div>
                <div class="image__sns">
                    <a href="#" class="link"><span class="ir">icon</span></a>
                    <a href="#" class="link"><span class="ir">icon</span></a>
                </div>
            </article>
            <article class="image">
                <figure class="image__box">
                    <img src="img/image03_03.jpg" alt="Fall Break">
                </figure>
                <div class="image__desc">
                    <h3>Fall Break</h3>
                    <p>가벼운 휴식 뒤 리프레시되는 느낌의 의류</p>
                </div>
                <div class="image__sns">
                    <a href="#" class="link"><span class="ir">icon</span></a>
                    <a href="#" class="link"><span class="ir">icon</span></a>
                </div>
            </article>
            <article class="image">
                <figure class="image__box">
                    <img src="img/image03_04.jpg" alt="Pottery">
                </figure>
                <div class="image__desc">
                    <h3>Pottery</h3>
                    <p>현대사회에 알맞는 유니폼을 제안</p>
                </div>
                <div class="image__sns">
                    <a href="#" class="link"><span class="ir">icon</span></a>
                    <a href="#" class="link"><span class="ir">icon</span></a>
                </div>
            </article>
            <article class="image">
                <figure class="image__box">
                    <img src="img/image03_05.jpg" alt="Shirter">
                </figure>
                <div class="image__desc">
                    <h3>Shirter</h3>
                    <p>가치를 잃지 않는 변화</p>
                </div>
                <div class="image__sns">
                    <a href="#" class="link"><span class="ir">icon</span></a>
                    <a href="#" class="link"><span class="ir">icon</span></a>
                </div>
            </article>
        </div>
    </section>

Site CSS

사이트를 코딩하는 데에 필요한 css의 구조를 잡아줍니다.
이번 코딩 css는 ir, 이미지 스프라이트를 사용하여 스타일을 잡아줍니다.

    /* fonts */
    @import url('https://webfontworld.github.io/score/SCoreDream.css');
    
    .score {
        font-family: SCoreDream;
        font-weight: 400;
    }
    /* reset */
    * {
        margin: 0;
        padding: 0;
    }
    a {
        text-decoration: none;
        color: #000;
    }
    img {
        width: 100%;
        vertical-align: top;
    }
    h1, h2, h3, h4, h5, h6 {
        font-weight: normal;
    }
    .ir {
        display: block;
        overflow: hidden;
        font-size: 0;
        line-height: 0;
        text-indent: -9999px;
    }

    /* common */
    .container {
        width: 1160px;
        padding: 0 20px;
        margin: 0 auto;
        min-width: 1160px;
    }
    .container-fluid {
        width: 100%;
        padding: 0 100px;
        box-sizing: border-box;
    }
    .section {
        padding: 120px 0;
    }
    .section > h2 {
        font-size: 50px;
        line-height: 1;
        text-align: center;
        margin-bottom: 20px;
    }
    .section > p {
        font-size: 22px;
        font-weight: 300;
        color: #666;
        text-align: center;
        margin-bottom: 70px;
    }
    /* imageType */
    .image__inner {
        display: grid;
        grid-template-areas:
            "box1 box1 box2 box3"
            "box1 box1 box4 box5";
        grid-template-columns: 1fr 1fr 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        grid-gap: 20px;
    }
    .image {
        position: relative;
        overflow: hidden;
    }
    .image__inner .image:nth-child(1) {
        grid-area: box1;
        background: url(img/image03_01.jpg);
        background-size: cover;
    }
    .image__inner .image:nth-child(2) {
        grid-area: box2;
    }
    .image__inner .image:nth-child(3) {
        grid-area: box3;
    }
    .image__inner .image:nth-child(4) {
        grid-area: box4;
    }
    .image__inner .image:nth-child(5) {
        grid-area: box5;
    }
    .image__desc {
        position: absolute;
        left: 0;
        bottom: -100%;
        width: 100%;
        background: rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(10px);
        padding: 16px;
        box-sizing: border-box;
        transition: all 0.5s ease;
    }
    .image:hover .image__desc {
        bottom: 0;
    }
    .image__desc p {
        font-size: 16px;
        color: #666;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .image__sns {
        position: absolute;
        right: -100px;
        top: 10px;
        transition: all 0.5s ease;
    }
    .image__sns a {
        width: 36px;
        height: 36px;
        background: #fff;
        border-radius: 50%;
        display: block;
        margin-bottom: 5px;
        background: url(img/image_bg03_icon.svg) no-repeat;
    }
    .image__sns a:nth-child(1) {}
    .image__sns a:nth-child(2) {
        background-position: -50px 0;
    }
    .image__sns a:nth-child(3) {
        background-position: -100px 0;
    }
    .image__sns a:nth-child(4) {
        background-position: -150px 0;
    }
    .image__sns a:nth-child(5) {
        background-position: -200px 0;
    }
    .image:hover .image__sns {
        right: 10px;
    }

결과물

'SITE' 카테고리의 다른 글

텍스트 타입 02  (1) 2022.08.31
텍스트 타입 01  (4) 2022.08.30
이미지 타입 02  (2) 2022.08.17
이미지 타입 01  (3) 2022.08.17
카드 타입 03  (8) 2022.08.10

댓글


INFORMATION

javascript

css

html