๋ชฉ์ฐจ
728x90
์ฝ๋
<div class="container">
<div class="ground"></div>
<div class="wall"></div>
<div class="speaker1"></div>
<div class="speaker2"></div>
<div class="people"></div>
<div class="box"></div>
</div>
*,*::after,*::after{
box-sizing: border-box;
}
.container {
width: 200px;
height: 150px;
border: 2px solid #000;
animation: background 2s linear 0s infinite normal ;
position: relative;
}
.ground {
width: 196px;
height: 45px;
bottom: 0px;
position: absolute;
background: rgba(37, 37, 37, 0.884);
}
.wall {
width: 190px;
height: 130px;
left: 5px;
background-size: contain;
background-repeat: no-repeat;
position: absolute;
background-image: url(/images/wall3.png);
}
.box {
width: 50px;
height: 50px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
background-image: url(/images/danceCat2.gif);
}
.speaker1 {
width: 50px;
height: 50px;
position: absolute;
transform: translate(-50%,-50%);
top: 50%;
left: 18%;
background-image: url(/images/speaker.png);
animation: speaker 1s step-end 0s infinite normal ;
}
.speaker2 {
width: 50px;
height: 50px;
position: absolute;
transform: translate(50%,-50%);
top: 50%;
right: 18%;
background-image: url(/images/speaker.png);
animation: speaker 1s step-end 0.5s infinite normal;
}
.people {
width: 180px;
height: 90px;
background-size: cover;
position: absolute;
bottom: 0%;
left:10px;
background-image: url(/images/people.png);
}
@keyframes background {
0%{background-color:rgb(56, 56, 56);}
25%{background:rgb(0, 105, 65);}
50%{background-color:rgb(56, 56, 56);}
75%{background:rgb(43, 0, 92);}
100%{background-color:rgb(56, 56, 56);}
}
@keyframes speaker {
50%{
top: 49%;
height: 55px;
width: 55px;
background-size:cover;
}
}
๊ฒฐ๊ณผ
์ฝ๋ฉํธ
CSS์ animation์ ๋ํด์ ์กฐ๊ธ ๊ณต๋ถํด๋ณด๊ณ ์ฌ๋ฌ๊ฐ์ง ์๋๋ฅผ ํ๋ค๊ฐ
๊ณ ์์ด ๋์ค๋ฅผ ๋ง๋ค์ด๋ดค๋ค!
๋ชจ๋ ๊ฒ๋ค์ ์ง์ ๋ํธ๋ฅผ ํ ๋ ํ ๋ ์ฐ์ด์ ๋ง๋ค์๋๋ฐ
๋ณด๋๋ ์๊ณ ๊ฒฐ๊ณผ๊ฐ ๊ท์ฌ์์ ์ข๋ค!
'๐จโ๐ | OTHERS > ๊ฐ๋ฐ์ผ์ง' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๋์ ์ฒซ ์น์ฌ์ดํธ ๋ง๋ค๊ธฐ_(1) (0) | 2022.02.04 |
---|---|
ํฐ์คํ ๋ฆฌ ์คํจ ์ปค์คํ ! (w. HTML & CSS) (0) | 2022.01.31 |
HTML & CSS ํ์ฉ ํ๋ก์ ํธ_ ๋ฒํผ ์กฐ์ ๊ฒ์ ๋ง๋ค๊ธฐ (0) | 2022.01.14 |
์น ๊ฐ๋ฐ ๊ณต๋ถ devlog (0) | 2021.12.27 |
๊ฐ์ํ๊ฒฝ ์ค์ (venv) (w.VSCODE & bash) (0) | 2021.12.03 |
๋๊ธ