Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jogo do Sonic do Victório da StartSe #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Images/coins.webp
Binary file not shown.
Binary file added Images/gameOverSonic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/sonic.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
218 changes: 210 additions & 8 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,150 @@
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
*{
margin:0;
padding: 0;
box-sizing: border-box;
box-sizing: border-box;
font-family: 'Press Start 2P', cursive;
}

div#initialMessage{
position: relative;
left: 35%;
top: 30%;
height: 40%;
width: 30%;
background-color: #D94D1A;
z-index: 50;
border-radius: 0 5px 5px 0;
border-right: solid black 2.5px;
border-bottom: solid black 2.5px;
box-shadow: -2px -3px #F29877;
}

div.bolt{
width: 5px;
height: 5px;
border-radius: 5px;
background-color: #F2CFC2;
}

#left-top{
position: absolute;
top: 5px;
left: 5px;
}

#right-top{
position: absolute;
top: 5px;
right: 5px;
}

#right-bottom{
position: absolute;
bottom: 5px;
right: 5px;
}

#left-bottom{
position: absolute;
bottom: 5px;
left: 5px;
}

div#messageTo{
position: absolute;
top: 30px;
left: 18%;
}


div#messageTo h1{
font-size: 20px;
line-height: 40px;
position: relative;
animation: text_reveal .5s ease forwards;
animation-delay: 1.5s;
}

div#messageTo h1:nth-child(1){
animation-delay: .8s;
}

div#messageTo h1:nth-child(2){
animation-delay: 1.8s;
}

div#messageTo h1:nth-child(3){
animation-delay: 2.8s;
}

div#messageTo h1 span{
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
animation: text_reveal_box 1s forwards;
animation-delay: .5s;
background-color: #D94D1A;
}

div#messageTo h1:nth-child(1) span{
animation-delay: .5s;
}

div#messageTo h1:nth-child(2) span{
animation-delay: 1.5s;
}

div#messageTo h1:nth-child(3) span{
animation-delay: 2.5s;
}

button#startButton{
cursor: pointer;
width: 200px;
height: 50px;
position: absolute;
left: 27%;
bottom: 10px;
background-color: #732509;
font-size: 30px;
border-radius: 100px;
}

#finalScore{
font-size: 30px;
}

#wrapper{
position: absolute;
height: 200px;
top: 40%;
left: 35%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
}

button#restartButton{
cursor: pointer;
width: 400px;
height: 100px;
background-color: #732509;
border-radius: 100px;
font-size: 30px;
}

button#startButton:hover, button#restartButton:hover{
background-color: #F28F38;
}

.game {
width: 100%;
height: 100vh;
border-bottom: 100px solid rgb(24,174,24);
border-bottom: 50px solid rgb(24,174,24);
margin: 0 auto;
position: relative;
overflow: hidden;
Expand All @@ -18,17 +155,39 @@
position: absolute;
bottom: 0;
width: 80px;
animation: pipe-animation 1.5s infinite linear;
animation: pipe-animation 2s infinite linear;
}

img:nth-child(5), img:nth-child(6), img:nth-child(7){
position: absolute;
bottom: 0;
width: 80px;
}

.coin-game{
animation: coin-animation 2s infinite linear;
}

.super-mario{
width:150px;
.coin-game:nth-child(6){
animation-delay: .1s;
}

.coin-game:nth-child(7){
animation-delay: .2s;
}

.pipe-game{
animation-delay: .4s;
}

.super-sonic{
width:110px;
position: absolute;
bottom: 0;
}

.jump-mario {
animation: mario-animation 500ms ease-out;
.jump-sonic {
animation: sonic-animation 500ms ease-out;
}

.cloud-game{
Expand All @@ -37,6 +196,40 @@
animation: clouds-animation 20s infinite linear;
}

aside{
position: absolute;
top: 20px;
right: 20px;
text-align: center;
line-height: 30px;
}


@keyframes text_reveal{
100%{
color: black;
}
}

@keyframes text_reveal_box{
0%{
border-left: solid black 3px;
}
25%{
border-left: none;
}
50%{
border-left: solid black 3px;
width: 100%;
left: 0;
}
100%{
border-left: none;
width: 0;
left: 100%;
}
}

@keyframes pipe-animation {
from {
right: -80px;
Expand All @@ -46,6 +239,15 @@
}
}

@keyframes coin-animation {
from {
right: -80px;
}
to{
right: 100%;
}
}

@keyframes clouds-animation {
from{
right: -550px;
Expand All @@ -55,7 +257,7 @@
}
}

@keyframes mario-animation{
@keyframes sonic-animation{
0% {
bottom:0;
}
Expand Down
21 changes: 20 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,28 @@
</head>
<body>
<div class="game">
<div id="initialMessage">
<div class="bolt" id="left-top"></div>
<div class="bolt" id="right-top"></div>
<div class="bolt" id="right-bottom"></div>
<div class="bolt" id="left-bottom"></div>
<div id="messageTo">
<h1>Para Cecília,<span></span></h1>
<h1>a maior fã de<span></span></h1>
<h1>Sonic<span></span></h1>
</div>
<button id="startButton">Start</button>
</div>
<img src="./Images/clouds-gamer.png" class="cloud-game" />
<img src="./Images/super-mario.gif" class="super-mario" />
<img src="./Images/sonic.gif" class="super-sonic" />
<img src="./Images/pipe-game.png" class="pipe-game" />
<img src="./Images/coins.webp" class="coin-game" />
<img src="./Images/coins.webp" class="coin-game" />
<img src="./Images/coins.webp" class="coin-game" />
<aside>
<h1>Score</h1>
<div id="score">0</div>
</aside>
</div>
<script src="./js/script.js"></script>
</body>
Expand Down
Loading