본문 바로가기
SITE/Image Type

웹사이트 만들기/ImageType 02

by 코린이 박원장👶 2022. 8. 17.

사이트 만들기 _ 이미지 유형02

기존 이미지유형에서 한단계 더 발전한 이미지 유형02에 대해 공부해보겠습니다. 레이아웃이 3개로 늘었고 마우스 오버했을때 효과를 부여해보겠습니다.



이미지 유형01번처럼 카드타입유형02번의 코드를 활용해서 만들어 봅시다.

transform: scale(1.05);

위치를 이동시키거나 크기 조절 및 회전시킬 수 있는 속성입니다.
* scale() : x축 or y축으로 확대/축소
* rotate() : 지정 요소 회전
* translate() : 요소 x축 or y축으로 이동
* skew() : x축 or y축 기울이기

transition: all 0.6s ease-in;

속성을 서서히 변화시키는 속성입니다.

transition: property timing-function duration delay | initial | inherit

property : 적용시킬 속성을 정합니다.
*timing-function : 진행 속도를 정합니다.
*duration : 총 시간을 정합니다.
*delay : 지연시간을 정합니다.
*initial : 기본값으로 설정합니다.
*inherit : 부모 요소의 속성값을 상속받습니다.
여기서 적용된 문법만 해석해볼게요. all은 모든속성에 적용하고, ease-in은 전환효과가 천천히 시작되게합니다. 0.6초동안 전환효과를 진행시킨다는 뜻이 되겠네요

backdrop-filter: blur(10px);

이 속성은 요소 뒤 영역에 흐림효과 등의 그래픽 효과를 적용할 수 있는 속성입니다. 요소의 뒤에 적용하기 때문에 효과를 확인하기 위해서는 요소의 배경을 적어도 반투명하게 설정을 해줘야 겠죠?

CSS 속성

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

.gmark {
    font-family: 'GmarketSans';
    font-weight: 500;
}
/* 리셋 */
*{
    margin: 0;
    padding: 0;
}
a{
    text-decoration: none;
    color: #000;
}
img {
    width: 100%;
}
h1, h2, h3, h4, h5, h6 {
    font-weight: normal;
}

/* common */
.container {
    width: 1160px;
    padding: 0 20px;
    margin: 0 auto;
    min-width: 1160px;

}
.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;
}

/* imageType02 */
.image__inner{
    display: flex;
    justify-content: space-between;
}
.image {
    width: 31%;
    position: relative;
    overflow: hidden;
}
.image__box{}
.image__box img{
    object-fit: cover;
    transition: all 0.6s ease-in;
}
.image__desc{
    position: absolute;
    left: 0;
    bottom: -100px;
    width: 100%;
    height: 100px;
    text-align: center;
    backdrop-filter: blur(10px);
    padding: 23px 20px;
    box-sizing: border-box;
    transition: all 0.3s ease-in;
}
.image:hover .image__desc{
    bottom: 0;
}
.image:hover .image__box img {
    transform: scale(1.05);
}

.img1 .image__desc{
    background-color: rgba(30,19,15,0.1);
}
.img2 .image__desc{
    background-color: rgba(75,57,55,0.1);
}
.img3 .image__desc{
    background-color: rgba(44,54,60,0.1);
}
.image__desc h3{
    color: #fff;
    font-size: 24px;
    margin-bottom: 5px;
}
.image__desc .more{
    color: #fff;
    font-size: 16px;
}
.image__desc .more:hover{
    text-decoration: underline;
}

HTML 속성

<section id="imageType02" class="image__wrap gmark section gray">
    <h2>드라이브 여행 🚗</h2>
    <p>
        날씨도  좋은데 근교라도 좋으니깐 드라이브를 가보는게 어떨까요...(☞゚ヮ゚)☞
    </p>
    <div class="image__inner container">
        <article class="image img1">
            <figure class="image__box">
                <img src="img/image_type02_01.jpg" alt="dd">
            </figure>
            <div class="image__desc">
                <h3>떠나요</h3>
                <a href="#" class="more" title="자세히 보기">자세히 보기</a>
            </div>
        </article>
        <article class="image img2">
            <figure class="image__box">
                <img src="img/image_type02_02.jpg" alt="dd">
            </figure>
            <div class="image__desc">
                <h3>떠나요</h3>
                <a href="#" class="more" title="자세히 보기">자세히 보기</a>
            </div>
        </article>
        <article class="image img3">
            <figure class="image__box">
                <img src="img/image_type02_03.jpg" alt="dd">
            </figure>
            <div class="image__desc">
                <h3>떠나요</h3>
                <a href="#" class="more" title="자세히 보기">자세히 보기</a>
            </div>
        </article>
    </div>
</section>

결과보기

728x90

'SITE > Image Type' 카테고리의 다른 글

웹사이트 만들기/ImageType 03  (7) 2022.08.21
웹사이트 만들기/ImageType 01  (3) 2022.08.17

댓글


HTML이미지
HTML이미지

JAVASCRIPT

자세히 보기
HTML이미지