Skip to content
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
183 changes: 183 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
* {
box-sizing: border-box;
-webkit-box-sizing: border-box;
}

body {
background-color: red;
font-family: 'Kanit', sans-serif;
text-transform: uppercase;
letter-spacing: 2.5px;
line-height: 175%;
}

section {
height: 100vh;
padding: 20px;
}

.character-info, .controls, .flag, .logo {
opacity: 0;
}

.logo {
margin-top: 125%;
}

h1 {
font-size: 175%;
}

h2 {
font-size: 110%;
}

ul{
list-style: none;
padding: 0;
}

li {
padding-left: 3em;
font-size: 9.5px;
font-weight: bold;
line-height: 150%;
vertical-align: center;
margin: 15px 0 15px;
background-image: url('../images/bullet.png');
background-repeat: no-repeat;
background-position: left;

}

li:first-of-type{
max-width: 160px;
}

li:nth-of-type(2) {
max-width: 200px;
}

em {
font-weight: light;
}

.main {
height: 100%;
width: 100%;
display: flex;
display: -ms-flex;
display: -webkit-flex;
z-index: 1;
background-color: white;
align-items: center;

}

.flag {
width: 35px;
height: 35px;
margin: 40px auto;
border-radius: 50%;
background-color: #d20000;
}

.left-column {
flex-basis: 1;
padding-top: 40px;
padding-bottom: 40px;
padding-left: 40px;
padding-right: 100px;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}

.logo {
width: 100%;
background-image: url('../images/sf_logo.gif');
background-size: contain;
background-position: center;
background-repeat: no-repeat;
height: 130px;

}


dl, dt, dd {
display: flex;
font-size: 10.5px;
font-weight: bold;
}

dt, dd {
flex-basis: calc(100% / 2);
}

dd {
-webkit-margin-start: 10px;
}


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

.ryu-container {
display: flex;
flex-direction: row;
flex-basis: calc(100% / 2);
justify-content: center;
align-items: center;
height: 100%;
}

.ryu {
height: 494px;
overflow: hidden;

}

.ryu-ready, .ryu-still, .ryu-throwing, .ryu-cool {
width: 400px;
height: 494px;
background-position: center;
}

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

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

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

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

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

.hadouken-container {
width: 156px;
overflow: visible;
}

.hadouken {
background-image: url('../images/hadouken.gif');
position: absolute;
width: 156px;
height: 90px;
z-index: 10;
margin-top: -75px;
margin-left: 0px;
opacity: 0;
transform: translate(-30px,0);
}
Binary file added images/bullet.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/sf_logo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
$(document).ready(function(){

$('.logo').animate({"opacity" : "1"},3000,function(){
$(this).animate({"margin-top" : "0px"},1200,function(){
$('.character-info').animate({'opacity' : '1'}),1200});
});

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

$('.ryu').mouseenter(function(){
$('.ryu-still').hide();
$('.ryu-ready').show();
});

$('.ryu').mouseleave(function(){
$('.ryu-still').show();
$('.ryu-ready').hide();
});

$('.ryu').mousedown(function(){
playHadouken();
$('.ryu-ready').hide();
$('.ryu-throwing').show();
$('.hadouken').finish().css({"opacity" : "1"})
.animate({"margin-left" : "1000px"},1200,"linear",function(){
$(this).css({"opacity" : "0" , "margin-left" : "0px"});
});
});


$('.ryu').mouseup(function(){
$('.ryu-ready').show();
$('.ryu-throwing').hide();
$('.hadouken').css({"opacity" : "0"});
});

$(document).keydown(function(e){
if(e.keyCode == 88) {
$('.ryu-action').hide();
$('.ryu-cool').show();
}
}).keyup(function(e){
if(e.keyCode == 88)
{
$('.ryu-cool').hide();

if($('.ryu').is(':hover') === true)
{$('.ryu-ready').show();}
else {$('.ryu-still').show();};
}
});




});
52 changes: 52 additions & 0 deletions main.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,60 @@
<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=Kanit:400,500,300,500italic,400italic,300italic' rel='stylesheet' type='text/css'>
</head>
<body>
<section>
<div class="main">
<div class="left-column">
<div class="logo"></div>
<div class="character-info">

<div class="flag">
</div>
<div class="detail-table">
<h1>Ryu (リュウ or 隆 <em>Ryuu</em>)</h1>
<dl>
<dt>Fighting Style:</dt>
<dd>Ansatsuken</dd>
</dl>
<dl>
<dt>Place of Birth:</dt>
<dd>Japan</dd>
</dl>
<dl>
<dt>Height:</dt>
<dd>5' 9" (175 cm)</dd>
</dl>
<dl>
<dt>Weight</dt>
<dd>187 Lbs (85 kg)</dd>
</dl>
</div>
<div class="dmg"></div>
</div>
<div class="controls">
<h2>Controls</h2>
<ul>
<li>Click Ryu to fire a Hadouken</li>
<li>Hold "X" to go into a victory pose</li>
</ul>
</div>
</div>
<div class="ryu-container">
<div class="ryu">
<div class="ryu-still ryu-action"></div>
<div class="ryu-ready ryu-action"></div>
<div class="ryu-throwing ryu-action"></div>
<div class="ryu-cool"></div>
</div>
<div class="hadouken-container">
<div class="hadouken"></div>
</div>
</div>
</div>
<audio id="hadouken-sound" src="sound/hadouken.mp3">
</section>

<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="js/app.js"></script>
Expand Down