-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #336 from ratnojitsaha/new_stickman
stick hero game
- Loading branch information
Showing
5 changed files
with
669 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
html, | ||
body { | ||
height: 100%; | ||
margin: 0; | ||
} | ||
|
||
body { | ||
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; | ||
cursor: pointer; | ||
} | ||
|
||
.container { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100%; | ||
} | ||
|
||
#score { | ||
position: absolute; | ||
top: 30px; | ||
right: 30px; | ||
font-size: 2em; | ||
font-weight: 900; | ||
} | ||
|
||
#introduction { | ||
width: 200px; | ||
height: 150px; | ||
position: absolute; | ||
font-weight: 600; | ||
font-size: 0.8em; | ||
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; | ||
text-align: center; | ||
transition: opacity 2s; | ||
} | ||
|
||
#restart { | ||
width: 120px; | ||
height: 120px; | ||
position: absolute; | ||
border-radius: 50%; | ||
color: white; | ||
background-color: red; | ||
border: none; | ||
font-weight: 700; | ||
font-size: 1.2em; | ||
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; | ||
display: none; | ||
cursor: pointer; | ||
} | ||
|
||
#perfect { | ||
position: absolute; | ||
opacity: 0; | ||
transition: opacity 2s; | ||
} | ||
|
||
#youtube, | ||
#youtube-card { | ||
display: none; | ||
} | ||
|
||
@media (min-height: 425px) { | ||
|
||
#youtube { | ||
z-index: 2; | ||
display: block; | ||
width: 100px; | ||
height: 70px; | ||
position: absolute; | ||
bottom: 20px; | ||
left: 20px; | ||
background: red; | ||
border-radius: 50% / 11%; | ||
transform: scale(0.8); | ||
transition: transform 0.5s; | ||
} | ||
|
||
#youtube:hover, | ||
#youtube:focus { | ||
transform: scale(0.9); | ||
} | ||
|
||
#youtube::before { | ||
content: ""; | ||
display: block; | ||
position: absolute; | ||
top: 7.5%; | ||
left: -6%; | ||
width: 112%; | ||
height: 85%; | ||
background: red; | ||
border-radius: 9% / 50%; | ||
} | ||
|
||
#youtube::after { | ||
content: ""; | ||
display: block; | ||
position: absolute; | ||
top: 20px; | ||
left: 40px; | ||
width: 45px; | ||
height: 30px; | ||
border: 15px solid transparent; | ||
box-sizing: border-box; | ||
border-left: 30px solid white; | ||
} | ||
|
||
#youtube span { | ||
font-size: 0; | ||
position: absolute; | ||
width: 0; | ||
height: 0; | ||
overflow: hidden; | ||
} | ||
|
||
#youtube:hover + #youtube-card { | ||
display: block; | ||
position: absolute; | ||
bottom: 12px; | ||
left: 10px; | ||
padding: 25px 25px 25px 130px; | ||
width: 300px; | ||
background-color: white; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>STICK HERO</title> | ||
<link rel="stylesheet" href="./hero.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div id="score"></div> | ||
<canvas id="game" width="375" height="375"></canvas> | ||
<div id="introduction">Hold down the mouse to stretch out a stick</div> | ||
<div id="perfect">DOUBLE SCORE</div> | ||
<button id="restart">RESTART</button> | ||
</div> | ||
|
||
</body> | ||
<script src="logic.js"></script> | ||
</html> |
Oops, something went wrong.