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
17 changes: 12 additions & 5 deletions Challenges/Week2/app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
//create function
function Hello(value) {
//control and return statements

//Prompt user for input and store variable

//Call function

if(value == 'Hello')
{
return "Hello world!"
}
else{
return "You didn't say hello :("
}
}
//Prompt user for input and store variable and call function
var userInput = prompt("Type 'Hello'")
//Alert user results
alert(Hello(userInput));
6 changes: 3 additions & 3 deletions Challenges/Week2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ <h2>My first code challenge!</h2>
<li>Prompt the user for input and store that into a variable</li>
<li>Pass that value into a function</li>
<li>If the user entered 'Hello' into the prompt, alert the user with 'Hello World!'</li>
<li>If they entered anything else, alert with a different message
<li>Don't forget to call your script file from this HTML file! I've created the script tags for you, but you have to add something to it!
<li>If they entered anything else, alert with a different message</li>
<li>Don't forget to call your script file from this HTML file! I've created the script tags for you, but you have to add something to it!</li>
</ol>

<script></script>
<script src="app.js"></script>
</body>
</html>
90 changes: 45 additions & 45 deletions Challenges/Week3/index.html
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" title="no title" charset="utf-8">
<title>Flash Cards</title>
</head>
<body>
<h1>Flash Cards</h1>
<ul>
<li class="flash-card">
<span class="question">Q: What actress earned an Oscar nomination for her first screen appearance in "Raging Bull"?</span>
<span class="answer">A: Cathy Moriarty</span>
</li>
<li class="flash-card">
<span class="question">Q: What TV show featured the fictional "The Cobra Lodge" fraternity?</span>
<span class="answer">A: Mama's Family</spanp>
</li>
<li class="flash-card">
<span class="question">Q: What album earned the Dixie Chicks a Grammy Award in 2007?</span>
<span class="answer">A: Taking the Long Way</span>
</li>
<li class="flash-card">
<span class="question">Q: What Oliver Stone movie features the characters Mickey and Mallory?</span>
<span class="answer">A: Natural Born Killers</span>
</li>
<li class="flash-card">
<span class="question">Q: An episode of what sitcom spawned the phrase "jumped the shark"?</span>
<span class="answer">A: Happy Days</spanp>
</li>
<li class="flash-card">
<span class="question">Q: Who was the first female comic to be called over to the couch by Johnny Carson?</span>
<span class="answer">A: Ellen DeGeneres</span>
</li>
<li class="flash-card">
<span class="question">Q: What famous rapper's real name is Chris Bridges?</span>
<span class="answer">A: Ludacris</spanp>
</li>
<li class="flash-card">
<span class="question">Q: In which country was the singer Mika born?</span>
<span class="answer">A: Lebanon</span>
</li>
</ul>
<head>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" title="no title" charset="utf-8">
<title>Flash Cards</title>
</head>
<body>
<h1>Flash Cards</h1>
<ul>
<li class="flash-card">
<span class="question">Q: What actress earned an Oscar nomination for her first screen appearance in "Raging Bull"?</span>
<span class="answer">A: Cathy Moriarty</span>
</li>
<li class="flash-card">
<span class="question">Q: What TV show featured the fictional "The Cobra Lodge" fraternity?</span>
<span class="answer">A: Mama's Family</spanp>
</li>
<li class="flash-card">
<span class="question">Q: What album earned the Dixie Chicks a Grammy Award in 2007?</span>
<span class="answer">A: Taking the Long Way</span>
</li>
<li class="flash-card">
<span class="question">Q: What Oliver Stone movie features the characters Mickey and Mallory?</span>
<span class="answer">A: Natural Born Killers</span>
</li>
<li class="flash-card">
<span class="question">Q: An episode of what sitcom spawned the phrase "jumped the shark"?</span>
<span class="answer">A: Happy Days</spanp>
</li>
<li class="flash-card">
<span class="question">Q: Who was the first female comic to be called over to the couch by Johnny Carson?</span>
<span class="answer">A: Ellen DeGeneres</span>
</li>
<li class="flash-card">
<span class="question">Q: What famous rapper's real name is Chris Bridges?</span>
<span class="answer">A: Ludacris</spanp>
</li>
<li class="flash-card">
<span class="question">Q: In which country was the singer Mika born?</span>
<span class="answer">A: Lebanon</span>
</li>
</ul>

<button class="cheat-button">Show All Answers</button>

<!--Replace this comment with a script tag from https://code.jquery.com/ -->
<script src="js/app.js" type="text/javascript" charset="utf-8"></script>
</body>
<button class="cheat-button">Show All Answers</button>
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>
<script src="js/app.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
16 changes: 13 additions & 3 deletions Challenges/Week3/js/app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
// 1.) Make sure you have a reference to jQuery from a CDN in the index.html file.

// 2.) Use a jQuery to hide all of the answers to all the questions.
$('.answer')
$('.answer').hide();

/* 3.) Write code to show the answer when hovering over a flash card, and hide it when the mouse leaves.
Find the approriate event on the jQuery API page to trigger an action on hover https://api.jquery.com/category/events/
Hint: You can use "this" inside your jQuery function to reference a selected DOM node. */
$('.flash-card')
$( "li" ).hover(
function() {
$(this).children('.answer').show();
}, function() {
$(this).children('.answer').hide();
}
);

/* 4.) Use jQuery to find the button element on the page and have it toggle all of the answers on and off when clicked.
Hint: jQuery has a toggle function that can toggle the visibility of a selected DOM node.
Bonus: Change the text of the button using jQuery when you toggle the answers on/off. */
$()
$('.cheat-button').click(
function() {
$('.answer').toggle()
}
);
26 changes: 26 additions & 0 deletions Challenges/Week4/ChallengeFiles/challenge.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
body {
background-color: black;
padding: 10px;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
color: white;
}

.planet {
width: 300px;
height: 300px;
border-radius: 50%;
text-align: center;
padding: 10px;
position: relative;
background-color: silver;
}

.moon {
position: absolute;
width: 50px;
height: 50px;
border-radius: 50%;
background: rgb(153, 153, 153);
}

14 changes: 14 additions & 0 deletions Challenges/Week4/ChallengeFiles/challenge.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="challenge.css">

</head>

<body>

<h1>Week 4 Code Challenge: </h1>
<h2>DOM manipulation with only JavaScript!</h2>

<script src="challenge.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions Challenges/Week4/ChallengeFiles/challenge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Part 1: Create a new div of class "planet" and set its background color
// to the color of your choice. Then, append it to the body in the DOM.

<div class=planet></div>

// Part 2: Create a new div of class "moon" and append it to the planet in the DOM.

<div class=moon></div>
25 changes: 25 additions & 0 deletions Challenges/Week4/SolutionFiles/challenge.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
body {
background-color: black;
padding: 10px;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
color: white;
}

.planet {
width: 300px;
height: 300px;
border-radius: 50%;
text-align: center;
padding: 10px;
position: relative;
}

.moon {
position: absolute;
width: 50px;
height: 50px;
border-radius: 50%;
background: rgb(153, 153, 153);
}

14 changes: 14 additions & 0 deletions Challenges/Week4/SolutionFiles/challenge.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="challenge.css">

</head>

<body>

<h1>Week 4 Code Challenge: </h1>
<h2>DOM manipulation with only JavaScript!</h2>

<script src="challenge.js"></script>
</body>
</html>
17 changes: 17 additions & 0 deletions Challenges/Week4/SolutionFiles/challenge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Create a new div of class "planet" and set its background color
// to the color of your choice. Then, append it to the body in the DOM.

// One Answer:

var newPlanet = document.createElement("div");
newPlanet.className = "planet";
newPlanet.style.backgroundColor = "red";
document.body.appendChild(newPlanet);

// Create a new div of class "moon" and append it to the planet in the DOM.

// One Answer:

var newMoon = document.createElement("div");
newMoon.className = "moon";
newPlanet.appendChild(newMoon);
9 changes: 8 additions & 1 deletion Challenges/Week5/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ function addPokemon(name) {
`).appendTo('#pokemon');
};


{
"count": 20,
"next": "http://pokeapi.co/api/v2/evolution-chain/?limit=20&offset=20",
"previous": null,
"results": [{
"url": "http://pokeapi.co/api/v2/evolution-chain/1/"
}]
}
// 1.) Use the PokéAPI from http://pokeapi.co along with jQuery's getJSON function to retrieve the first 20 Pokémon.
// 1.1) Use the addPokemon function to show each of the Pokémon names that were retrieved.
//Hint: Learn how to access resources via the documentation http://pokeapi.co/docsv2/#resource-lists
Expand Down
2 changes: 1 addition & 1 deletion Solutions/Week2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ <h2>My first code challenge!</h2>

<script src="app.js"></script>
</body>
</html>
</html>