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
133 changes: 133 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
'use strict';

let userName = prompt('What is your name?');
console.log('User\'s name is ' + userName);

let correctAnswers = 0;

alert('Hello ' + userName + '! Let\'s see if you can answer these yes/no questions about me. Please type your response as either yes/no or y/n.');

//question one
let question1 = prompt('Is Lee a Swing dancer?').toLowerCase();

if (question1 === 'yes' || question1 === 'y') {
alert('That\'s right, ' + userName + '! Lee\'s been doing Lindy Hop and other Jazz dances for nine years!');
correctAnswers++;
} else {
alert('He mentioned this the first day in class during his introduction. Were you listening,' + userName + ' ? :(');
}

console.log('User\'s response is "' + question1 + '" to question 1.');

//question two
let question2 = prompt('Is Lee a smoker?').toLowerCase();

if (question2 === 'no' || question2 === 'n') {
alert('That\'s correct, ' + userName + '! Up until about a year and a half ago, he was for the prior 12 years, but he has since quit!');
correctAnswers++;
} else {
alert('That is a big negatory,' + userName + '. He used to, but does no longer.');
}

console.log('User\'s response is "' + question2 + '" to question 2.');

//question three
let question3 = prompt('Is Lee playing PokemonGO right now?').toLowerCase();

if (question3 === 'yes' || question3 === 'y') {
alert('Most likely. Probably just caught a Pikachu, ' + userName + '. Just kidding. It\'s just a Zubat. Of course.');
correctAnswers++;
} else {
alert('Interesting thought, ' + userName + '. If he\'s not playing, his phone\'s battery has likely died.');
}

console.log('User\'s response is "' + question3 + '" to question 3.');

//question four
let question4 = prompt('Is Lee\'s hair red?').toLowerCase();

if (question4 === 'no' || question4 === 'n') {
alert('Really, ' + userName + '? Have you looked at him? It\'s pretty red. :)');
} else {
alert('That\'s correct, ' + userName + '! Been a ginger his whole life.');
correctAnswers++;
}

console.log('User\'s response is "' + question4 + '" to question 4.');

//question 5
let question5 = prompt('Was he born in California?').toLowerCase();

if (question5 === 'yes' || question5 === 'y') {
alert('Yup! In a small town near Lancaster, California, ' + userName + '!');
correctAnswers++;
} else {
alert('That is incorrect, ' + userName + '. He was born in northern California ');
}

console.log('User\'s response is "' + question5 + '" to question 5.');

alert('Now for a more difficult question with a number for an answer. Do your best!');

//Question 6

let age = 31;

for (let i = 0; i < 4; i++) {
let ageAnswer = prompt('How old is Lee? Redheads are deceptively difficult to tell with!');
if (ageAnswer == age) {
alert('You got it right! Great job, partner. Lee is ' + age + '!');
console.log('User response is ' + ageAnswer + ' to question 6');
correctAnswers++;
break;
}
else if (ageAnswer > age) {
alert('You guessed a bit too high. Does he look that old?');
console.log('User response is ' + ageAnswer + ' to question ');
}
else if (ageAnswer < age) {
alert('You\'re a bit too low. I realize Lee\'s immature, but not that bad.');
console.log('User response is ' + ageAnswer + ' to question 6');
}
else if (isNaN(ageAnswer) === true) {
alert('That is not a number. You can\'t do that.');
console.log('User response is ' + ageAnswer + ' to question 6');
}
else if ((i === 3) && (ageAnswer !== age)) {
alert('You\'ve run out of chances. Lee\'s ' + age + ', for the record!');
console.log('User response is ' + ageAnswer + ' to question 6');
}
}

//Question 7
let userCorrect = false;

let pokemon = ['pikachu', 'zubat', 'drowzee', 'onyx', 'charmander', 'snorlax'];

let guesses = 0;

while (guesses < 7) {
let pokeAnswer = prompt('What Pokemon has Lee caught this week on PokemonGO?').toLowerCase();
for (let i = 0; i < pokemon.length; i++) {
if (pokeAnswer === pokemon[i]) {
alert('You caught the right answer! Nice work! The ones he caught this week are: ' + pokemon);
console.log('User response is ' + pokeAnswer + ' to question 6');
guesses = 7;
correctAnswers++;
userCorrect = true;
break;
}
}
if (guesses !== 7) {
alert('Not that one. You\'re not the very best, but try again!');
console.log('User response is ' + pokeAnswer + ' to question 6');
}
guesses++;
}
if (userCorrect === false) {
alert('Uh-Oh! You did not get any right. The Pokemon that Lee caught this week are: ' + pokemon);
console.log('User response is ' + pokeAnswer + ' to question 6');
}

alert(userName + ', you scored a total of ' + correctAnswers + ' out of 7');
console.log(userName + 'scored a total of ' + correctAnswers + ' out of 7');
Binary file added img/headerbg.jpg
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 img/leedance.jpg
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 img/leespock.jpg
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 img/profile.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<title>About Me!</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>

<h1>Who is Lee?</h1>
<img class="profile" src="img/profile.jpg">
<p class="quiz">Hopefully you enjoyed the little Lee quiz. Now here are the facts. :D</p>
</header>
<div id="content">
<article id="overview">
<h2>Overview</h2>
<p>I've lived in the Greater Seattle area most of my life, though I was born in California. When I was an infant, my parents traveled all over the place, including to Saudi Arabia and Egypt. I'm a semi-professional Lindy Hopper, and have been dancing for the past 9+ years. I perform with teams, compete fairly often, travel, and teach occasionally. I'm a huge geek. I love most sci-fi, have an affinity for video games, and keep the occasional anime fandom. The more coding I do, the more excited I get about doing it. I'm stoked to continue learning!
</article>
<h3>Experience</h3>
<img id="spock" src="img/leespock.jpg">
<ul>
<li>Some HTML</li>
<li>Some Javascript</li>
<li>Some CSS</li>
<li>Project management</li>
<li>Flex-Box Froggie!</li>
</ul>
<h3>Hobbies</h3>
<img id="dance" src="img/leedance.jpg">
<ul>
<li>Lindy Hop!</li>
<li>Coding</li>
<li>Exercising</li>
<li>Hiking</li>
<li>Video games</li>
</ul>
<h3> Education</h3>
<ul>
<li>Codefellows 201</li>
<li>University of Washington</li>
<li>Western Washington University</li>
<li>Mariner High School</li>
</ul>
</div>
<aside>
<h3> Goals</h3>
<ul>
<li>To go through Code 201, 301 and 401</li>
<li>To become a badass coder, with a focus on Javascript</li>
<li>To potentially combine coding skills w/ project management skills</li>
<li>Work for a smaller, local company with a mission I care about</li>
</ul>
</aside>

<script src="app.js"></script>
</body>
</html>
68 changes: 68 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
body {
font-family: arial, sans-serif;
background-color: #ABF8FF;
}

header > h1 {
font-size: 60px;
margin-bottom: -5px;
margin-top: -5px;
margin-left: 20px;
}

.quiz {
width: 17%;
margin-left: 47px;
color: black;
font-weight: bold;
font-size: 20px;
}

h1, h2, h3 {
color: navy;
}

header {
width: 100%;
background-image: url("../img/headerbg.jpg");
background-size: 100%;
border: navy solid 6px;
}

.profile {
height: 200px;
width: 200px;
border-radius: 20%;
border: solid navy 5px;
margin-left: 50px;
margin-bottom: -10px;
}

#content {
float: left;
width: 75%;
}

#dance {
height: 150px;
width: 150px;
}

#spock {
height: 150px;
width: 150px;
}

#content {
margin: auto 70px;
position: relative;
}

aside {
float: right;
width: 25%;
background-color: cyan;
border: 3px blue solid;
border-radius: 15px;
margin-top: -650px;
}