๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Site ์ œ์ž‘

02. ์ด๋ฏธ์ง€ ์œ ํ˜• - 3

by Youcodein 2022. 8. 21.
728x90
๋ฐ˜์‘ํ˜•

์ด๋ฏธ์ง€ ์œ ํ˜• 03

์ด๋ฏธ์ง€ ์œ ํ˜• ๋ ˆ์ด์•„์›ƒ ์‚ฌ์ดํŠธ์ž…๋‹ˆ๋‹ค. ์ด๋ฒˆ ์‚ฌ์ดํŠธ๋Š” flex๋กœ ์ž‘์—…ํ–ˆ๋˜ ์‚ฌ์ดํŠธ์™€๋Š” ๋‹ค๋ฅด๊ฒŒ grid๋ฅผ ์‚ฌ์šฉํ•˜์˜€์Šต๋‹ˆ๋‹ค.

๋ ˆ์ด์•„์›ƒ ์„ค์ •

figma๋กœ ๊ทธ๋ฆฌ๋“œ์™€ ์‚ฌ์ดํŠธ์˜ ๋ ˆ์ด์•„์›ƒ์„ ์žก์Šต๋‹ˆ๋‹ค.

HTML

html ์†Œ์Šค์ž…๋‹ˆ๋‹ค.

<body>
<section id="imageType03" class="image__wrap gowun section">
    <h2>๊ท€์—ฝ๊ณ  ๋ฉ‹์ง„ ๋™๋ฌผ๋“ค</h2>
    <p>
        ๋™๋ฌผ์„ ์‚ฌ๋ž‘ํ•ฉ์‹œ๋‹ค. ์ €๋Š” ๋™๋ฌผ์„ ์ •๋ง ์‚ฌ๋ž‘ํ•ฉ๋‹ˆ๋‹ค.<br>
        ๊ท€์—ฝ๊ณ  ๋ฉ‹์ง„ ๋™๋ฌผ๋“ค์„ ๋งŒ๋‚˜๋ณด์„ธ์š”. ์ž์—ฐ์˜ ๊ฒฝ์ด๋กœ์›€์— ๊ฐํƒ„ํ•˜๊ฒŒ ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค.
    </p>
    <div class="image__inner container-fluid">
        <article class="image">
            <!-- <figure class="image__box">
                <img src="img/image_bg03_01.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">ํŽ˜์ด์ง€์ด๋™</span></a>
                <a href="#" class="link"><span class="ir">ํŽ˜์ด์ง€์ด๋™</span></a>
                <a href="#" class="link"><span class="ir">ํŽ˜์ด์ง€์ด๋™</span></a>
                <a href="#" class="link"><span class="ir">ํŽ˜์ด์ง€์ด๋™</span></a>
            </div>
        </article>
        <article class="image">
            <figure class="image__box">
                <img src="img/image_bg03_02.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">ํŽ˜์ด์ง€์ด๋™</span></a>
            </div>
        </article>
        <article class="image">
            <figure class="image__box">
                <img src="img/image_bg03_03.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">ํŽ˜์ด์ง€์ด๋™</span></a>
            </div>
        </article>
        <article class="image">
            <figure class="image__box">
                <img src="img/image_bg03_04.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">ํŽ˜์ด์ง€์ด๋™</span></a>
            </div>
        </article>
        <article class="image">
            <figure class="image__box">
                <img src="img/image_bg03_05.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">ํŽ˜์ด์ง€์ด๋™</span></a>
            </div>
        </article>
    </div>
</section>
</body>

CSS

css ์†Œ์Šค์ž…๋‹ˆ๋‹ค. figma๋กœ ์„ค์ •ํ•ด๋†“์€ ๋ ˆ์ด์•„์›ƒ์ด๋‚˜ zaplin์„ ๋ณด๋ฉฐ ์ ์ ˆํ•˜๊ฒŒ css๋ฅผ ์„ค์ •ํ•ด์ค๋‹ˆ๋‹ค.


/* fonts */
@import url('https://webfontworld.github.io/gmarket/GmarketSans.css');
.gowun {
    font-family: GowunBatang;
    font-weight: 400;
}
/* reset */
* {
    margin: 0;
    padding: 0;
}
a {
    text-decoration: none;
    color: #000;
}
img {
    width: 100%;
    vertical-align: top;
    border-radius: 10px;
}
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/image_bg03_01.jpg);
    background-size: cover;
    border-radius: 10px;
}
.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-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    padding: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    border-radius: 0 0 10px 10px ;
}

.image:hover .image__desc{
    bottom: 0;
}
.image__desc h3 {
    font-size: 20px;
}
.image__desc p {
    font-size: 16px;
    color: 666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.image__sns {
    position: absolute;
    right: 10px;
    opacity: 0;
    top: 10px;
    transition: all 0.5s ease;
}

.image__sns a {
    width: 36px;
    height: 36px;
    background-color: #fff;
    border-radius: 50%;
    display: block;
    margin-bottom: 5px;
    background: url(img/image_bg_03_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; */
    opacity: 1;
}
728x90
๋ฐ˜์‘ํ˜•

'Site ์ œ์ž‘' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

03. ํ…์ŠคํŠธ ์œ ํ˜• - 2  (2) 2022.08.31
03. ํ…์ŠคํŠธ ์œ ํ˜• 01  (4) 2022.08.30
02. ์ด๋ฏธ์ง€ ์œ ํ˜• - 2  (3) 2022.08.18
02. ์ด๋ฏธ์ง€ ์œ ํ˜• - 1  (3) 2022.08.18
03. ์นด๋“œ ์œ ํ˜• - 3  (11) 2022.08.11

๋Œ“๊ธ€