From c46ad4ceffa86906eb6ef6798d7e4b4d28422927 Mon Sep 17 00:00:00 2001 From: Harold Wolfinger Date: Wed, 20 Jun 2018 20:33:40 -0400 Subject: [PATCH 01/10] Adding index.html, main.css, and the main.js file, which include alert, prompt and confirm functions. --- lab-01/index.html | 14 ++++++++++++++ lab-01/main.css | 0 lab-01/main.js | 13 +++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 lab-01/index.html create mode 100644 lab-01/main.css create mode 100644 lab-01/main.js diff --git a/lab-01/index.html b/lab-01/index.html new file mode 100644 index 0000000..db63869 --- /dev/null +++ b/lab-01/index.html @@ -0,0 +1,14 @@ + + + + + + Page Title + + + + + + "Check this out" + + \ No newline at end of file diff --git a/lab-01/main.css b/lab-01/main.css new file mode 100644 index 0000000..e69de29 diff --git a/lab-01/main.js b/lab-01/main.js new file mode 100644 index 0000000..797a548 --- /dev/null +++ b/lab-01/main.js @@ -0,0 +1,13 @@ +console.log(alert("Let\'s go")); + +let name = prompt("What\'s your name"); +console.log(name) + +let origin = prompt("Hi " + name + ". Where are you from?") +let continny = confirm(name + " to continue please press OK.") +let coder = prompt("What type of coder do you want to be?") +let months = prompt("In how many months do you want to be a " + coder + " by?") + +let msgtoyou = alert("Keep up the good work " + name + " from " + origin + ", you will be a " + coder + " in " + months + " months IF you work hard.") + +console.log(origin) \ No newline at end of file From c15af698601b147c26462203fa7184cc6eb979b5 Mon Sep 17 00:00:00 2001 From: Harold Wolfinger Date: Wed, 27 Jun 2018 21:00:30 -0400 Subject: [PATCH 02/10] Updated index.html and main.js files, which have added console.log statements, and extensive comments added to include 2 personal stretch goals. --- lab-01/index.html | 8 ++++++-- lab-01/main.js | 41 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/lab-01/index.html b/lab-01/index.html index db63869..626b5a8 100644 --- a/lab-01/index.html +++ b/lab-01/index.html @@ -6,9 +6,13 @@ Page Title - - "Check this out" +

"All About Me (The User)"

+

Here are some facts about YOU:

+
  • User Name: waiting to be entered
  • +
  • User Origin: waiting to be entered
  • +
  • Type of Coder You Aim to Become: waiting to be entered
  • + \ No newline at end of file diff --git a/lab-01/main.js b/lab-01/main.js index 797a548..671e2b4 100644 --- a/lab-01/main.js +++ b/lab-01/main.js @@ -4,10 +4,47 @@ let name = prompt("What\'s your name"); console.log(name) let origin = prompt("Hi " + name + ". Where are you from?") +console.log(origin) let continny = confirm(name + " to continue please press OK.") let coder = prompt("What type of coder do you want to be?") +console.log(coder) let months = prompt("In how many months do you want to be a " + coder + " by?") - +console.log(months) let msgtoyou = alert("Keep up the good work " + name + " from " + origin + ", you will be a " + coder + " in " + months + " months IF you work hard.") -console.log(origin) \ No newline at end of file + +if (name != null) { + document.getElementById('userName').innerText = name +} +// or document.getElementByID('blue').innerHTML + +if (origin != null) { + document.getElementById('userOrigin').innerText = origin +} +if (coder != null) { + document.getElementById('userCoder').innerText = coder +} + +// Beginnings of a personal stretch goal #1: Store the data entered by the user in an array +//let spitBack = [name, origin, coder] +// Beginnings of a personal stretch goal #2: A guessing game that the end user tries to guess a random integer between 1 and 10 generated by the computer +// Code Needed: +// 1. Generate a random integer +// 2. Ask the user for their guess +// 3. If the guess >= 1 && guess <= 10 then proceed +// 3a. If the guess != parameters, pop-up alert & go back to Step 2 +// 4. Store guess and return guess alert "You guessed x" +// 5. If guess = random integer, then "Yup! Good job!" +// 5a. If guess != random integer, "Nope, guess again. Your guess is too (high/low). +// >>>>>>> Not sure at all how to let them know the guess is too high or too low +//***end comments from June 27, 2018 ***/ +// +//Initial stab at the above (with prelude confirm box) +//let gameIntro = confirm("Before you go, let\'s play a game. Press OK to begin.") +// if gameIntro = false then { ; +// alert("Come on. Don't go. One game. Please") ; +// } +// let number = prompt("What\'s my favorite integer? To make it easier, it's between 1 and 10.") +// if number < 1 || number < 10 then { +// alert("Come on, that's not even a proper guess! Between 1 and 10!") +// } \ No newline at end of file From 57d6c47506ba4a10d4d79996ced2aef736a2b2f0 Mon Sep 17 00:00:00 2001 From: Harold Wolfinger Date: Thu, 28 Jun 2018 17:29:43 -0400 Subject: [PATCH 03/10] very excited for this commit. storing the values in 1 array rather than 4 variables now, and also added som about the creator code to the html.index file. --- lab-01/index.html | 3 +++ lab-01/main.js | 45 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/lab-01/index.html b/lab-01/index.html index 626b5a8..8a860b0 100644 --- a/lab-01/index.html +++ b/lab-01/index.html @@ -13,6 +13,9 @@

    Here are some facts about YOU:

  • User Name: waiting to be entered
  • User Origin: waiting to be entered
  • Type of Coder You Aim to Become: waiting to be entered
  • + +

    Here are some facts about the Creator of this site:

    +
  • My name is Harold, and I'm from Virginia. I want to become a JavaScript Software Engineer in the next eight months.
  • \ No newline at end of file diff --git a/lab-01/main.js b/lab-01/main.js index 671e2b4..e30a4f9 100644 --- a/lab-01/main.js +++ b/lab-01/main.js @@ -1,5 +1,46 @@ console.log(alert("Let\'s go")); +// create a function to store the scope of (i) creating an array, and (ii) the values assigned to the array, to facilitate accessing those values so the program can concatenate a string at the end of the function +// NOTE: this turned out to be unnecessary. the original errors that i was running into was because i used multiple let statements, and you CANNOT declare a variable multiple times. The fix was to eliminate the the let statements, and just have aboutUser[x] = (reassigning the value) + +// Create an array to hold--what was previously--the separate variables name, origin, coder, and months + +let aboutUser = ["name", "origin", "coder", "months"] ; + +// Populate the array using four var statements that correspond to name, origin, coder, and months + +aboutUser[0] = prompt("What\'s your name") ; +console.log(aboutUser[0]) + +aboutUser[1] = prompt("Hi " + aboutUser[0] + ". Where are you from?") ; +console.log(aboutUser[1]) + +let continny = confirm(aboutUser[0] + " to continue please press OK.") ; + +aboutUser[2] = prompt("What type of coder do you want to be?") ; +console.log(aboutUser[2]) + +aboutUser[3] = prompt("In how many months do you want to be a " + aboutUser[2] + " by?") ; +console.log(aboutUser[3]) + +// concatenate a string using the four values stored in the area and display it as a msg in a JavaScript box + +let msgtoyou = alert("Keep up the good work " + aboutUser[0] + " from " + aboutUser[1] + ", you will be a " + aboutUser[2] + " in " + aboutUser[3] + " months if you work hard.") ; + +// + +if (aboutUser[0] != null) { + document.getElementById('userName').innerText = aboutUser[0] +} + +if (aboutUser[1] != null) { + document.getElementById('userOrigin').innerText = aboutUser[1] +} +if (aboutUser[2] != null) { + document.getElementById('userCoder').innerText = aboutUser[2] +} + +/* June 28, 2018 note - Below is the prior iteration of code with separate variables let name = prompt("What\'s your name"); console.log(name) @@ -23,7 +64,9 @@ if (origin != null) { } if (coder != null) { document.getElementById('userCoder').innerText = coder -} +}*/ + + // Beginnings of a personal stretch goal #1: Store the data entered by the user in an array //let spitBack = [name, origin, coder] From 98e297bc93867e9e8cca1fe67d43646f556057fc Mon Sep 17 00:00:00 2001 From: Harold Wolfinger Date: Thu, 28 Jun 2018 21:06:18 -0400 Subject: [PATCH 04/10] Added a CAPTCHA check that utilizes a while loop, an additional final question that utilizes an if-then-else statement, and enhanced the page with a separate .css file. --- lab-01/index.html | 29 ++++++++++++++++++++---- lab-01/main.css | 29 ++++++++++++++++++++++++ lab-01/main.js | 58 ++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 104 insertions(+), 12 deletions(-) diff --git a/lab-01/index.html b/lab-01/index.html index 8a860b0..66002ad 100644 --- a/lab-01/index.html +++ b/lab-01/index.html @@ -9,13 +9,34 @@

    "All About Me (The User)"

    -

    Here are some facts about YOU:

    -
  • User Name: waiting to be entered
  • -
  • User Origin: waiting to be entered
  • -
  • Type of Coder You Aim to Become: waiting to be entered
  • +

    Here are some facts about YOU:

    +
  • User Name: waiting to be entered
  • +
  • User Origin: waiting to be entered
  • +
  • Type of Coder You Aim to Become: waiting to be entered
  • +
  • Why You Want to Become a Coder: waiting to be entered
  • Here are some facts about the Creator of this site:

  • My name is Harold, and I'm from Virginia. I want to become a JavaScript Software Engineer in the next eight months.
  • + +

    I love connecting with folks, so if you want to get in contact, feel free to hit me up on github or LinkedIn

    +
    + +

    Here are the top 10 things I'm enjoying about CodePartners

    +
      +
    1. The structure of the class - really helpful to come in the evenings, and meeting (nearly) every day is realy helpful. We usually end on a preview of the next day's material, which is great. I love how Zach and Davis (see below) are reinforcing the content we learn and giving us 1-on-1 assistance.
    2. +
    3. The content - we've only taken baby steps but they are 'giant' baby steps for someone with no experience like me
    4. +
    5. The people taking the class: yes, here's looking at you Karrim, Patrice, Jayne, Joseph, Brittany, Adrian, George, Jahlal, Mandana, Dan and Ishmael
    6. +
    7. The instructors: Zach is pretty awesome, dude has worked for a bunch of startups and is really trying to prep us for whatever path we want to take
    8. +
    9. The instructors (cont.): Davis is a genius, really cool guy (true story: i asked about the difference between caffeine and sugar and he began explaining how the body breaks down ATP for energy and it's relation to sleep like it was nothing)
    10. +
    11. The location: Bethesda is pretty convenient
    12. +
    13. DAI: I had never heard of DAI, the place does some amazing work and everyone i've met so far is cool
    14. +
    15. John: Cannot forget the Code 102 instructor, guy really helped prepare us for Code 201, very nice guy
    16. +
    17. MEI!!!! Mei is awesome, and really trying to help us out
    18. +
    19. Doug!! Doug is the CEO of CodePartners and is rolling out the stops for all of us in the inaugural cohort, he's really making us feel like we are going to succeed
    20. +
    21. David Nguyen: I've never met this guy, but he's the co-founder of CodePartners, so i got to shout him out here, THANK YOU (ps. and he's into the blockchain, which is awesome)
    22. +
    23. BONUS : The coffee machine in the break area +
    + \ No newline at end of file diff --git a/lab-01/main.css b/lab-01/main.css index e69de29..93ac70f 100644 --- a/lab-01/main.css +++ b/lab-01/main.css @@ -0,0 +1,29 @@ +body { + background-color: rgb(71, 68, 68) ; + font-family: Arial, sans-serif; color: white; font-size: 16px ; +} + +h2 { + font-family: Arial, sans-serif; color: rgb(15, 238, 15); font-size: 28px ; + font-weight: bolder +} + +h3 { + font-family: Arial, sans-serif; color: white; font-size: 24px ; + font-weight: bold +} + +h4 { + font-family: Arial, sans-serif; color: rgb(236, 92, 9); font-size: 24px ; + font-weight: bold +} + + +.userColorDisplay { + font-family: Arial, sans-serif; color: rgb(232, 236, 9); font-size: 24px ; + font-weight: bold +} + +elementYOU { + color: deeppink +} diff --git a/lab-01/main.js b/lab-01/main.js index e30a4f9..9f8b29d 100644 --- a/lab-01/main.js +++ b/lab-01/main.js @@ -1,44 +1,86 @@ console.log(alert("Let\'s go")); +// CAPTCHA test + +let tchalla = prompt('To verify you are a human, please enter "tchalla" in the box.') ; +console.log("tchalla first ask: " + tchalla) +while (tchalla != "tchalla") { + tchalla = prompt('To verify you are a human, please enter "tchalla" in the box.') + console.log("tchalla while loop ask: " + tchalla) +} + +/*if (tchalla = "tchalla") { + console.log(alert("Ok, terrific! Let\'s go!")) ; +} else { + while (tchalla != "tchalla") { + tchalla = prompt('To verify you are a human, please enter "tchalla" in the box.') ; + } +}*/ + // create a function to store the scope of (i) creating an array, and (ii) the values assigned to the array, to facilitate accessing those values so the program can concatenate a string at the end of the function -// NOTE: this turned out to be unnecessary. the original errors that i was running into was because i used multiple let statements, and you CANNOT declare a variable multiple times. The fix was to eliminate the the let statements, and just have aboutUser[x] = (reassigning the value) +// NOTE: this (above) turned out to be unnecessary. the original errors that i was running into was because i used multiple let statements, and you CANNOT declare a variable multiple times. The fix was to eliminate the the let statements, and just have aboutUser[x] = (reassigning the value) // Create an array to hold--what was previously--the separate variables name, origin, coder, and months -let aboutUser = ["name", "origin", "coder", "months"] ; +let aboutUser = ["name", "origin", "coder", "months", "why"] ; // Populate the array using four var statements that correspond to name, origin, coder, and months aboutUser[0] = prompt("What\'s your name") ; -console.log(aboutUser[0]) +console.log("User name: " + aboutUser[0]) aboutUser[1] = prompt("Hi " + aboutUser[0] + ". Where are you from?") ; -console.log(aboutUser[1]) +console.log("User origin: " + aboutUser[1]) let continny = confirm(aboutUser[0] + " to continue please press OK.") ; aboutUser[2] = prompt("What type of coder do you want to be?") ; -console.log(aboutUser[2]) +console.log("User type of coder becoming: " + aboutUser[2]) aboutUser[3] = prompt("In how many months do you want to be a " + aboutUser[2] + " by?") ; -console.log(aboutUser[3]) +console.log("User desired months to become " + aboutUser[2] + ": " + aboutUser[3]) // concatenate a string using the four values stored in the area and display it as a msg in a JavaScript box let msgtoyou = alert("Keep up the good work " + aboutUser[0] + " from " + aboutUser[1] + ", you will be a " + aboutUser[2] + " in " + aboutUser[3] + " months if you work hard.") ; -// +// just when you thought it was over ... one more !!! +// additional insight: for a nice stretch goal, learn to create a custom alert box, because as it stands now, you cannot make the "why" italicized (or bold) since it isn't rendered in HTML + +aboutUser[4] = prompt("Before we go, one more question " + aboutUser[0] + ", why do you want to become a " +aboutUser[2] + "?") +console.log("First ask of Why: ", aboutUser[4]) + +// this is an if-then-else statement, taking the answer to the final Why question. please notice the condition! Originally, this line wasn't working properly for a few reasons: (i) i wasn't using a strict check, which it needs ===, i was using = which is to assign; also, (ii) i had the "WOW..." alert as the if statement when it should have been the else statement. + +if (aboutUser[4] === "") { + alert("I don't see a why. A clear why can be a powerful aid when things get tough.") +} else { + alert("WOW, " + aboutUser[0] + " that's a tremendous why. Keep that in mind and good luck!") +} + +/* A simpler way may be to check the length. Remember, strings are array-like objects. So to check the length of the string, use the code below. + +if (aboutUser[4].length === 0) { + alert("I don't see a why. A clear why can be a powerful aid when things get tough.") +} else { + alert("WOW, " + aboutUser[0] + " that's a tremendous why. Keep that in mind and good luck!") +} */ + + +// This is how we are getting the information from JavaScript question boxes back onto the index.html page if (aboutUser[0] != null) { document.getElementById('userName').innerText = aboutUser[0] } - if (aboutUser[1] != null) { document.getElementById('userOrigin').innerText = aboutUser[1] } if (aboutUser[2] != null) { document.getElementById('userCoder').innerText = aboutUser[2] } +if (aboutUser[4] != null) { + document.getElementById('userWhy').innerText = aboutUser[4] +} /* June 28, 2018 note - Below is the prior iteration of code with separate variables let name = prompt("What\'s your name"); From 116f909120d1fc48e35766fa3d08d9c834cb3702 Mon Sep 17 00:00:00 2001 From: Harold Wolfinger Date: Thu, 28 Jun 2018 23:07:07 -0400 Subject: [PATCH 05/10] Made adjustments to the 'top 10' box: (i) added background color, (ii) changed font color, and (iii) changed the width of the box enclosing the list. Also commented out some code that wasn't working properly (had tried to add in a question for a nickname, but i think because i tried to add it to the end of the array despite being the 2nd question, there were some errors. --- lab-01/index.html | 43 ++++++++++++++++++++++--------------------- lab-01/main.css | 30 +++++++++++++++++++++++++----- lab-01/main.js | 13 +++++++++++-- 3 files changed, 58 insertions(+), 28 deletions(-) diff --git a/lab-01/index.html b/lab-01/index.html index 66002ad..7d9b6cd 100644 --- a/lab-01/index.html +++ b/lab-01/index.html @@ -8,34 +8,35 @@ -

    "All About Me (The User)"

    -

    Here are some facts about YOU:

    +

    So you've played the game, what did you think? Did i get this right?

    +

    "All About me (The User)"

    +

    Here are some facts about YOU:

  • User Name: waiting to be entered
  • User Origin: waiting to be entered
  • Type of Coder You Aim to Become: waiting to be entered
  • -
  • Why You Want to Become a Coder: waiting to be entered
  • +
  • Why You Want to Become a Coder: waiting to be entered
  • Here are some facts about the Creator of this site:

    -
  • My name is Harold, and I'm from Virginia. I want to become a JavaScript Software Engineer in the next eight months.
  • +
  • My name is Harold, and I'm from Virginia. I want to become a JavaScript Software Engineer in the next eight months. Why? It's challenging and it's not dull, and I love learning new things.
  • + +

    I also love connecting with folks, so if you want to get in contact, feel free to hit me up on github or LinkedIn

    -

    I love connecting with folks, so if you want to get in contact, feel free to hit me up on github or LinkedIn

    -
    -

    Here are the top 10 things I'm enjoying about CodePartners

    -
      -
    1. The structure of the class - really helpful to come in the evenings, and meeting (nearly) every day is realy helpful. We usually end on a preview of the next day's material, which is great. I love how Zach and Davis (see below) are reinforcing the content we learn and giving us 1-on-1 assistance.
    2. -
    3. The content - we've only taken baby steps but they are 'giant' baby steps for someone with no experience like me
    4. -
    5. The people taking the class: yes, here's looking at you Karrim, Patrice, Jayne, Joseph, Brittany, Adrian, George, Jahlal, Mandana, Dan and Ishmael
    6. -
    7. The instructors: Zach is pretty awesome, dude has worked for a bunch of startups and is really trying to prep us for whatever path we want to take
    8. -
    9. The instructors (cont.): Davis is a genius, really cool guy (true story: i asked about the difference between caffeine and sugar and he began explaining how the body breaks down ATP for energy and it's relation to sleep like it was nothing)
    10. -
    11. The location: Bethesda is pretty convenient
    12. -
    13. DAI: I had never heard of DAI, the place does some amazing work and everyone i've met so far is cool
    14. -
    15. John: Cannot forget the Code 102 instructor, guy really helped prepare us for Code 201, very nice guy
    16. -
    17. MEI!!!! Mei is awesome, and really trying to help us out
    18. -
    19. Doug!! Doug is the CEO of CodePartners and is rolling out the stops for all of us in the inaugural cohort, he's really making us feel like we are going to succeed
    20. -
    21. David Nguyen: I've never met this guy, but he's the co-founder of CodePartners, so i got to shout him out here, THANK YOU (ps. and he's into the blockchain, which is awesome)
    22. -
    23. BONUS : The coffee machine in the break area -
    +

    Here are the top 10 things I'm enjoying about CodePartners

    +

      +
    1. The structure of the class - it's helpful to come in the evenings, and meeting (nearly) every day is really helpful. We usually end class previewing the next day's material, which is great. I love how Zach and Davis (see below) are reinforcing the content we learn and giving us 1-on-1 assistance.
    2. +
    3. The content - we've only taken baby steps but they are 'giant' baby steps for someone with no experience like me.
    4. +
    5. The people taking the class: yes, here's looking at you Karrim, Patrice, Jayne, Joseph, Brittany, Adrian, George, Jahlal, Mandana, Dan and Ishmael. It's a lot of fun learning in a group.
    6. +
    7. The instructors: Zach is pretty awesome, dude has worked for a bunch of startups and is really trying to prep us for whatever path we want to take. He's also willing to come in early or stay late when we need extra assistance.
    8. +
    9. The instructors (cont.): Davis is a genius, really cool guy (true story: i asked about the difference between caffeine and sugar and he began explaining how the body breaks down ATP for energy and it's relation to sleep like it was nothing).
    10. +
    11. The location: Bethesda is pretty convenient, and summertime is great because it's not super dark when we get out.
    12. +
    13. DAI: I had never heard of DAI before CodePartners. The place does some amazing work and everyone i've met so far is cool.
    14. +
    15. John: Cannot forget the Code 102 instructor, we all had a great time and he really helped prepare us for Code 201, very nice guy.
    16. +
    17. MEI!!!! Mei is awesome, and really trying to help us out. She also hooked us up.
    18. +
    19. Doug!! Doug is the CEO of CodePartners and is rolling out the stops for all of us in the inaugural cohort, he's really making us feel like we are going to succeed.
    20. +
    21. David Nguyen: I've never met this guy, but he's the co-founder of CodePartners, so i got to shout him out here, THANK YOU (ps. and he's into the blockchain, which is awesome).
    22. +
    23. BONUS : The coffee machine in the break area. I didn't even drink the stuff before, but i am starting to get hooked.
    24. +
    diff --git a/lab-01/main.css b/lab-01/main.css index 93ac70f..d34c628 100644 --- a/lab-01/main.css +++ b/lab-01/main.css @@ -1,21 +1,31 @@ body { background-color: rgb(71, 68, 68) ; font-family: Arial, sans-serif; color: white; font-size: 16px ; + padding: 8px ; +} + +h1 { + font-family: 'Courier New', Courier, monospace; color: rgb(58, 9, 236); font-size: 36px ; + font-weight: bold ; + padding: 24px ; } h2 { font-family: Arial, sans-serif; color: rgb(15, 238, 15); font-size: 28px ; - font-weight: bolder + font-weight: bolder ; + padding: 20px ; } h3 { font-family: Arial, sans-serif; color: white; font-size: 24px ; - font-weight: bold + font-weight: bold ; + padding: 16px ; } h4 { font-family: Arial, sans-serif; color: rgb(236, 92, 9); font-size: 24px ; - font-weight: bold + font-weight: bold ; + padding: 16px ; } @@ -24,6 +34,16 @@ h4 { font-weight: bold } -elementYOU { - color: deeppink +.elementYOU { + color: deeppink ; } + +#topTen { + background: rgb(175, 174, 174) ; + color: blueviolet ; + width: 65% ; +} + +#listingItAll { + font-size: 20px +} \ No newline at end of file diff --git a/lab-01/main.js b/lab-01/main.js index 9f8b29d..c57f2a7 100644 --- a/lab-01/main.js +++ b/lab-01/main.js @@ -22,13 +22,17 @@ while (tchalla != "tchalla") { // Create an array to hold--what was previously--the separate variables name, origin, coder, and months -let aboutUser = ["name", "origin", "coder", "months", "why"] ; +let aboutUser = ["name", "origin", "coder", "months", "why", "nickname"] ; // Populate the array using four var statements that correspond to name, origin, coder, and months -aboutUser[0] = prompt("What\'s your name") ; +aboutUser[0] = prompt("What\'s your name?") ; console.log("User name: " + aboutUser[0]) +/* aboutUser[5] = prompt("Cool " + aboutUser[0] + ". What about a nickname?") ; +console.log("User nickname: " + aboutUser[5]) +i was going to add a nickname prompt*/ + aboutUser[1] = prompt("Hi " + aboutUser[0] + ". Where are you from?") ; console.log("User origin: " + aboutUser[1]) @@ -81,6 +85,11 @@ if (aboutUser[2] != null) { if (aboutUser[4] != null) { document.getElementById('userWhy').innerText = aboutUser[4] } +/*if (aboutUser[5] != null) { + document.getElementById('userWhy').innerText = aboutUser[5] +} +this was to go with the nickname prompt */ + /* June 28, 2018 note - Below is the prior iteration of code with separate variables let name = prompt("What\'s your name"); From d45edafd038df7ff3115728e4b0b6dfa1b8c2695 Mon Sep 17 00:00:00 2001 From: Harold Wolfinger Date: Fri, 29 Jun 2018 00:13:09 -0400 Subject: [PATCH 06/10] Minor changes to the index.html and main.css files to add borders and shading to various sections. --- lab-01/index.html | 9 ++++++--- lab-01/main.css | 8 +++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lab-01/index.html b/lab-01/index.html index 7d9b6cd..1ad3ab4 100644 --- a/lab-01/index.html +++ b/lab-01/index.html @@ -8,7 +8,7 @@ -

    So you've played the game, what did you think? Did i get this right?

    +

    So you've played the game, what did you think?
    Did i get this right?

    "All About me (The User)"

    Here are some facts about YOU:

  • User Name: waiting to be entered
  • @@ -17,9 +17,12 @@

    Here are some facts about Why You Want to Become a Coder: waiting to be entered

    Here are some facts about the Creator of this site:

    -
  • My name is Harold, and I'm from Virginia. I want to become a JavaScript Software Engineer in the next eight months. Why? It's challenging and it's not dull, and I love learning new things.
  • +
  • My name is Harold, and I'm from Virginia.
  • +
  • I want to become a JavaScript Software Engineer in the next eight months.
  • +
  • Why? It's challenging and it's not dull, and I love learning new things.
  • +
    -

    I also love connecting with folks, so if you want to get in contact, feel free to hit me up on github or LinkedIn

    +

    I also love connecting with folks, so if you want to get in contact, feel free to hit me up on github or LinkedIn

    Here are the top 10 things I'm enjoying about CodePartners

    diff --git a/lab-01/main.css b/lab-01/main.css index d34c628..885cbb5 100644 --- a/lab-01/main.css +++ b/lab-01/main.css @@ -38,12 +38,18 @@ h4 { color: deeppink ; } +#contactMe { + background: rgb(192, 192, 250) ; + border: 12px solid blue ; +} + #topTen { background: rgb(175, 174, 174) ; color: blueviolet ; width: 65% ; + border: 6px ridge red ; } #listingItAll { - font-size: 20px + font-size: 20px ; } \ No newline at end of file From 535584f02c2211df6347e4dd81c569cca682ca04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98Brittany?= Date: Sat, 30 Jun 2018 14:11:48 -0400 Subject: [PATCH 07/10] create branch --- lab-01/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lab-01/main.js b/lab-01/main.js index c57f2a7..c39ea61 100644 --- a/lab-01/main.js +++ b/lab-01/main.js @@ -1,6 +1,7 @@ console.log(alert("Let\'s go")); // CAPTCHA test +// hi let tchalla = prompt('To verify you are a human, please enter "tchalla" in the box.') ; console.log("tchalla first ask: " + tchalla) From 633244090ac5f5db329e1d4a47be83089234c2c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98Brittany?= Date: Sat, 30 Jun 2018 15:11:54 -0400 Subject: [PATCH 08/10] fixing Harold's code --- lab-01/main.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lab-01/main.js b/lab-01/main.js index c39ea61..313fec5 100644 --- a/lab-01/main.js +++ b/lab-01/main.js @@ -1,7 +1,6 @@ console.log(alert("Let\'s go")); // CAPTCHA test -// hi let tchalla = prompt('To verify you are a human, please enter "tchalla" in the box.') ; console.log("tchalla first ask: " + tchalla) @@ -23,12 +22,20 @@ while (tchalla != "tchalla") { // Create an array to hold--what was previously--the separate variables name, origin, coder, and months +// let questions = ["What\'s your name?", ] let aboutUser = ["name", "origin", "coder", "months", "why", "nickname"] ; // Populate the array using four var statements that correspond to name, origin, coder, and months -aboutUser[0] = prompt("What\'s your name?") ; -console.log("User name: " + aboutUser[0]) +let userName = function() { + aboutUser[0] = prompt("What\'s your name?") ; + console.log("User name: " + aboutUser[0]) +} + +userName(); + +// aboutUser[0] = prompt("What\'s your name?") ; +// console.log("User name: " + aboutUser[0]) /* aboutUser[5] = prompt("Cool " + aboutUser[0] + ". What about a nickname?") ; console.log("User nickname: " + aboutUser[5]) From 692fc291677ea198eedb93a0da00df79066d2a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98Brittany?= Date: Sat, 30 Jun 2018 15:27:16 -0400 Subject: [PATCH 09/10] added all functions --- lab-01/main.js | 76 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 17 deletions(-) diff --git a/lab-01/main.js b/lab-01/main.js index 313fec5..2d2ef58 100644 --- a/lab-01/main.js +++ b/lab-01/main.js @@ -27,12 +27,54 @@ let aboutUser = ["name", "origin", "coder", "months", "why", "nickname"] ; // Populate the array using four var statements that correspond to name, origin, coder, and months -let userName = function() { +let userNameFunction = function() { aboutUser[0] = prompt("What\'s your name?") ; console.log("User name: " + aboutUser[0]) } -userName(); +let userOriginFunction = function() { + aboutUser[1] = prompt("Hi " + aboutUser[0] + ". Where are you from?") ; + console.log("User origin: " + aboutUser[1]) +} + +let continnyFunction = function() { + let continny = confirm(aboutUser[0] + " to continue please press OK.") ; +} + +let coderTypeFunction = function() { + aboutUser[2] = prompt("What type of coder do you want to be?") ; + console.log("User type of coder becoming: " + aboutUser[2]) +} + +let timeToCoderFunction = function() { + aboutUser[3] = prompt("In how many months do you want to be a " + aboutUser[2] + " by?") ; + console.log("User desired months to become " + aboutUser[2] + ": " + aboutUser[3]) +} + +let msgToUserFunction = function () { + let msgtoyou = alert("Keep up the good work " + aboutUser[0] + " from " + aboutUser[1] + ", you will be a " + aboutUser[2] + " in " + aboutUser[3] + " months if you work hard.") ; +} + +let usersWhy = function() { + aboutUser[4] = prompt("Before we go, one more question " + aboutUser[0] + ", why do you want to become a " + aboutUser[2] + "?") + console.log("First ask of Why: ", aboutUser[4]) + + if (aboutUser[4] === "") { + alert("I don't see a why. A clear why can be a powerful aid when things get tough.") + } else { + alert("WOW, " + aboutUser[0] + " that's a tremendous why. Keep that in mind and good luck!") + } +} + + +userNameFunction(); +userOriginFunction(); +continnyFunction(); +coderTypeFunction(); +timeToCoderFunction(); +msgToUserFunction(); +usersWhy(); + // aboutUser[0] = prompt("What\'s your name?") ; // console.log("User name: " + aboutUser[0]) @@ -41,34 +83,34 @@ userName(); console.log("User nickname: " + aboutUser[5]) i was going to add a nickname prompt*/ -aboutUser[1] = prompt("Hi " + aboutUser[0] + ". Where are you from?") ; -console.log("User origin: " + aboutUser[1]) +// aboutUser[1] = prompt("Hi " + aboutUser[0] + ". Where are you from?") ; +// console.log("User origin: " + aboutUser[1]) -let continny = confirm(aboutUser[0] + " to continue please press OK.") ; +// let continny = confirm(aboutUser[0] + " to continue please press OK.") ; -aboutUser[2] = prompt("What type of coder do you want to be?") ; -console.log("User type of coder becoming: " + aboutUser[2]) +// aboutUser[2] = prompt("What type of coder do you want to be?") ; +// console.log("User type of coder becoming: " + aboutUser[2]) -aboutUser[3] = prompt("In how many months do you want to be a " + aboutUser[2] + " by?") ; -console.log("User desired months to become " + aboutUser[2] + ": " + aboutUser[3]) +// aboutUser[3] = prompt("In how many months do you want to be a " + aboutUser[2] + " by?") ; +// console.log("User desired months to become " + aboutUser[2] + ": " + aboutUser[3]) // concatenate a string using the four values stored in the area and display it as a msg in a JavaScript box -let msgtoyou = alert("Keep up the good work " + aboutUser[0] + " from " + aboutUser[1] + ", you will be a " + aboutUser[2] + " in " + aboutUser[3] + " months if you work hard.") ; +// let msgtoyou = alert("Keep up the good work " + aboutUser[0] + " from " + aboutUser[1] + ", you will be a " + aboutUser[2] + " in " + aboutUser[3] + " months if you work hard.") ; // just when you thought it was over ... one more !!! // additional insight: for a nice stretch goal, learn to create a custom alert box, because as it stands now, you cannot make the "why" italicized (or bold) since it isn't rendered in HTML -aboutUser[4] = prompt("Before we go, one more question " + aboutUser[0] + ", why do you want to become a " +aboutUser[2] + "?") -console.log("First ask of Why: ", aboutUser[4]) +// aboutUser[4] = prompt("Before we go, one more question " + aboutUser[0] + ", why do you want to become a " +aboutUser[2] + "?") +// console.log("First ask of Why: ", aboutUser[4]) // this is an if-then-else statement, taking the answer to the final Why question. please notice the condition! Originally, this line wasn't working properly for a few reasons: (i) i wasn't using a strict check, which it needs ===, i was using = which is to assign; also, (ii) i had the "WOW..." alert as the if statement when it should have been the else statement. -if (aboutUser[4] === "") { - alert("I don't see a why. A clear why can be a powerful aid when things get tough.") -} else { - alert("WOW, " + aboutUser[0] + " that's a tremendous why. Keep that in mind and good luck!") -} +// if (aboutUser[4] === "") { +// alert("I don't see a why. A clear why can be a powerful aid when things get tough.") +//} else { +// alert("WOW, " + aboutUser[0] + " that's a tremendous why. Keep that in mind and good luck!") +// } /* A simpler way may be to check the length. Remember, strings are array-like objects. So to check the length of the string, use the code below. From f5702017389c4c723bd7c61c3e443f3f8d254fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98Brittany?= Date: Sat, 30 Jun 2018 15:29:53 -0400 Subject: [PATCH 10/10] added comments --- lab-01/index.html | 1 + lab-01/main.css | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lab-01/index.html b/lab-01/index.html index 1ad3ab4..c8c1db9 100644 --- a/lab-01/index.html +++ b/lab-01/index.html @@ -1,4 +1,5 @@ + diff --git a/lab-01/main.css b/lab-01/main.css index 885cbb5..9e807ee 100644 --- a/lab-01/main.css +++ b/lab-01/main.css @@ -1,3 +1,5 @@ +/* brittany is better at this */ + body { background-color: rgb(71, 68, 68) ; font-family: Arial, sans-serif; color: white; font-size: 16px ;