Skip to content

Instantly share code, notes, and snippets.

@celeroncoder
Created January 16, 2024 14:15
Show Gist options
  • Save celeroncoder/3b50022f96fc85c4dfb10a4a5ac5336a to your computer and use it in GitHub Desktop.
Save celeroncoder/3b50022f96fc85c4dfb10a4a5ac5336a to your computer and use it in GitHub Desktop.
GDSC VIT Bhopal WinterFest Gamification of Web - CSS Code for Flappy Bird
@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');
.gamestartbg {
--frame1: url("/images/fly-frame-1.png");
--frame2: url("/images/fly-frame-2.png");
}
body{
width: 100vw;
height: 100vh;
padding: 0px;
margin: 0;
font-family: "Poppins", sans-serif;
}
#holder{
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
#modal{
position: absolute;
padding: 20px;
z-index: 1;
background-color: wheat;
border-radius: 32px;
text-align: center;
display: grid;
gap: 20px;
justify-content: center;
align-items: center;
}
#modal span{
font-size: larger;
}
#game-title{
font-size: xx-large;
font-weight: bold;
line-height: 0%;
}
button{
width: fit-content;
margin: auto;
padding: 8px 35px;
background-color: peru;
font-size: x-large;
font-weight: 600;
border-radius: 16px;
border: none;
font-family: "Poppins", sans-serif;
}
button:hover{
background-color: brown;
transition-duration: 0.2ms;
color: white;
}
#restart{
display: none;
margin-top: 20px;
}
#scoreholder{
position: absolute;
top: 10px;
left: 10px;
font-weight: 600;
font-size: larger;
z-index: 2;
}
#game{
width: 100%;
background-color: skyblue;
position: relative;
overflow: hidden;
}
#block{
width: 50px;
height: 600px;
background-image: url("/images/wood.jpg");
background-size: cover;
position: relative;
left: 100%;
}
@keyframes block {
0%{
left: 100%;
}
100%{
left: -50px;
}
}
#hole{
width: 50px;
height: 150px;
background-color: skyblue;
overflow: visible;
position: absolute;
left: 100%;
top: 0px;
}
#character{
width: 65px;
height: 65px;
position: absolute;
top: 25px;
left: -100px;
border-radius: 50%;
}
@keyframes showchr{
0%{
left: -100px;
}
100%{
left: 50px;
}
}
@keyframes chrdied{
100%{
top: 535px;
}
}
#character-image{
width: 100%;
height: 100%;
animation: chranimate 0.7s infinite ease-in-out;
}
@keyframes chranimate{
0%{
content: var(--frame1);
}
100%{
content: var(--frame2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment