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

[SITE] ์›น์‚ฌ์ดํŠธ - ์ด๋ฏธ์ง€ ์œ ํ˜•03

by _ํ† ๋งคํ†  2022. 8. 22.
728x90

Image Type03

์ด๋ฒˆ ์ด๋ฏธ์ง€ ์œ ํ˜•์—์„œ๋Š” ์ง€๋‚œ ์‹œ๊ฐ„ ๋ฐฐ์› ๋˜ ์œ ํ˜•๋“ค์˜ ์‹ฌํ™” ๋ฒ„์ „ ์ž…๋‹ˆ๋‹ค. ์• ๋‹ˆ๋ฉ”์ด์…˜๊ณผ ๋ธ”๋Ÿฌ ํšจ๊ณผ, ๊ทธ๋ฆฌ๊ณ  ์ด๋ฏธ์ง€ ์ŠคํŠธ๋ผ์ดํŠธ ๊ธฐ๋ฒ•์„ ์‚ฌ์šฉํ•˜์—ฌ ์‹ค์Šตํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค!


< figma : ๋””์ž์ธ ํ•˜๊ธฐ >

์ด๋ฏธ์ง€ ์œ ํ˜•์˜ ๊ฐ€์žฅ ๊ธฐ์ดˆ์ ์ธ ๋ ˆ์ด์•„์›ƒ์œผ๋กœ ์ด๋ฏธ์ง€ ๋ฐ•์Šค ์•ˆ์— ํ…์ŠคํŠธ์™€ ๋งํฌ ๋ฐ•์Šค๊ฐ€ ๋“ค์–ด๊ฐ€ ์žˆ๋Š” ๊ตฌ์กฐ์ž…๋‹ˆ๋‹ค.

TIP ! ๊ธฐ๋ณธ ํ™”๋ฉด์€ 1200(1160)์ด๋ฏ€๋กœ ์ฝ”๋”ฉํ•  ๋• ์ฃผ์˜ํ•ฉ๋‹ˆ๋‹ค!

๐ŸŽจ ๊ทธ๋ฆฌ๋“œ์™€ ๋ ˆ์ด์•„์›ƒ

๐ŸŽจ ์™„์„ฑ๋ณธ


< HTML ์†Œ์Šค : ๋ ˆ์•„์•„์›ƒ ๊ตฌ์กฐ ํŒŒ์•…ํ•˜๊ธฐ >

๋””์ž์ธํ•œ ์›น ํŽ˜์ด์ง€ ์‹œ์•ˆ์„ ๋ณด๋ฉฐ ํŽ˜์ด์ง€ ๊ตฌ์กฐ๋ฅผ ํŒŒ์•…ํ•œ ํ›„ ์›น ํ‘œ์ค€์„ฑ๊ณผ ์ ‘๊ทผ์„ฑ์— ๋งž๋Š”์‹œ๋ฉ˜ํ‹ฑํ•œ ๋งˆํฌ์—…์„ ํ•ด์ค๋‹ˆ๋‹ค.

! TIP ! ์ด๋ฒˆ ์œ ํ˜•์€ ๋ฐฑ๊ทธ๋ผ์šด๋“œ์— ์ด๋ฏธ์ง€๋ฅผ ์‚ฝ์ž…ํ•˜๋ฉด ๋”ฐ๋กœ ์• ๋‹ˆ๋ฉ”์ด์…˜๊ณผ ๊ฐ™์€ ํšจ๊ณผ๋ฅผ ์ฃผ๊ธฐ ์–ด๋ ต๊ธฐ ๋•Œ๋ฌธ์— imgํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋ฏธ์ง€๋ฅผ ์‚ฝ์ž…ํ•˜์—ฌ ์ž‘์—…ํ•ฉ๋‹ˆ๋‹ค:)

<section id="imageType01" class="image__wrap gowun section">
    <h2>๋”ฉ๋™๋Œ• ์•ผ์˜น ์œ ์น˜์›</h2>
    <p>๐Ÿพ๐Ÿฑ ๊ณ ์–‘์ด๋ฅผ ์ข‹์•„ํ•˜๋Š” ์‚ฌ๋žŒ๋“ค์„ ์œ„ํ•œ ๋ƒฅ๋ƒฅ ๋ฆฌ์ŠคํŠธ ์ž…๋‹ˆ๋‹ค. ๐Ÿฑ๐Ÿพ</p>
    <div class="image__inner container-fluid">
        <article class="image">
            <!-- <figure class="image__box">
                <img src="img/img_bg03_06.jpg" alt="cat">
            </figure> : ๋ฐฑ๊ทธ๋ผ์šด๋“œ ๊ธฐ๋ฒ•์œผ๋กœ ์‚ฝ์ž…ํ•  ๊ฑฐ๋ผ์„œ ์ž„์‹œ๋กœ ์ฃผ์„์ฒ˜๋ฆฌ๋ฅผ ํ•ด์ค๋‹ˆ๋‹ค!-->
            <div class="image__desc">
                <h3 class="image__title">๋”ฉ๋™๋Œ• ์•ผ์˜น ์œ ์น˜์›</h3>
                <p class="image__txt">์• ๋‹ˆ๋ฉ€ 2๊ธฐ ๊น€๋ƒฅ๋ƒฅ</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/img_bg03_07.jpg" alt="cat">
            </figure>
            <div class="image__desc">
                <h3 class="image__title">๋”ฉ๋™๋Œ• ์•ผ์˜น ์œ ์น˜์›</h3>
                <p class="image__txt">์• ๋‹ˆ๋ฉ€ 2๊ธฐ ๊น€๋ƒฅ๋ƒฅ</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/img_bg03_08.jpg" alt="cat">
            </figure>
            <div class="image__desc">
                <h3 class="image__title">๋”ฉ๋™๋Œ• ์•ผ์˜น ์œ ์น˜์›</h3>
                <p class="image__txt">์• ๋‹ˆ๋ฉ€ 2๊ธฐ ๊น€๋ƒฅ๋ƒฅ</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/img_bg03_09.jpg" alt="cat">
            </figure>
            <div class="image__desc">
                <h3 class="image__title">๋”ฉ๋™๋Œ• ์•ผ์˜น ์œ ์น˜์›</h3>
                <p class="image__txt">์• ๋‹ˆ๋ฉ€ 2๊ธฐ ๊น€๋ƒฅ๋ƒฅ</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/img_bg03_10.jpg" alt="cat">
            </figure>
            <div class="image__desc">
                <h3 class="image__title">๋”ฉ๋™๋Œ• ์•ผ์˜น ์œ ์น˜์›</h3>
                <p class="image__txt">์• ๋‹ˆ๋ฉ€ 2๊ธฐ ๊น€๋ƒฅ๋ƒฅ</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>
! html ์ฃผ์˜์‚ฌํ•ญ !
โ€ข imgํƒœ๊ทธ์˜ ์†์„ฑ ์ค‘ alt์•ˆ์— ์ด๋ฏธ์ง€์— ๋Œ€ํ•œ ์„ค๋ช…์„ ๋„ฃ์–ด์ค˜์•ผ ์‹œ๊ฐ ๋ฐ ์ฒญ๊ฐ ์žฅ์• ์ธ๋“ค๋„ ์Šคํฌ๋ฆฐ๋ฆฌ๋”๊ธฐ๋ฅผ ํ†ตํ•ด ์ดํ•ด ๊ฐ€๋Šฅ
โ€ข ์„น์…˜๊ณผ ์•„ํ‹ฐํด ํƒœ๊ทธ์—๋Š” ๊ผญ ์ œ๋ชฉ ํƒœ๊ทธ๋ฅผ ์ž์‹ ์š”์†Œ๋กœ ๋„ฃ์–ด ์ฃผ์–ด์„œ ์›นํ‘œ์ค€๊ณผ ์›น ์ ‘๊ทผ์„ฑ, ํ˜ธํ™˜์„ฑ์„ ๋†“์น˜์ง€ ์•Š๋„๋ก ํ•˜์ž!
โ€ข imgํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ๋Š” ๊ผญ figure ํƒœ๊ทธ๋ฅผ ์„ ์–ธํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.

< CSS ์†Œ์Šค : ์Šคํƒ€์ผ ์ ์šฉํ•˜๊ธฐ >

์ด๋ฒˆ ๋ ˆ์ด์•„์›ƒ์€ flex๊ฐ€ ์•„๋‹Œ ๊ทธ๋ฆฌ๋“œ ๊ธฐ๋ฒ•์œผ๋กœ ์ž‘์—…ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.
transition, transform, backdrop-filter๋ฅผ ํ†ตํ•ด ๋™์ ์ธ ์Šคํƒ€์ผ ์†์„ฑ์„ ์ฃผ๋„๋ก ํ•˜๊ณ  ์ด๋ฏธ์ง€ ์Šคํ”„๋ผ์ดํŠธ ๊ธฐ๋ฒ•์„ ํ†ตํ•ด ์•„์ด์ฝ˜์„ ํšจ์œจ์ ์œผ๋กœ ์‚ฝ์ž…ํ•ด๋ณด๋„๋ก ํ•ฉ์‹œ๋‹ค!
์†์„ฑ์— ๋Œ€ํ•œ ๋‚ด์šฉ์€ ์ฝ”๋“œ์™€ ์ฃผ์„์„ ์ฐธ๊ณ ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค:)

TIP !
1. ๋จผ์ € ์ „์ฒด ์ดˆ๊ธฐํ™”(Reset)์™€ ํฐํŠธ ๊ธฐ๋ณธ ์„ค์ •์„ ํ•ด์ฃผ๋Š” ๊ฒƒ์ด ์ข‹๋‹ค.
2. ํฐ ์„น์…˜๋ถ€ํ„ฐ ์†์„ฑ์„ ์ ์šฉ์‹œํ‚จ๋‹ค. ์„ธ๋ถ€์ ์ธ ์š”์†Œ๋Š” ๋งˆ์ง€๋ง‰์— ์ ์šฉํ•œ๋‹ค.
3. :hover ์†์„ฑ์„ ํ†ตํ•ด ์ปค์„œ๊ฐ€ ํ•ด๋‹น ์š”์†Œ์— ๋‹ฟ์•˜์„ ๋•Œ์˜ ๋™์  ํšจ๊ณผ๋ฅผ ์ฃผ๋„๋ก ํ•œ๋‹ค.
4. :nth-child( ) ์†์„ฑ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋ฏธ์ง€ ์Šคํ”„๋ผ์ดํŠธ์™€ ๊ทธ๋ฆฌ๋“œ ๋ ˆ์ด์•„์›ƒ์„ ํšจ์œจ์ ์œผ๋กœ ์ž‘์—…ํ•  ์ˆ˜ ์žˆ๋‹ค.

@import url('https://webfontworld.github.io/yangheeryu/GowunBatang.css');

/* font */
.gowun {
    font-family: 'GowunBatang';
    font-weight: 400;
}

/* reset */
* {
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    color: #000;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: normal;
}
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 > h2 {
    font-size: 50px;
    margin-bottom: 20px;
    text-align: center;
}

.section > p {
    font-size: 22px;
    font-weight: 300;
    margin-bottom: 70px;
    text-align: center; 
    color: #666;
}
/* ์ด๋ฏธ์ง€๊ฐ€ ์žˆ์„ ๋•Œ ํ…์ŠคํŠธ ์ˆจ๊ธฐ๊ธฐ */
.ir {
    display: block;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    text-indent: -9999px;
}

/* 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/img_bg03_06.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:  rgda(255,255,255,0.3);
    backdrop-filter: blur(6px);
    padding: 16px;
    box-sizing: border-box;
    transition: all 0.4s ease;
}
.image:hover .image__desc {
    bottom: 0;
}
.image__desc h3 {
    font-size: 20px;
    color: #fff;
}
.image__desc p {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ebebeb;
}
.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/img_bg03_icons.svg);
}
.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;
}

! Css ์†์„ฑ ์•Œ์•„๊ฐ€๊ธฐ !
transition : ์›€์ง์ž„ ์†๋„ ์„ค์ •
transform : ์š”์†Œ์˜ ๋ชจ์–‘, ํฌ๊ธฐ, ์œ„์น˜ ๋“ฑ์„ ์ž์œ ๋กญ๊ฒŒ ๋ณ€๊ฒฝ
backdrop-filter : ๋ฐฐ๊ฒฝ์— ๊ทธ๋ž˜ํ”ฝ ํšจ๊ณผ๋ฅผ ์„ค์ • (๋ฐฐ๊ฒฝ์— ํˆฌ๋ช…๋„๊ฐ€ ์žˆ์–ด์•ผ ํšจ๊ณผ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.
:nth-child( ) : n๋ฒˆ์งธ ์ž์‹ ์š”์†Œ์—๊ฒŒ๋งŒ ์Šคํƒ€์ผ ์ ์šฉ
background: url( ) : ๋ฐฑ๊ทธ๋ผ์šด๋“œ์— ์ด๋ฏธ์ง€ ์‚ฝ์ž…


๊ฒฐ๊ณผ๋ณด๊ธฐ

728x90

๋Œ“๊ธ€


Lucky Charms Rainbow
js
html
css