-
Notifications
You must be signed in to change notification settings - Fork 12
Sheyna, Monica & Casey #7
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
Open
monicaedavidson
wants to merge
8
commits into
SEA-Design-Dev:master
Choose a base branch
from
monicaedavidson: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
Show all changes
8 commits
Select commit
Hold shift + click to select a range
04f2074
added some fun javascript
monicaedavidson c4aee6e
Delete .DS_Store
monicaedavidson 5f98d91
Added albums as json file.
sheyna 0f7c09f
Finished Ajax and Json additions.
sheyna 9fa3dc5
added ajax, fade and time of day
monicaedavidson 2db5911
Update README.md
monicaedavidson 2a4658d
Added gitignore.
sheyna f0943a4
Rewrote recommendAnAlbum as jQuery. Created new file of this code and…
sheyna 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 hidden or 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,37 @@ | ||
# Compiled source # | ||
################### | ||
*.com | ||
*.class | ||
*.dll | ||
*.exe | ||
*.o | ||
*.so | ||
|
||
# Packages # | ||
############ | ||
# it's better to unpack these files and commit the raw source | ||
# git has its own built in compression methods | ||
*.7z | ||
*.dmg | ||
*.gz | ||
*.iso | ||
*.jar | ||
*.rar | ||
*.tar | ||
*.zip | ||
|
||
# Logs and databases # | ||
###################### | ||
*.log | ||
*.sql | ||
*.sqlite | ||
|
||
# OS generated files # | ||
###################### | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db |
This file contains hidden or 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,4 @@ | ||
Build a Javascript Thing Assignment | ||
JSON, Ajax, jQuery fade and more JavaScript were added to the previous assignment. | ||
Collaborators were Sheyna, Casey and Monica | ||
This assignment builds upon Casey and Henok's previous assignment. It is coded so that the user can enter any number and it will randomly generate Henok's favorite, most loved albums. A jQuery fade was implemented to make the website extra beautiful. Also, JavaScript code was inserted that tracks the time of the day. The files were altered to use JSON and Ajax. |
Binary file not shown.
This file contains hidden or 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,37 @@ | ||
# Compiled source # | ||
################### | ||
*.com | ||
*.class | ||
*.dll | ||
*.exe | ||
*.o | ||
*.so | ||
|
||
# Packages # | ||
############ | ||
# it's better to unpack these files and commit the raw source | ||
# git has its own built in compression methods | ||
*.7z | ||
*.dmg | ||
*.gz | ||
*.iso | ||
*.jar | ||
*.rar | ||
*.tar | ||
*.zip | ||
|
||
# Logs and databases # | ||
###################### | ||
*.log | ||
*.sql | ||
*.sqlite | ||
|
||
# OS generated files # | ||
###################### | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db |
This file contains hidden or 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,3 @@ | ||
#Built a JavaScript Thingy | ||
##Built and coded by Sheyna, Casey and Monica | ||
###We redid Henok's and Casey's top album website to randomly generate a music recommendation |
This file contains hidden or 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,15 @@ | ||
var today = new Date(); | ||
var hourNow = today.getHours(); | ||
var greeting; | ||
|
||
if (hourNow > 18) { | ||
greeting = 'Good evening! Why are you at CF so late??....yeah that is right, javascript is totally keeping track of time :)'; | ||
} else if (hourNow > 12) { | ||
greeting = 'Good afternoon!, user....yeah, javascript is totally keeping track the time of day :)'; | ||
} else if (hourNow > 0) { | ||
greeting = 'Good morning user!!...yeah, javascript is totally keeping track of the time of day :)'; | ||
} else { | ||
greeting = 'Welcome CF user!!!!!!'; | ||
} | ||
|
||
document.write('<h2>' + greeting + '</h2>'); |
This file contains hidden or 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,37 @@ | ||
[ | ||
{ | ||
"imageURL": "http://thissongissick.com/wp-content/uploads/2014/10/Run-The-Jewels.jpg", | ||
"imageAlt": "Run The Jewels 2", | ||
"caption": "Run The Jewels - Run The Jewels 2", | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum tempus nulla a tempor. Nulla porttitor diam sed ligula sollicitudin fermentum. Ut sit amet tristique nisl. Donec in laoreet lorem. Integer volutpat lacus sem. In eget laoreet tortor. In auctor tortor ipsum, non euismod nisl dignissim vel. Sed non dolor.", | ||
"youTubeURL": "https://www.youtube.com/watch?v=Hd1dTrFdZkA" | ||
}, | ||
{ | ||
"imageURL": "http://cdn4.pitchfork.com/news/55815/fc741210.jpg", | ||
"imageAlt": "Black Moon Spell" , | ||
"caption": "King Tuff - Black Moon Spell", | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum tempus nulla a tempor. Nulla porttitor diam sed ligula sollicitudin fermentum. Ut sit amet tristique nisl. Donec in laoreet lorem. Integer volutpat lacus sem. In eget laoreet tortor. In auctor tortor ipsum, non euismod nisl dignissim vel. Sed non dolor.", | ||
"youTubeURL": "https://www.youtube.com/watch?v=9ufWAU8RjC8" | ||
}, | ||
{ | ||
"imageURL": "http://www.aux.tv/wp-content/uploads/2014/04/freddie-gibbs-madlib-pinata.jpg", | ||
"imageAlt": "Pinata", | ||
"caption": "Freddie Gibbs & Madlib - Pinata", | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum tempus nulla a tempor. Nulla porttitor diam sed ligula sollicitudin fermentum. Ut sit amet tristique nisl. Donec in laoreet lorem. Integer volutpat lacus sem. In eget laoreet tortor. In auctor tortor ipsum, non euismod nisl dignissim vel. Sed non dolor.", | ||
"youTubeURL": "https://www.youtube.com/watch?v=98nUZ938oiU" | ||
}, | ||
{ | ||
"imageURL": "http://cdn4.pitchfork.com/news/53290/1e766e86.jpg", | ||
"imageAlt": "Present Tense", | ||
"caption": "Wild Beasts - Present Tense", | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum tempus nulla a tempor. Nulla porttitor diam sed ligula sollicitudin fermentum. Ut sit amet tristique nisl. Donec in laoreet lorem. Integer volutpat lacus sem. In eget laoreet tortor. In auctor tortor ipsum, non euismod nisl dignissim vel. Sed non dolor.", | ||
"youTubeURL": "https://www.youtube.com/watch?v=9IIbbFIQTKI&list=PLaXEUnRhowO5T2vMgPCrH0XjBnyIeyml2" | ||
}, | ||
{ | ||
"imageURL": "http://www.rockleak.com/uploads/posts/2014-07/1406054962_hippiesabotage-sunny-cover.jpg", | ||
"imageAlt": "Sunny", | ||
"caption": "Hippie Sabotage - Sunny", | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras interdum tempus nulla a tempor. Nulla porttitor diam sed ligula sollicitudin fermentum. Ut sit amet tristique nisl. Donec in laoreet lorem. Integer volutpat lacus sem. In eget laoreet tortor. In auctor tortor ipsum, non euismod nisl dignissim vel. Sed non dolor.", | ||
"youTubeURL": "https://www.youtube.com/watch?v=zfnyoKu7ptw&list=PLQ83U7ao7jjBC1A5WNEdxxhEl8pmdbGXN" | ||
} | ||
] |
This file contains hidden or 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,17 @@ | ||
<script src="jquery-1.11.1.min.js"></script> | ||
<script> | ||
$(function() { | ||
$("body").fadeToggle(800).fadeToggle(3000); | ||
}); | ||
</script> | ||
<script> | ||
$(function() { | ||
|
||
$(".nav-hov").on("mouseover", function() { | ||
var navId = $(this).attr("data-navId"); | ||
$("#"+navId).fadeOut(800).fadeIn(1200); | ||
}); | ||
}); | ||
|
||
|
||
</script> |
This file contains hidden or 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,3 @@ | ||
$(function() { | ||
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. Could you have consolidated your js files? |
||
$("body").fadeToggle(800).fadeToggle(3000); | ||
}); |
This file contains hidden or 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,32 @@ | ||
window.onload = function() { | ||
var album1 = document.getElementById('album1'); | ||
var album2 = document.getElementById('album2'); | ||
var album3 = document.getElementById('album3'); | ||
var album4 = document.getElementById('album4'); | ||
var album5 = document.getElementById('album5'); | ||
|
||
function setDisplayNone() { | ||
album1.style.display = 'none'; | ||
album2.style.display = 'none'; | ||
album3.style.display = 'none'; | ||
album4.style.display = 'none'; | ||
album5.style.display = 'none'; | ||
} | ||
setDisplayNone(); | ||
|
||
var userNumber = prompt("Enter any number and we will give you an amazing music recommendation"); | ||
|
||
var numberParsed = parseInt(userNumber); | ||
|
||
if (numberParsed % 8 === 0) { | ||
album1.style.display = 'block'; | ||
} else if (numberParsed % 7 === 0) { | ||
album2.style.display = 'block'; | ||
} else if (numberParsed % 5 === 0) { | ||
album3.style.display = 'block'; | ||
} else if (numberParsed % 2 === 0) { | ||
album4.style.display = 'block'; | ||
} else { | ||
album5.style.display = 'block'; | ||
} | ||
}; |
This file contains hidden or 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,28 @@ | ||
<DOCTYPE html> | ||
<html> | ||
<head> | ||
<link href='http://fonts.googleapis.com/css?family=Arimo:700italic' rel='stylesheet' type='text/css'> | ||
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'> | ||
<link rel="stylesheet" href="style.css"> | ||
<meta charset='utf-8'> | ||
<title>Top Albums According to Henok</title> | ||
</head> | ||
<body> | ||
<main> | ||
<h2 ><script src="add-content.js"></script></h2> | ||
<header> | ||
<h1 class="header">Henok's Most Beloved Albums</h1> | ||
</header> | ||
<section> | ||
<div class="wrapper"> | ||
<article class="albums" id="RecommendedAlbum"> | ||
</article> | ||
</div> | ||
</section> | ||
</main> | ||
<script src="jquery-1.11.1.min.js"></script> | ||
<script src="recommendAnAlbum_with_jquery.js"></script> | ||
<script src="fade.js"></script> | ||
<script src="add-content.js"></script> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,35 @@ | ||
function getAlbum(albumNumber) { | ||
var xhr = new XMLHttpRequest(); | ||
xhr.open('GET', 'albums.json'); | ||
xhr.onreadystatechange = function () { | ||
if(xhr.readyState === 4 && xhr.status === 200) { | ||
var albums = JSON.parse(xhr.responseText); | ||
var statusHTML = '<figure><img src="' + albums[albumNumber].imageURL + '" \ | ||
alt="' + albums[albumNumber].imageAlt + '" class="winner">\ | ||
<figcaption>' + albums[albumNumber].caption + '</figcaption>\ | ||
</figure> <p class="description">' + albums[albumNumber].description + '</p>\ | ||
<button><a href="' + albums[albumNumber].youTubeURL + '">Find</a></button>'; | ||
|
||
document.getElementById('RecommendedAlbum').innerHTML = statusHTML; | ||
} | ||
}; | ||
xhr.send(); | ||
} | ||
|
||
window.onload = function() { | ||
var userNumber = prompt("Enter any number and we will give you an amazing music recommendation"); | ||
|
||
var numberParsed = parseInt(userNumber); | ||
|
||
if (numberParsed % 8 === 0) { | ||
getAlbum(0); | ||
} else if (numberParsed % 7 === 0) { | ||
getAlbum(1); | ||
} else if (numberParsed % 5 === 0) { | ||
getAlbum(2); | ||
} else if (numberParsed % 2 === 0) { | ||
getAlbum(3); | ||
} else { | ||
getAlbum(4); | ||
} | ||
} |
This file contains hidden or 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,35 @@ | ||
function getAlbum(albumNumber) { | ||
var url = "albums.json"; | ||
$.getJSON(url, function(data) { | ||
var albums = data; | ||
var albumFigure = '<figure><img src="' + albums[albumNumber].imageURL + '"'; | ||
var albumFigureAlt = 'alt="' + albums[albumNumber].imageAlt + '"'; | ||
var albumClass = 'class="winner">'; | ||
var albumFigCaption = '<figcaption>' + albums[albumNumber].caption + '</figcaption>'; | ||
var albumCloseFig = '</figure>'; | ||
$('#RecommendedAlbum').append(albumFigure + albumFigureAlt + albumClass + albumFigCaption + albumCloseFig); | ||
$('#RecommendedAlbum').append('<p class="description">' + albums[albumNumber].description + '</p>'); | ||
var albumBtnStart = '<button>'; | ||
var albumBtnLink = '<a href="' + albums[albumNumber].youTubeURL + '">Find</a>'; | ||
var albumBtnClose = '</button>'; | ||
$('#RecommendedAlbum').append(albumBtnStart + albumBtnLink + albumBtnClose); | ||
}); | ||
}; | ||
|
||
$(document).ready(function() { | ||
var userNumber = prompt("Enter any number and we will give you an amazing music recommendation"); | ||
|
||
var numberParsed = parseInt(userNumber); | ||
|
||
if (numberParsed % 7 === 0) { | ||
getAlbum(0); | ||
} else if (numberParsed % 5 === 0) { | ||
getAlbum(1); | ||
} else if (numberParsed % 3 === 0) { | ||
getAlbum(2); | ||
} else if (numberParsed % 2 === 0) { | ||
getAlbum(3); | ||
} else { | ||
getAlbum(4); | ||
} | ||
}); |
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.
jquery should be included in the html not in here.