-
Notifications
You must be signed in to change notification settings - Fork 16
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
HW5 Submission for Josh Cooper #8
Open
jcooper8190
wants to merge
1
commit into
FEWD87:master
Choose a base branch
from
jcooper8190:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,153 @@ | ||
|
||
* { | ||
-moz-box-sizing: border-box; | ||
-webkit-box-sizing: border-box; | ||
box-sizing: border-box; | ||
} | ||
|
||
|
||
.clearfix:after { | ||
content: "."; | ||
display: block; | ||
clear: both; | ||
visibility: hidden; | ||
line-height: 0; | ||
height: 0; | ||
} | ||
|
||
.clear { | ||
clear: both; | ||
} | ||
|
||
.alignright { | ||
float: right; | ||
padding: 0 0 10px 10px; | ||
} | ||
|
||
.alignleft { | ||
float: left; | ||
padding: 0 10px 10px 0; | ||
} | ||
|
||
|
||
|
||
body { | ||
color: #000; | ||
font-size: 12px; | ||
line-height: 1.4; | ||
font-family: Helvetica, Arial, sans-serif; | ||
background: url(http://www.siwallpaperhd.com/wp-content/uploads/2015/05/beautiful_paris_city_night_wallpaper_hd_9.jpg) no-repeat center center fixed; | ||
-webkit-background-size: cover; | ||
-moz-background-size: cover; | ||
-o-background-size: cover; | ||
background-size: cover; | ||
} | ||
|
||
|
||
.container { | ||
width: 960px; | ||
margin: auto; | ||
padding-top: 5em; | ||
} | ||
|
||
header { | ||
background: rgba(0,0,0, .5); | ||
padding: 20px 0; | ||
} | ||
|
||
.title { | ||
text-align: center; | ||
color: #fff; | ||
font-size: 38px; | ||
font-weight: bold; | ||
font-family: helvetica, arial, sans-serif; | ||
} | ||
|
||
h2 { | ||
text-align: center; | ||
color: #FFF; | ||
font-size: 24px; | ||
font-weight: bold; | ||
font-family: helvetica, arial, sans-serif; | ||
background: rgba(5,5,5,.5); | ||
margin: 40px 0px 0px 0px; | ||
} | ||
|
||
.title p { | ||
font-size: 22px; | ||
font-weight: normal | ||
} | ||
|
||
#ctemp { | ||
color: #6b6b6c; | ||
font-size: 38px; | ||
background: #fff; | ||
border: 1px solid #111; | ||
padding: 0px 30px; | ||
display: inline-block; | ||
width: 680px; | ||
margin-right: 24px; | ||
font-family: helvetica, arial, sans-serif; | ||
height: 72px; | ||
line-height: 74px; | ||
vertical-align: middle; | ||
box-shadow: #111 0 0 20px; | ||
} | ||
|
||
#ftemp { | ||
color: #6b6b6c; | ||
font-size: 38px; | ||
background: #fff; | ||
border: 1px solid #111; | ||
padding: 0px 30px; | ||
display: inline-block; | ||
width: 680px; | ||
margin-right: 24px; | ||
font-family: helvetica, arial, sans-serif; | ||
height: 72px; | ||
line-height: 74px; | ||
vertical-align: middle; | ||
box-shadow: #111 0 0 20px; | ||
} | ||
|
||
|
||
#submit-btn { | ||
background: #31CC31; | ||
color: #000; | ||
font-size: 38px; | ||
font-weight: bold; | ||
text-transform: uppercase; | ||
border: 1px solid #111; | ||
text-align: center; | ||
display: inline-block; | ||
width: 250px; | ||
height: 72px; | ||
line-height: 74px; | ||
vertical-align: middle; | ||
box-shadow: #111 0 0 50px; | ||
font-family: helvetica, arial, sans-serif; | ||
cursor: pointer; | ||
} | ||
#submit-btn:hover { | ||
background: #3DFF3D; | ||
} | ||
|
||
.cold { | ||
background-image: url(http://theartmad.com/wp-content/uploads/2015/04/Snowy-Forest-At-Night-1.jpg) | ||
} | ||
.mild { | ||
background-image: url(http://newtopwallpapers.com/wp-content/uploads/2013/04/Rainy-Night-Desktop-Free-Wallpaper.jpg) | ||
} | ||
.average { | ||
background-image: url(http://cdn.wonderfulengineering.com/wp-content/uploads/2015/05/San-Francisco-Wallpaper-23.jpg) | ||
} | ||
.hot { | ||
background-image: url(http://eskipaper.com/images/hawaii-beach-night-3.jpg) | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,38 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="description" content="Your description goes here"> | ||
<meta name="keywords" content="one, two, three"> | ||
<title>Celsius Converter</title> | ||
|
||
<!-- external CSS link --> | ||
|
||
<link rel="stylesheet" href="css/styles.css"> | ||
</head> | ||
|
||
<body> | ||
<header> | ||
<div class="title"> | ||
<h1>Celsius Converter</h1> | ||
</div> | ||
</header> | ||
<div class="container"> | ||
<form> | ||
<input type="number" id="ctemp" placeholder="Enter your temperature in celsius"> | ||
<input type="submit" value="Get Temp" id="submit-btn"> | ||
</form> | ||
</div> | ||
|
||
<div class="container"> | ||
<form> | ||
<input type="number" id="ftemp" placeholder="Displays Fahrenheit"> | ||
|
||
</form> | ||
</div> | ||
|
||
|
||
<script src="js/jquery-2.1.4.js"></script> | ||
<script src="js/index.js"></script> | ||
</body> | ||
</html> |
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,59 @@ | ||
$(function(){ | ||
|
||
// listen for user clicking 'submit'/submitting text | ||
|
||
$("#submit-btn").click(changeBackground); | ||
// $("#submit-btn").click(convertTemp); | ||
|
||
function convertTemp() { | ||
// Set the initial variables for c (Celsius) and f (Fahrenheit) | ||
var ctemp = document.getElementById('ctemp'), ftemp = document.getElementById('ftemp'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jcooper8190 if you chose to use one var and comma delimitate the rest of the variables. Try to use this convention.
|
||
// Test if there is a value for Celsius | ||
if(ctemp.value != '') { | ||
// Set the value for Fahrenheit | ||
ftemp.value = Math.round(ctemp.value * 9 / 5 + 32); | ||
// Clear the value for Celsius | ||
// ctemp.value = ''; | ||
// If there isn't a value for Celsius | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
function changeBackground(event) { | ||
|
||
event.preventDefault(); | ||
convertTemp(); | ||
|
||
|
||
var ftemp = parseInt($("#ftemp").val()); | ||
console.log(ftemp,(typeof ftemp)) | ||
|
||
|
||
|
||
if(ftemp <= 32){ | ||
$("body").attr("class", "cold"); | ||
} | ||
|
||
else if(ftemp > 32 && ftemp < 55){ | ||
$("body").attr("class", "mild"); | ||
} | ||
|
||
else if(ftemp >= 55 && ftemp < 75){ | ||
$("body").attr("class", "average"); | ||
} | ||
|
||
else if(ftemp >= 75){ | ||
$("body").attr("class", "hot"); | ||
} | ||
|
||
|
||
|
||
else{ | ||
$("body").attr("class", ""); | ||
} | ||
|
||
|
||
} | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcooper8190 when you have an input with the type of
number
you get that controller on the right side of the field to increment through number values. Even thought this mitigates you having to change the string value to a number. The final UX is probably not what you would want.