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
13 changes: 13 additions & 0 deletions Challenges/Week2/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
Try and do all of the following:

<<<<<<< HEAD

-Prompt the user for input and store that into a variable

-Pass that value into a function

-If the user entered 'Hello' into the prompt, alert the user with 'Hello World!'

-If they entered anything else, alert with a different message of your choice (such as "Incorrect input!"

-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!
=======
Prompt the user for input and store that into a variable
Pass that value into a function
If the user entered 'Hello' into the prompt, alert the user with 'Hello World!'
If they entered anything else, alert with a different message
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!
>>>>>>> refs/remotes/CodeLouisville/master
22 changes: 22 additions & 0 deletions Challenges/Week2/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,25 @@
//Call function

//Alert user results

/* -Prompt the user for input and store that into a variable

-Pass that value into a function

-If the user entered 'Hello' into the prompt, alert the user with 'Hello World!'

-If they entered anything else, alert with a different message of your choice (such as "Incorrect input!"

-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!
*/

function hello() {
var sayHello = prompt();
if (sayHello === 'Hello') {
alert('Hello World');
document.write("you did it!")
} else {
alert("Incorrect input!");
}
}
hello();
2 changes: 1 addition & 1 deletion Challenges/Week2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ <h2>My first code challenge!</h2>
<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!
</ol>

<script></script>
<script src="app.js"></script>
</body>
</html>
10 changes: 5 additions & 5 deletions Challenges/Week3/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Week 3 JQuery Code Challenge

An incomplete flashcard game has been set up. Complete the remaining functionality using JQuery commands.

Open app.js and index.html in your text editor. Read the comments in app.js for instructions on what to add. Try and complete the missing features of the game by modifying app.js!
Week 3 JQuery Code Challenge
An incomplete flashcard game has been set up. Complete the remaining functionality using JQuery commands.
Open app.js and index.html in your text editor. Read the comments in app.js for instructions on what to add. Try and complete the missing features of the game by modifying app.js!
158 changes: 79 additions & 79 deletions Challenges/Week3/css/style.css
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
html {
height: 100%;
box-sizing: border-box;
}
body {
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#cb60b3+0,ad1283+50,de47ac+100;Pink+3D */
background: #cb60b3; /* Old browsers */
background: -moz-linear-gradient(-45deg, #cb60b3 0%, #ad1283 50%, #de47ac 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(-45deg, #cb60b3 0%,#ad1283 50%,#de47ac 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(135deg, #cb60b3 0%,#ad1283 50%,#de47ac 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cb60b3', endColorstr='#de47ac',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
background-attachment: fixed;
color: white;
font-family: sans-serif;
}
h1 {
text-shadow: 2px 2px 2px #000;
display: block;
text-align: center;
}
.flash-card {
background: white;
color: black;
height: 100px;
border-radius: 5px;
margin-top: 1em;
transition: all .2s ease-in-out;
overflow: hidden;
}
.question {
height: 3em;
margin-bottom: 1em;
display: block;
}
.answer {
display: block;
}
.flash-card:hover {
transform: scale(1.05);
box-shadow: 2px 2px 10px black;
}
ul {
margin: 0;
padding: 0;
}
ul li {
list-style: none;
width: 20%;
margin: 0 1%;
padding: 1em;
display: inline-block;
cursor: pointer;
}
.cheat-button {
color: white;
background-color: purple;
border: none;
padding: 1em;
border-radius: 5px;
display: block;
margin: 0 auto;
margin-top: 1em;
font-size: 1.2em;
cursor: pointer;
transition: all .2s ease-in-out;
}
.cheat-button:hover {
transform: scale(1.05);
html {
height: 100%;
box-sizing: border-box;
}

body {
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#cb60b3+0,ad1283+50,de47ac+100;Pink+3D */
background: #cb60b3; /* Old browsers */
background: -moz-linear-gradient(-45deg, #cb60b3 0%, #ad1283 50%, #de47ac 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(-45deg, #cb60b3 0%,#ad1283 50%,#de47ac 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(135deg, #cb60b3 0%,#ad1283 50%,#de47ac 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cb60b3', endColorstr='#de47ac',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
background-attachment: fixed;
color: white;
font-family: sans-serif;
}


h1 {
text-shadow: 2px 2px 2px #000;
display: block;
text-align: center;
}

.flash-card {
background: white;
color: black;
height: 100px;
border-radius: 5px;
margin-top: 1em;
transition: all .2s ease-in-out;
overflow: hidden;
}

.question {
height: 3em;
margin-bottom: 1em;
display: block;
}

.answer {
display: block;
}

.flash-card:hover {
transform: scale(1.05);
box-shadow: 2px 2px 10px black;
}

ul {
margin: 0;
padding: 0;
}

ul li {
list-style: none;
width: 20%;
margin: 0 1%;
padding: 1em;
display: inline-block;
cursor: pointer;
}

.cheat-button {
color: white;
background-color: purple;
border: none;
padding: 1em;
border-radius: 5px;
display: block;
margin: 0 auto;
margin-top: 1em;
font-size: 1.2em;
cursor: pointer;
transition: all .2s ease-in-out;
}

.cheat-button:hover {
transform: scale(1.05);
}
26 changes: 13 additions & 13 deletions Challenges/Week3/js/app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// 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')
/* 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')
/* 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. */
// 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')

/* 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')

/* 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. */
$()
24 changes: 12 additions & 12 deletions Solutions/Week2/app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
function getWelcomeMessage(value) {
if(value == 'Hello')
{
return "Hello world!"
}
else{
return "You didn't say hello :("
}
}
var val = prompt("Type 'Hello'")
alert(getWelcomeMessage(val));
function getWelcomeMessage(value) {

if(value == 'Hello')
{
return "Hello world!"
}
else{
return "You didn't say hello :("
}
}
var val = prompt("Type 'Hello'")
alert(getWelcomeMessage(val));
40 changes: 20 additions & 20 deletions Solutions/Week2/index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!DOCTYPE html>
<head>
<title>Week 2 Code Challenge</title>
</head>
<body>
<div class="main-content">
<h2>My first code challenge!</h2>
</div>
<p>Try and do all of the following:</p>
<ol>
<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>
<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 src="app.js"></script>
</body>
</html>
<!DOCTYPE html>
<head>
<title>Week 2 Code Challenge</title>
</head>
<body>
<div class="main-content">
<h2>My first code challenge!</h2>
</div>
<p>Try and do all of the following:</p>
<ol>
<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>
<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 src="app.js"></script>
</body>
</html>