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 | 31 |
Tags
- 백엔드
- CSS
- 풀스택
- 개발자
- 자바스크립트
- SWIFT
- front-end
- HTML
- iPhone
- php
- css3
- image
- xcode
- ipad
- 애니메이션
- iOS 개발자
- react
- hover
- 비전공 개발자
- IOS
- html5
- 프론트엔드
- jQuery
- javascript
- button
- 비전공자
- effect
- Animation
- MAC
- keyframes
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 |