Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# jquery-streetfighter
Starter Files for Thinkful Front End Web Development jQuery Streetfighter Project — Edit
link: http://kissa1001.github.io/jquery-streetfighter/
75 changes: 75 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
body {
background-color: black;
overflow:hidden;

}

.main {
background-image: url('../images/background.jpg');
background-size:cover;
margin-top: 110px;
padding-left: 100px;
min-width: 1200px;
height: 500px;
position: relative;
z-index: 1;
}

.ryu {
width: 659px;
height: 494px;
}

.ryu-still, .ryu-ready, .ryu-throwing, .ryu-cool {
width: 659px;
height: 494px;
}

.ryu-ready, .ryu-throwing, .ryu-cool {
display: none;
}

.ryu-still {
background-image: url('../images/ryu-standing-still.png');

}

.ryu-ready {
background-image: url('../images/ryu-ready-position.gif');

}

.ryu-throwing {
background-image: url('../images/ryu-throwing-hadouken.png');

}

.ryu-cool{
background-image: url('../images/ryu-cool.gif');
}

.hadouken, .ryu-still, .ryu-ready, .ryu-throwing, .ryu-cool {
background-repeat: no-repeat;
}

.hadouken {
background-image: url('../images/hadouken.gif');
width: 156px;
height: 90px;
display: none;
float: left;
position: absolute;
top: 167px;
left: 520px;
z-index: 10;
}
.instructions {
font-size: 1.5em;
font-family: 'Satisfy', cursive;
color:#000;
background-color:rgba(225, 225, 225, 0.5);
width:50%;
float:right;
z-index:-1;
display:none;
}
Binary file added images/background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Streetfighter</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<link href='https://fonts.googleapis.com/css?family=Satisfy' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="main">
<div class="instructions">
<p><strong>Click</strong> on Ryu to make him throw a Hadouken.</p>
<p>Press and hold down the <strong>"x"</strong> key to make him strike his cool pose!</p>
</div>
<div class="ryu">
<div class="ryu-still"></div>
<div class="ryu-ready"></div>
<div class="ryu-throwing"></div>
<div class="ryu-cool"></div>
</div>
<div class="hadouken"></div>
<audio id="hadouken-sound" src="sound/hadouken.mp3"></audio>
<audio id="hadouken-cool" src="sound/hadouken-cool.mp3"></audio>
</div>
<script src="https://code.jquery.com/jquery.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>
54 changes: 54 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
$(document).ready(function(){
$('.instructions').fadeIn(1000);
$('.ryu').mouseenter(function(){
$('.ryu-still').hide();
$('.ryu-ready').show();
})
.mouseleave(function(){
$('.ryu-still').show();
$('.ryu-ready').hide();
})
.mousedown(function(){
playHadouken();
$('.ryu-ready').hide();
$('.ryu-throwing').show();
$('.hadouken').finish().show().animate({
'left':'1020px'
},500,function(){
$(this).hide();
$(this).css('left', '520px');
});
})
.mouseup(function(){
$('.ryu-throwing').hide();
$('.ryu-ready').show();
});

$(document).keydown(function(e) {
if (e.keyCode==88) {
playHadoukenCool ();
$('.ryu-cool').show();
$('.ryu-ready').hide();
$('.ryu-still').hide();
}
})
.on('keyup', function(e){
if (e.keyCode == 88){
$('#hadouken-cool')[0].pause();
$('#hadouken-sound')[0].load();
$('.ryu-cool').hide();
$('.ryu-still').show();
}
});

});
function playHadouken () {
$('#hadouken-sound')[0].volume = 0.5;
$('#hadouken-sound')[0].load();
$('#hadouken-sound')[0].play();
}
function playHadoukenCool () {
$('#hadouken-cool')[0].play();
}


14 changes: 0 additions & 14 deletions main.html

This file was deleted.

Binary file added sound/hadouken-cool.mp3
Binary file not shown.