๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Site

[์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ] ์ด๋ฏธ์ง€ ์œ ํ˜• 03 - ์ด๋ฏธ์ง€ ์Šคํ”„๋ผ์ดํŠธ & IRํšจ๊ณผ ํ™œ์šฉํ•˜๊ธฐ

by ์ฝ”๋”ฉ๊ณต์ฑ… 2022. 8. 20.
๋ฐ˜์‘ํ˜•

์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ : ์ด๋ฏธ์ง€ ์œ ํ˜• 03

์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” Figma์—์„œ ๋งŒ๋“  ์ด๋ฏธ์ง€ ์œ ํ˜• ์„น์…˜์„ HTML๊ณผ CSS ์ฝ”๋“œ๋กœ ์˜ฎ๊ธฐ๋Š” ์ž‘์—…์„ ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.


Figma

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

HTML ์†Œ์Šค

์›น ํ‘œ์ค€ ์ค€์ˆ˜๋ฅผ ์œ„ํ•ด ์‹œ๋งจํ‹ฑ ํƒœ๊ทธ๋ฅผ ์ ๊ทน ์‚ฌ์šฉํ•˜๋„๋ก ํ•˜์ž. ์ž์„ธํ•œ ์„ค๋ช…์€ ์•„๋ž˜ ์˜ˆ์‹œ ์ฝ”๋“œ์˜ ์ฃผ์„์ฒ˜๋ฆฌ ๋‚ด์šฉ์„ ์ฐธ์กฐํ•  ๊ฒƒ.

<body>
    <section id="imageType03" class="image__wrap gmarket section">
        <h1>๊ท€์—ฌ์šด ํ—ฌ๋กœํ‚คํ‹ฐ๋ฅผ ๋ณด๊ณ  ๊ฐ€์„ธ์š”๐Ÿ˜ป</h1>
        <p>
            ์‚ฐ๋ฆฌ์˜ค์˜ ์ƒ์ง• ์บ๋ฆญํ„ฐ ํ—ฌ๋กœํ‚คํ‹ฐ๋ฅผ ๋ณด๋ฉฐ ํž๋งํ•ฉ์‹œ๋‹ค. ๊ท€์—ฌ์šด ๊ณ ์–‘์ด ์นœ๊ตฌ ํ—ฌ๋กœํ‚คํ‹ฐ๋ฅผ ์‹ค์ปท ๋ณด๊ณ  ๊ฐ€์„ธ์š”!
        </p>
        <div class="image__inner container-fluid">
            <article class="image">
                <div class="image__desc">
                    <h3>ํ—ฌ๋กœํ‚คํ‹ฐ ๊ฐ€์กฑ๋“ค</h3>
                    <p>๊ฐ€์กฑ๋“ค๊ณผ ํ•จ๊ป˜ ๋†€์ด๋™์‚ฐ์— ๋†€๋Ÿฌ์˜จ ํ‚คํ‹ฐ์˜ˆ์š” ๐Ÿ˜ป</p>
                </div>
                <div class="image__sns">
                    <!-- ir ํšจ๊ณผ : ์Šคํฌ๋ฆฐ ๋ฆฌ๋”๊ธฐ์—๋Š” ์ฝํžˆ์ง€๋งŒ ๊ฒ‰์œผ๋กœ๋Š” ์•ˆ ๋ณด์ด๊ฒŒ ํ•˜๋Š” ์ž‘์—… -->
                    <a href="#" class="link"><span class="ir">๊ณต์œ ํ•˜๊ธฐ</span></a>
                    <a href="#" class="link"><span class="ir">Twitter</span></a>
                    <a href="#" class="link"><span class="ir">Instagram</span></a>
                    <a href="#" class="link"><span class="ir">YouTube</span></a>
                    <a href="#" class="link"><span class="ir">Facebook</span></a>
                </div>
            </article>
            <article class="image">
                <figure class="image__box">
                    <img src="img/imageType03_bg02.jpg" alt="์‚ด์•„์žˆ๋Š” ํ—ฌ๋กœํ‚คํ‹ฐ">
                </figure>
                <div class="image__desc">
                    <h3>์‚ด์•„์žˆ๋Š” ํ—ฌ๋กœํ‚คํ‹ฐ</h3>
                    <p>ํ—ฌ๋กœํ‚คํ‹ฐ๋Š” ํ˜„์‹ค ์†์— ์‚ด๊ณ  ์žˆ์–ด์š”.</p>
                </div>
                <div class="image__sns">
                    <a href="#" class="link"><span class="ir">๊ณต์œ ํ•˜๊ธฐ</span></a>
                    <a href="#" class="link"><span class="ir">Twitter</span></a>
                    <a href="#" class="link"><span class="ir">Instagram</span></a>
                    <a href="#" class="link"><span class="ir">YouTube</span></a>
                    <a href="#" class="link"><span class="ir">Facebook</span></a>
                </div>
            </article>
            <article class="image">
                <figure class="image__box">
                    <img src="img/imageType03_bg03.jpg" alt="ํ—ฌ๋กœํ‚คํ‹ฐ ํŠœ๋‹์นด">
                </figure>
                <div class="image__desc">
                    <h3>ํ—ฌ๋กœํ‚คํ‹ฐ ํŠœ๋‹์นด</h3>
                    <p>์—ฌ๋Ÿฌ๋ถ„์˜ ์ž๋™์ฐจ๋„ ์ด๋ ‡๊ฒŒ ๊พธ๋ฉฐ๋ด์š”.</p>
                </div>
                <div class="image__sns">
                    <a href="#" class="link"><span class="ir">๊ณต์œ ํ•˜๊ธฐ</span></a>
                    <a href="#" class="link"><span class="ir">Twitter</span></a>
                    <a href="#" class="link"><span class="ir">Instagram</span></a>
                    <a href="#" class="link"><span class="ir">YouTube</span></a>
                    <a href="#" class="link"><span class="ir">Facebook</span></a>
                </div>
            </article>
            <article class="image">
                <figure class="image__box">
                    <img src="img/imageType03_bg04.jpg" alt="ํ—ฌ๋กœํ‚คํ‹ฐ ๋„ค์˜จ์‚ฌ์ธ">
                </figure>
                <div class="image__desc">
                    <h3>ํ—ฌ๋กœํ‚คํ‹ฐ ๋„ค์˜จ์‚ฌ์ธ</h3>
                    <p>๊ฐ์„ฑ์ ์ธ ํ—ฌ๋กœํ‚คํ‹ฐ ๋„ค์˜จ์‚ฌ์ธ์ž…๋‹ˆ๋‹ค.</p>
                </div>
                <div class="image__sns">
                    <a href="#" class="link"><span class="ir">๊ณต์œ ํ•˜๊ธฐ</span></a>
                    <a href="#" class="link"><span class="ir">Twitter</span></a>
                    <a href="#" class="link"><span class="ir">Instagram</span></a>
                    <a href="#" class="link"><span class="ir">YouTube</span></a>
                    <a href="#" class="link"><span class="ir">Facebook</span></a>
                </div>
            </article>
            <article class="image">
                <figure class="image__box">
                    <img src="img/imageType03_bg05.jpg" alt="์‚ฐ๋ฆฌ์˜ค ์ฃผ์‹ํšŒ์‚ฌ">
                </figure>
                <div class="image__desc">
                    <h3>์‚ฐ๋ฆฌ์˜ค ์ฃผ์‹ํšŒ์‚ฌ</h3>
                    <p>www.sanrio.co.jp</p>
                </div>
                <div class="image__sns">
                    <a href="#" class="link"><span class="ir">๊ณต์œ ํ•˜๊ธฐ</span></a>
                    <a href="#" class="link"><span class="ir">Twitter</span></a>
                    <a href="#" class="link"><span class="ir">Instagram</span></a>
                    <a href="#" class="link"><span class="ir">YouTube</span></a>
                    <a href="#" class="link"><span class="ir">Facebook</span></a>
                </div>
            </article>
        </div>
    </section>
</body>

CSS ์†Œ์Šค

reset์—์„œ margin๊ฐ’๊ณผ padding๊ฐ’์„ 0์œผ๋กœ ์ดˆ๊ธฐํ™” ์‹œํ‚ค๋Š” ์ž‘์—…๋ถ€ํ„ฐ ์‹œ์ž‘ํ•œ๋‹ค.
๋˜ํ•œ, ์• ๋‹ˆ๋ฉ”์ด์…˜ ํšจ๊ณผ๋ฅผ ์ฃผ๊ธฐ ์œ„ํ•ด transition ์†์„ฑ๊ณผ :hover ์†์„ฑ์„ ์ ๊ทน ํ™œ์šฉํ•œ๋‹ค.
์ด๋ฒˆ์—๋Š” SNS ๊ณต์œ  ์•„์ด์ฝ˜ 5๊ฐœ๋ฅผ ํ‘œ์‹œํ•˜๊ธฐ ์œ„ํ•ด ์ด๋ฏธ์ง€ ์Šคํ”„๋ผ์ดํŠธ ํšจ๊ณผ๊นŒ์ง€ ์‚ฌ์šฉ๋˜์—ˆ๋‹ค.
์ž์„ธํ•œ ์„ค๋ช…์€ ์•„๋ž˜ ์˜ˆ์‹œ ์ฝ”๋“œ์˜ ์ฃผ์„์ฒ˜๋ฆฌ๋œ ๋‚ด์šฉ์„ ์ฐธ์กฐํ•  ๊ฒƒ.

/* fonts */
@import url('https://webfontworld.github.io/gmarket/GmarketSans.css');

.gmarket {
    font-family: 'GmarketSans';
    font-weight: 400;
}

/* reset */
* {
    margin: 0;
    padding: 0;
}
h1, h2, h3, h4, h5, h6 {
    font-weight: normal;
}
a {
    text-decoration: none;
    color: #000;
}
img {
    width: 100%;    /* ์ด๋ฏธ์ง€ ํŠ€์–ด๋‚˜์˜จ ๊ฑฐ ์ง‘์–ด๋„ฃ๊ธฐ */
    vertical-align: top;    /* ์ด๋ฏธ์ง€ ์‚ฌ์ด์ฆˆ ๋นˆ๊ณต๊ฐ„์—†์ด ๋งž์ถฐ์ฃผ๊ธฐ */
}

/* 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 > h1 {
    font-size: 50px;
    line-height: 1;
    text-align: center;
    margin-bottom: 20px;
}
.section > p {
    font-size: 22px;
    font-weight: 300;
    text-align: center;
    margin-bottom: 70px;
    color: #666;
}

/* ir ํšจ๊ณผ (์ด๋ฏธ์ง€ ๋Œ€์ฒด ํšจ๊ณผ == alt) */
/* ํ™”๋ฉด์ƒ์—์„œ๋Š” ์•ˆ๋‚˜์˜ค๊ฒŒ ํ•จ๊ณผ ๋™์‹œ์— ์Šคํฌ๋ฆฐ๋ฆฌ๋”๊ธฐ์—๋Š” ์ฝํžˆ๊ฒŒ ํ•˜๋Š” ์ž‘์—… */
.ir {
    display: block;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    text-indent: -9999px;
}

/* imageType */
/* Flex ๋Œ€์‹  Grid๋ฅผ ์‚ฌ์šฉํ•˜์˜€๋‹ค. */
.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 {}
.image__inner .image:nth-child(1) {
    grid-area: box1;
    background: url(img/imageType03_bg01.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__box {}
.image__desc {
    position: absolute;
    left: 0;
    bottom: -100%;
    width: 100%;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
    box-sizing: border-box;
    color: #fff;
    transition: all 0.4s ease;
}
.image:hover .image__desc {
    bottom: 0;
}
.image__desc h3 {
    font-size: 20px;
}
.image__desc p {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 300;
}
.image__sns {
    position: absolute;
    right: -100px;
    top: 10px;
    transition: all 0.4s 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);
}
/* ์ด๋ฏธ์ง€ ์Šคํ”„๋ผ์ดํŠธ */
/* ์•„์ด์ฝ˜ 5๊ฐœ๋ฅผ ์ด์–ด ๋งŒ๋“  ํ”„๋ ˆ์ž„์„ SVG๋กœ ์ถ”์ถœํ•˜์—ฌ ๊ทธ ์ขŒํ‘œ๊ฐ’์„ ์•„๋ž˜์™€ ๊ฐ™์ด
    ์˜ฎ๊ฒจ๊ฐ€๋ฉฐ ์•„์ด์ฝ˜ ํ•˜๋‚˜์”ฉ ๋ณด์ด๋„๋ก ํ•˜๋Š” ๊ธฐ๋ฒ• */
.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;
}

์ตœ์ข… ๊ฒฐ๊ณผ

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€


Reference Book

JavaScript
HTML
CSS
๊ด‘๊ณ  ์ค€๋น„์ค‘์ž…๋‹ˆ๋‹ค.