๐Ÿ’œ HTML,CSS

HTML&CSS 21์ผ์ฐจ (์ •๋ฆฌx)

Genie_. 2024. 3. 23. 22:15
728x90
๋ฐ˜์‘ํ˜•
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>์• ๋‹ˆ๋ฉ”์ด์…˜</title>
</head>
<style>
    div {
        width: 200px;
        height: 200px;
        background-color: #d4ffca;
        border-radius: 50%;
        border-width: 10px;
        border-style: solid;
        border-top-color: red;
        border-right-color: purple;
        border-bottom-color: blue;
        border-left-color: orange;
        animation-name: ball;
        animation-duration: 1s;
        /*animation-fill-mode: ;*/
        /*animation-direction: in;*/
        animation-iteration-count: infinite;
        animation-timing-function: linear;
        /* alternate: ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ๋Š๊น€์—†์ด ์ด์–ด์ง
            reverse: ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ์—ญ์œผ๋กœ ๋™์ž‘ํ•จ */
        animation-direction: alternate;

    }

    @keyframes ball { /* ball์ž๋ฆฌ ์ด๋ฆ„์€ ํ•˜๊ณ ์‹ถ์€๊ฑฐ ํ•ด๋„๋จ */
        from{ /* ๋‚ด๊ฐ€ ์ •์˜ํ•˜๊ณ  ์‹ถ์€ ์ฒ˜์Œ ๋ชจ์Šต */
            background-color: #e3c8ff;
        }
        30%{
            background-color: #ffd6de
        }
        50%{
            transform: translateX(500px) rotate(180deg) scale(-200%);
        }
        60%{
            background-color: orange;
        }
        to{ /* ๋‚ด๊ฐ€ ์ •์˜ํ•˜๊ณ  ์‹ถ์€ ๋งˆ์ง€๋ง‰ ๋ชจ์Šต */
            transform: translateX(1000px) rotate(360deg) scale(200%);
        }
    }
</style>
<body>
    <div></div>
</body>
</html>

 

728x90
๋ฐ˜์‘ํ˜•