msp-flappy-bird/index.html
2021-10-13 10:47:24 +02:00

142 lines
3.1 KiB
HTML

<html>
<head>
<style type="text/css">
body {
margin: 0;
padding: 0;
border: 0;
background: black;
overflow: hidden;
}
div {
position: absolute;
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-family: arial;
font-size: 12px;
color: white;
text-align: center;
}
#viewport {
width: 100%;
height: 100%;
overflow: hidden;
top: 0px;
left: 0px;
margin-left: 0px;
margin-top: 0px;
}
#test {
width: 88px;
height: 73px;
background-image: url(sheet.png);
-webkit-animation: cycle_sprites 300ms steps(1) infinite,
move_bird 5s linear infinite;
animation: cycle_sprites 300ms steps(1) infinite,
move_bird 5s linear infinite;
}
@-webkit-keyframes cycle_sprites {
0% {
background-position: -330px -1371px;
}
33.33% {
background-position: -372px -1132px;
}
66.66% {
background-position: -222px -1562px;
}
}
@keyframes cycle_sprites {
0% {
background-position: -330px -1371px;
}
33.33% {
background-position: -372px -1132px;
}
66.66% {
background-position: -222px -1562px;
}
}
@-webkit-keyframes move_bird {
from {
left: 0px;
top: 100px
}
to {
left: 600px;
top: 100px
}
}
@keyframes move_bird {
from {
left: 0px;
top: 100px
}
to {
left: 600px;
top: 100px
}
}
</style>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1">
</head>
<body>
<div id="viewport">
<div style="
left:0px;
top:300px;
background-image:url(sheet.png);
background-position: -0px -410px;
width: 276px;
height: 200px;
z-index: -2;
">
</div>
<div style="
left:0px;
top:380px;
background-image:url(sheet.png);
background-position: -276px -410px;
width: 224px;
height: 110px;
z-index: -1;
">
</div>
<div style="
left:224px;
top:380px;
background-image:url(sheet.png);
background-position: -276px -410px;
width: 224px;
height: 110px;
z-index: -1;
">
</div>
<div id="test" style="
left: 100px;
top: 100px;
z-index: 0;
">
</div>
</div>
</body>
</html>