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

์• ๋‹ˆ๋ฉ”์ด์…˜1

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

์• ๋‹ˆ๋ฉ”์ด์…˜ ๋งŒ๋“ค๊ธฐ

HTML๊ณผ CSS๋ฅผ ์ด์šฉํ•˜์—ฌ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๋งŒ๋“ค์–ด๋ด…์‹œ๋‹ค.

์˜ˆ์‹œ

์˜ˆ์‹œ์ž…๋‹ˆ๋‹ค

HTML ์†Œ์Šค

<div class="box"></div>

CSS ์†Œ์Šค

body {
    height: 100vh;
    background-image: linear-gradient(to top, skyblue, pink)
}
    
.box {
    width: 50px;
    height: 50px;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}
    
.box::before {
    content: '';
    width: 50px;
    height: 5px;
    background: #000;
    position: absolute;
    top: 58px;
    left: 0;
    border-radius: 50%;
    opacity: 0.2;
    animation: shadow 0.6s linear infinite;
}

@keyframes shadow {

    0% {
        transform: scale(1, 1)
    }
    50% {
        transform: scale(1.2, 1)
    }
    100% {
        transform: scale(1, 1)
    }
}

.box::after {
    content: '';
    background: yellow;
    width: 50px;
    height: 50px;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 3px;
    animation: load 0.6s linear infinite;
}

@keyframes load {
    17% {
        border-bottom-right-radius: 3px;
    }
    25% {
        transform: translatey(9px) rotate(22.5deg)
    }
    50% {
        transform: translatey(18px) scale(1, 0.9) rotate(45deg);
        border-bottom-right-radius: 40px;
    }
    75% {
        transform: translatey(9px) rotate(67.5deg);
    }
    100%{
        transform: translatey(0px) rotate(90deg);
    }
}

์™„์„ฑ

728x90
๋ฐ˜์‘ํ˜•

'CSS' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

์• ๋‹ˆ๋ฉ”์ด์…˜ 3  (1) 2022.09.02
์• ๋‹ˆ๋ฉ”์ด์…˜2  (2) 2022.08.30
์š”์†Œ ์ˆจ๊ธฐ๊ธฐ  (6) 2022.08.26
์ƒ‰ ํ‘œํ˜„  (8) 2022.08.24
CSS ๋‹จ์œ„ ํ‘œํ˜„  (4) 2022.08.23

๋Œ“๊ธ€