250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- react
- IOS
- button
- iOS 개발자
- javascript
- 비전공 개발자
- iPhone
- 풀스택
- jQuery
- 자바스크립트
- 개발자
- html5
- MAC
- hover
- effect
- CSS
- front-end
- php
- 프론트엔드
- 비전공자
- SWIFT
- HTML
- xcode
- 백엔드
- ipad
- Animation
- image
- keyframes
- css3
- 애니메이션
Archives
- Today
- Total
비전공자 개발일기
Sprite Animation 본문
728x90
SMALL
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SPRITE ANIMATION</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="scene">
<input type="checkbox" checked>
<div class="mario"></div>
</div>
</body>
</html>
.scene {
width: 230px;
height: 200px;
background:url('./background.jpg') 0 90% no-repeat;
background-size: cover;
background-size: 500% 400%;
border-radius: 20%;
position: relative;
overflow: hidden;
transition: background-position 15s linear;
}
.scene:hover {
background-position: 150% 90%;
}
.mario {
width: 65px;
height: 100px;
background: url("./mario_sprite.png") no-repeat;
transform: translate(10px, 85px);
animation: run .5s infinite;
}
input[type='checkbox'] {
display: none;
}
input:checked + .mario {
animation-timing-function: step-end;
}
@keyframes run {
25% {
background-position: -85px 0;
}
50% {
width: 45px;
background-position: -150px 0;
}
75% {
width: 55px;
background-position: -197px 0;
}
}
728x90
LIST
'HTML _CSS' 카테고리의 다른 글
FILP CARD (0) | 2022.05.20 |
---|---|
Isometric Menu Hover Effects (0) | 2022.05.19 |
Image Animation Sequence (0) | 2022.05.13 |
Nine Dots Menu (0) | 2022.05.11 |
3D BUTTON (0) | 2022.05.09 |