These are chat archives for FreeCodeCamp/HelpFrontEnd

17th
Sep 2017
Maria Theresa Arruda
@arrudamt
Sep 17 2017 00:01 UTC
@gothamknight text-align didn't help, but could fix it after you mention col-xs-8
https://codepen.io/arrudamt/full/QMRaZm/
@gothamknight thanks a lot! =)
CamperBot
@camperbot
Sep 17 2017 00:01 UTC
arrudamt sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 429 | @gothamknight |http://www.freecodecamp.com/gothamknight
Ken Haduch
@khaduch
Sep 17 2017 00:18 UTC
@BrianWilliams28 - that is true, but in this case the parenthesized groups are used just to partition the expression into different portions - like the one that I posted grouped the two different matching expressions into one group, so it would be either the \(\d{3}\) that would match for a three-digit group delimited by literal parentheses, or the \d{3} - a three-digit group without parentheses. The matches are also saved, but that is just a side-effect in this case, not useful for anything else.
Miguel T Rivera
@mtrivera
Sep 17 2017 02:27 UTC
Need help with simon game. For some reason, it doesn't work on codepen.io but it runs fine on my local machine.
https://codepen.io/mtrivera/pen/wqpZZZ
Gersho
@Gersho
Sep 17 2017 02:28 UTC
it seems to work for me
Miguel T Rivera
@mtrivera
Sep 17 2017 02:32 UTC
Do the sounds work? On codepen it doesn't for me, but locally on my computer they work.
Gersho
@Gersho
Sep 17 2017 02:32 UTC
i had sound yes
did you disable sound on your browser maybe ?
Miguel T Rivera
@mtrivera
Sep 17 2017 02:35 UTC
No, it works in Firefox but not Chrome
Ken Haduch
@khaduch
Sep 17 2017 02:35 UTC
@mtrivera - it is working, at least somewhat. I'm hearing sounds, the lights are changing. The behaviour doesn't seem to be quite what I was expecting, but it is functioning insofar as lights and sounds
Gersho
@Gersho
Sep 17 2017 02:37 UTC
it seem to forget it's own combination over time or something
Miguel T Rivera
@mtrivera
Sep 17 2017 02:40 UTC
Thanks @Gersho @khaduch
@Gersho Can you elaborate?
CamperBot
@camperbot
Sep 17 2017 02:40 UTC
mtrivera sends brownie points to @gersho and @khaduch :sparkles: :thumbsup: :sparkles:
:cookie: 429 | @gersho |http://www.freecodecamp.com/gersho
:star2: 3293 | @khaduch |http://www.freecodecamp.com/khaduch
Gersho
@Gersho
Sep 17 2017 02:41 UTC
it's hard to explain exactly, but after a loss (the count doesn't reset btw) it displayed blue, i clicked blue, then it displayed only red, i i click red, then red folowed by a second color
but it's like it forgot about blue
Miguel T Rivera
@mtrivera
Sep 17 2017 02:48 UTC
ah ok
David
@deitcode
Sep 17 2017 04:19 UTC
Hi, does anyone know if it's okay to use bootstrap col classes by themselves without rows or containers? I was just looking at a project with a floated box with class col-xs-4 but it's not in a row and there are no other columns.
Fredrik Strand Oseberg
@FredrikOseberg
Sep 17 2017 05:20 UTC
Ok dropbox just screwed me with public links. Anyone else know a good convenient image storage service ?
Johnny
@jtan3
Sep 17 2017 05:41 UTC
@FredrikOseberg you can try https://postimages.org/
alpox
@alpox
Sep 17 2017 05:41 UTC
@FredrikOseberg You can simply use github
Fredrik Strand Oseberg
@FredrikOseberg
Sep 17 2017 05:44 UTC
@alpox To link to from a site like codepen?
Johnny
@jtan3
Sep 17 2017 05:53 UTC
@FredrikOseberg are you uploading images from your computer and putting them in codepen?
Fredrik Strand Oseberg
@FredrikOseberg
Sep 17 2017 05:55 UTC
@jtan3 No I was using dropbox and linking to the images from codepen with a public dropbox url. Changes to dropbox public folder deleted all of those urls, so they didn’t work anymore. I fixed it for now, generating new urls for each and every image.. Such a pain
Ahmed raza
@Raza403
Sep 17 2017 07:30 UTC
@Raza403
Can someone give me link to FCC's beta sass challenges
Like this one of react http://hysterical-amusement.surge.sh/
cowCrazy
@cowCrazy
Sep 17 2017 13:05 UTC
Asking out of curiosity, did anyone had problems with setInterval/setTimeout for the pomodoro clock project and the natural behavior of the browsers to ignore them while tab is out of focus?
Ian Gracia
@iangracia
Sep 17 2017 13:09 UTC
function dropElements(arr, func) {
  // Drop them elements.

  var newArr = [];


  for (var i=0; i<=arr.length; i++) {
    if (func(arr[i])) {
      newArr.push(i);
    }
  }



  return newArr;
}

dropElements([1, 2, 3, 4], function(n) {return n >= 4;});
I feel like such a moron, but can someone please explain why this is returning "[3]" and not "[4]"?
Václav Fojta
@VaclavF
Sep 17 2017 13:09 UTC
https://codepen.io/VaclavFojta/pen/vmJLvy?editors=0011
why do i alway get mixed status? what can i do about that?
cowCrazy
@cowCrazy
Sep 17 2017 13:15 UTC
@iangracia you need to do newArr.push(arr[i]) instead
CamperBot
@camperbot
Sep 17 2017 13:15 UTC
cowcrazy sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 326 | @iangracia |http://www.freecodecamp.com/iangracia
Ian Gracia
@iangracia
Sep 17 2017 13:15 UTC
@cowCrazy of course, thanks
CamperBot
@camperbot
Sep 17 2017 13:15 UTC
iangracia sends brownie points to @cowcrazy :sparkles: :thumbsup: :sparkles:
:cookie: 344 | @cowcrazy |http://www.freecodecamp.com/cowcrazy
cowCrazy
@cowCrazy
Sep 17 2017 13:16 UTC
@iangracia and enjoy you brownie ;)
Ian Gracia
@iangracia
Sep 17 2017 13:17 UTC
@cowCrazy you too lmao
cowCrazy
@cowCrazy
Sep 17 2017 13:19 UTC
@VaclavF you want the lines which are online/offline to disappear when you click the opposite button?
amare16
@amare16
Sep 17 2017 13:36 UTC
hi all, someone can suggest me which free host is better? I want to my file to put online
cowCrazy
@cowCrazy
Sep 17 2017 13:37 UTC
@amare16 host for what? a simple webpage?
amare16
@amare16
Sep 17 2017 13:38 UTC
@cowCrazy yes, specially i want github host because my file is on github.
cowCrazy
@cowCrazy
Sep 17 2017 13:47 UTC
@amare16 this guy seems to give you a guide to do set it on github
Ian Gracia
@iangracia
Sep 17 2017 14:01 UTC
How to find motivation when everyone seems to understand challenges and you have no idea what you are doing?
cowCrazy
@cowCrazy
Sep 17 2017 14:07 UTC
define everyone..... scroll upwards and you would see many questions, some more simple than yours some more complex.... try a challenge a couple of times, if you can't solve it I would suggest try and use the hints attached to it, if then not, read the docs of the hints and make sure you can work with the given hints, then try again if still not working put it aside work on other things then come back to it a day or two later, still not then ask here :)
you would see you asks less questions, and the more you understand the hints you can start help other people here :)
cowCrazy
@cowCrazy
Sep 17 2017 14:20 UTC
@iangracia hope that helps! and I hope you will find the motivation to continue with this great community :)
CamperBot
@camperbot
Sep 17 2017 14:20 UTC
cowcrazy sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 332 | @iangracia |http://www.freecodecamp.com/iangracia
korzo
@korzo
Sep 17 2017 14:21 UTC
@iangracia it comes with experience. Even if you know the language doesn't mean you can solve any problem in a minute.
As @cowCrazy suggest, try it yourself few times, then take a look at hints. If it doesn't help, take a look at others' people solutions (google it or open fcc profiles and seek challenge name). Read the code and try to understand it. It's not cheating as long as you understand what are you doing. Then solve challenge or skip it. Reading code is the best way to learn. Just don't waste to much time with one challenge. I saw people spent 2 weeks with one challenge. It's insane.
CamperBot
@camperbot
Sep 17 2017 14:21 UTC
korzo sends brownie points to @iangracia and @cowcrazy :sparkles: :thumbsup: :sparkles:
cowCrazy
@cowCrazy
Sep 17 2017 14:21 UTC
@iangracia CamperBot also sees the need to motivate you and sends you lots of brownies today lmao
CamperBot
@camperbot
Sep 17 2017 14:21 UTC
:cookie: 333 | @iangracia |http://www.freecodecamp.com/iangracia
:cookie: 345 | @cowcrazy |http://www.freecodecamp.com/cowcrazy
Ian Gracia
@iangracia
Sep 17 2017 14:26 UTC
@korzo That is currently what I'm doing, tho i find myself not understanding alot of challenges. I really read the solutions until i understand them. But when it comes to finding my own solutions, im helpless
cowCrazy
@cowCrazy
Sep 17 2017 14:29 UTC
but with the last solution you were really close, this tiny bug was cause you were peobably already to tired or something like that..... if that's the kinds of problems you have it is completely normal
Pascal Clanget
@Gh05d
Sep 17 2017 14:50 UTC

Hi guys, I need help with getting access to the wikipedia API. I get the classic cross-domain error when trying to fetch the data with axios:

XMLHttpRequest cannot load https://www.mediawiki.org/w/api.php. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://s.codepen.io' is therefore not allowed access

Here is my code:

    axios({
      method: 'GET',
      url: "https://commons.wikimedia.org/w/api.php",
      crossDomain: true,
      headers: { 'Api-User-Agent': 'Example/1.0' },
    }).then(articles => console.log(articles))
          .catch(error => console.log(error))      
  }

I tried the workaround where I preset the request with crossorigin.me, but that did not work. Help is very much appreciated.

i think it's the url your using
try with a url you know works
Pascal Clanget
@Gh05d
Sep 17 2017 14:58 UTC
I tried all the other urls they list on their page https://www.mediawiki.org/wiki/API:Main_page
None worked. Then I tried the api for the weatherapp and got back perfect results.
I think I nailed down the problem to the header.
got a pen?
cowCrazy
@cowCrazy
Sep 17 2017 15:04 UTC
I have a cros problem, you can try and use 'https://cors-anywhere.herokuapp.com' infront of your api url, or to work with jsonp
@cowCrazy That one works. Thx
CamperBot
@camperbot
Sep 17 2017 15:07 UTC
gh05d sends brownie points to @cowcrazy :sparkles: :thumbsup: :sparkles:
:cookie: 346 | @cowcrazy |http://www.freecodecamp.com/cowcrazy
cowCrazy
@cowCrazy
Sep 17 2017 15:09 UTC
@Gh05d :+1: , anyhow take a look as well on jsonp, it should be the correct why now days........
korzo
@korzo
Sep 17 2017 15:58 UTC
@Gh05d you can use Wikipedia api without CORS proxy. add Add &origin=* to url
Pascal Clanget
@Gh05d
Sep 17 2017 16:02 UTC
@korzo Nice, that worked. Thx.
CamperBot
@camperbot
Sep 17 2017 16:02 UTC
gh05d sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 501 | @korzo |http://www.freecodecamp.com/korzo
BrianWilliams28
@BrianWilliams28
Sep 17 2017 18:54 UTC
Can someone help? I cant figure out why my function is returning undefined.
let regex = /(\d{3}|\(\d{3}\))([0-9]{3}|-[0-9]{3})(\d{4}|-\d{4})/g;

function telephoneCheck(str) {
str = str.replace(/\s/g, '');
let test = regex.test(str);

if (str.length == 11 && str.charAt(0) == 1) {
 str = str.slice(1);
 if (test) {
   return true;
 }
} else if (str.length == 10 && test) 
{
return true
} else
return false;
}

telephoneCheck("1 555 555 5555"); // should return true but returns undefined? =/
console.log(telephoneCheck("1 555 555 5555"));
korzo
@korzo
Sep 17 2017 19:07 UTC
@BrianWilliams28 it shows true to me, not undefined
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:07 UTC
@korzo yeah
@korzo my regex works but my conditional statements dont work for all cases, bah
korzo
@korzo
Sep 17 2017 19:11 UTC
@BrianWilliams28 because you have one branch with missing else on line 9
if(test)
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:11 UTC
@korzo arent you allowed to put an if without an else though?
i've been doing it for a while and it works for me
korzo
@korzo
Sep 17 2017 19:12 UTC
@BrianWilliams28 yes, you can, but then it returns undefined
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:13 UTC
@korzo this better?
let regex = /(\d{3}|\(\d{3}\))([0-9]{3}|-[0-9]{3})(\d{4}|-\d{4})/g;

function telephoneCheck(str) {
str = str.replace(/\s/g, '');
let test = regex.test(str);
console.log(str.length);
if (str.length == 11 && str.charAt(0) == 1) {
 str = str.slice(1);
 if (test) {
   return true;
 }
  else return false;
} else if (str.length == 10 && test) 
{
return true
} else
return false;
}
console.log(telephoneCheck("1 555-555-5555"));
telephoneCheck("1 555-555-5555"); // should return true but returns undefined? =/
korzo
@korzo
Sep 17 2017 19:13 UTC
if test is false
hifede
@hifede
Sep 17 2017 19:13 UTC
hi guys! i really need your help. I've been trying to make my portfolio page mobile responsive by putting my rows into containers. however, now my navbar brand and the contact form have both moved to the right of the page, and it still doesnt fit a mobile screen well. could anyone help me on what to do ? https://codepen.io/arolf_flora/full/WEoYmd/
korzo
@korzo
Sep 17 2017 19:15 UTC
@BrianWilliams28 also str = str.slice(1); does nothing
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:16 UTC
@korzo wrong
Victor Abeledo
@victorja
Sep 17 2017 19:16 UTC
Hey guys! can you give me a hint on how to make the borders of my img rounded? I tried but it seems to be a bug because of the img being responsive
https://codepen.io/victorabeledo/pen/prNOGM
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:16 UTC
it chops off the 1
korzo
@korzo
Sep 17 2017 19:17 UTC
@BrianWilliams28 Yes, but you don't use str afterwards
Gersho
@Gersho
Sep 17 2017 19:18 UTC
@victorja
#image{
  border-radius: 50px
}
oops
korzo
@korzo
Sep 17 2017 19:19 UTC
@BrianWilliams28 you slice str and then return true/false
Victor Abeledo
@victorja
Sep 17 2017 19:20 UTC
@Gersho great! that worked. thanks
CamperBot
@camperbot
Sep 17 2017 19:20 UTC
victorja sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 431 | @gersho |http://www.freecodecamp.com/gersho
Victor Abeledo
@victorja
Sep 17 2017 19:21 UTC
Any idea on how to fix the unordered list? (the bullet points stay left aligned but I want them centered)
https://codepen.io/victorabeledo/pen/prNOGM
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:22 UTC
@korzo right i see what you mean now
korzo
@korzo
Sep 17 2017 19:26 UTC
@BrianWilliams28 but you should avoid such complicated structures of conditions. It often introduce bugs and it's hard to follow.
also always use curly braces in condition, even on one liners. It's easier to read
amare16
@amare16
Sep 17 2017 19:31 UTC
someone help me how to make online my laravel project... free
korzo
@korzo
Sep 17 2017 19:32 UTC
@amare16 Like where to host you laravel project for free?
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:41 UTC
@korzo i know i'm trying to make it as simple as possible but this algorithm is giving me a lot of trouble
Gersho
@Gersho
Sep 17 2017 19:43 UTC
i skipped that one, they weren't even being that clear about what should be a valid number, and it's not mandatory D:
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:45 UTC
you skipped the telephone algorithm?
Gersho
@Gersho
Sep 17 2017 19:45 UTC
yes
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:45 UTC
they do tell you what a valid number is, with a couple conditions..
so far in the code i have im really close, there's a few that are going unsolved
literally two cases are going unsolved
Gersho
@Gersho
Sep 17 2017 19:49 UTC
which ones ?
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:49 UTC
telephoneCheck("(555-555-5555") and telephoneCheck("(6505552368)") its due to my regex testing true through them
here's my code
Gersho
@Gersho
Sep 17 2017 19:50 UTC
both should return true right ?
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:50 UTC
both should return false
my regex needs some tweaking i think

```function telephoneCheck(str) {
let regex = /(\d{3}|(\d{3}))([0-9]{3}|-[0-9]{3})(\d{4}|-\d{4})/g;
str = str.replace(/\s/g, '');
let match = str.match(/\d/g);

if (match.length == 11 && str.charAt(0) == 1) {
str = str.slice(1);

if (regex.test(str)) {
return true;
}
else return false;
} else if (match.length == 10 && regex.test(str))
{
return true;
} else
return false;
}
console.log(telephoneCheck("1 555-555-5555"));
telephoneCheck("1 555-555-5555");```

korzo
@korzo
Sep 17 2017 19:51 UTC
@BrianWilliams28 Your regex doesn't cover several variants
https://regexr.com/3gp4p
Gersho
@Gersho
Sep 17 2017 19:51 UTC
what ? the first one should return false ? isn't that a valid number ? o_o
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:51 UTC
@korzo are you sure? https://regex101.com/r/xRyVpm/2/
korzo
@korzo
Sep 17 2017 19:52 UTC
@BrianWilliams28 I took numbers from challenge description
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:53 UTC
look at my code though
i remove white spaces
if you remove white spaces the regex works
function telephoneCheck(str) {
let regex = /(\d{3}|\(\d{3}\))([0-9]{3}|-[0-9]{3})(\d{4}|-\d{4})/g;  
str = str.replace(/\s/g, '');
let match = str.match(/\d/g);

if (match.length == 11 && str.charAt(0) == 1) {
 str = str.slice(1);

 if (regex.test(str)) {
   return true;
 }
  else return false;
} else if (match.length == 10 && regex.test(str)) 
{
return true;
} else
return false;
}
console.log(telephoneCheck("1 555-555-5555"));
telephoneCheck("1 555-555-5555");
line 3
amare16
@amare16
Sep 17 2017 19:56 UTC
@korzo just to make it live on the internet
BrianWilliams28
@BrianWilliams28
Sep 17 2017 19:57 UTC
i know how to fix it to make it work for evetything
how can i write if (str.charAt(0) != a num) ?
korzo
@korzo
Sep 17 2017 19:58 UTC
@BrianWilliams28 isNaN
BrianWilliams28
@BrianWilliams28
Sep 17 2017 20:00 UTC
@korzo if (str.charAt(0) isNaN) ?
Gersho
@Gersho
Sep 17 2017 20:00 UTC
or since you're in full regex mode why not check for [0-9] ?
korzo
@korzo
Sep 17 2017 20:00 UTC
@BrianWilliams28 if(isNaN(str.charAt(0)))
for non numbers
@amare16 there is a lot of free hostings for php + mysql
And you can make Laravel to work on shared host with few modifications
amare16
@amare16
Sep 17 2017 20:08 UTC
@korzo please if you know... because i tried a lot but i didn't get any success
BrianWilliams28
@BrianWilliams28
Sep 17 2017 20:12 UTC
i need to edit my regex to stop testing positive through these two strings.
(6505552368)
(555-555-5555
i need a rule in the regex to not count the open and closed brackets unless they encase only 3 numbers
BrianWilliams28
@BrianWilliams28
Sep 17 2017 20:22 UTC
if i have a string inside an array, and i want to split up that string into multiple elements how would i do that?
korzo
@korzo
Sep 17 2017 20:25 UTC
@BrianWilliams28 splice
BrianWilliams28
@BrianWilliams28
Sep 17 2017 20:25 UTC
this algorithm is making me lose my mind lol
every time i change something i fix some and lose the others
Gersho
@Gersho
Sep 17 2017 20:26 UTC
arr[0].split() ?
BrianWilliams28
@BrianWilliams28
Sep 17 2017 20:26 UTC
need to take a break. @korzo @Gersho thanks
CamperBot
@camperbot
Sep 17 2017 20:26 UTC
brianwilliams28 sends brownie points to @korzo and @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 502 | @korzo |http://www.freecodecamp.com/korzo
:cookie: 433 | @gersho |http://www.freecodecamp.com/gersho
Zebralight
@zebralight
Sep 17 2017 20:26 UTC
it would have to be arr[0] = arr[0].split() I reckon
because split() doesn't mutate the original array
or its elements
Richard
@rylew0925
Sep 17 2017 20:27 UTC
In the "Profile Lookup" lesson, why is "prop" surrounded by brackets in the second if statement?
Gersho
@Gersho
Sep 17 2017 20:28 UTC
because you'e aiming for it
like object.prop but written as object[prop] since prop is a variable not a string
Users[rylew0925][name] = Richard
that's how prop would be used in that context
Richard
@rylew0925
Sep 17 2017 20:30 UTC
Then shouldn't firstName also be object[firstName]
Gersho
@Gersho
Sep 17 2017 20:31 UTC
i don't remember the lesson exactly, but isn't prop an argument passed in the function ?
so object[prop] would be object[gersho] or object[rylew0925] depending on arguments
so it's like saying "i want to check up on [prop] from object"
Richard
@rylew0925
Sep 17 2017 20:32 UTC
Then why isn't "firstName" surrounded by brackets in the first if statement since it's also a parameter?
Gersho
@Gersho
Sep 17 2017 20:34 UTC
let me take a look at the lesson :P
iso
@iso1048
Sep 17 2017 20:34 UTC
@rylew0925 use bracket notation when using variables to access properties in object, since the value of the variable is being used, not the name given to the variable (so prop falls under this category)
Gersho
@Gersho
Sep 17 2017 20:35 UTC
oh ok, firstName is the name of the person you're looking stuff on, and prop is the property you're looking for
iso
@iso1048
Sep 17 2017 20:36 UTC
@rylew0925 dot notation can be used when you are accessing a property using the actual name of the property.
Gersho
@Gersho
Sep 17 2017 20:36 UTC
so is there a person named Kristian ? if so what does she likes ?
iso
@iso1048
Sep 17 2017 20:36 UTC
@rylew0925 one of the challenges explains it
Gersho
@Gersho
Sep 17 2017 20:36 UTC
@gothamknight haha yeah i got burned on that plenty of time trying to obj.variable
iso
@iso1048
Sep 17 2017 20:37 UTC
same
Richard
@rylew0925
Sep 17 2017 20:38 UTC
Oh. So it has a bracket because like also has brackets?
    "likes": ["Javascript", "Gaming", "Foxes"]
Gersho
@Gersho
Sep 17 2017 20:38 UTC
nono
i think you should re-read lessons about object manipulation
objects are tree-like data forms, a bit like folders on a file system
iso
@iso1048
Sep 17 2017 20:41 UTC
no.
@rylew0925 say var variable = "name". if i did obj.variable, I would be trying to access a property in the object called "variable" (a string). But if i did obj[variable], then I would be accessing the property of the object which is called "name", since "name" is assigned to variable
Richard
@rylew0925
Sep 17 2017 20:44 UTC
Ah, I think I grasped the concept
@Gersho @gothamknight Thanks!
CamperBot
@camperbot
Sep 17 2017 20:44 UTC
rylew0925 sends brownie points to @gersho and @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 434 | @gersho |http://www.freecodecamp.com/gersho
:cookie: 430 | @gothamknight |http://www.freecodecamp.com/gothamknight
Victor Abeledo
@victorja
Sep 17 2017 20:56 UTC
Guys do you know how to inline display my input forms? Tried a few ways but none of them seem to work
https://codepen.io/victorabeledo/pen/RLWJgB
iso
@iso1048
Sep 17 2017 21:01 UTC
image.png
@victorja is that what you mean?
Gersho
@Gersho
Sep 17 2017 21:04 UTC
nice paint skillz
Victor Abeledo
@victorja
Sep 17 2017 21:04 UTC
@gothamknight yes! thank you. it seems a bit complicated
CamperBot
@camperbot
Sep 17 2017 21:04 UTC
victorja sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 431 | @gothamknight |http://www.freecodecamp.com/gothamknight
iso
@iso1048
Sep 17 2017 21:04 UTC
@Gersho nah bro, snipping tool hahah
Victor Abeledo
@victorja
Sep 17 2017 21:04 UTC
Not to do it, but to come up with the solution
Gersho
@Gersho
Sep 17 2017 21:05 UTC
you don't come up with it, someone shares it with you
and you'll share it too
hippie song
Victor Abeledo
@victorja
Sep 17 2017 21:06 UTC
:satisfied:
Toni Shortsleeve
@KoniKodes
Sep 17 2017 21:09 UTC
@victorja You only created the one input field. Each of the fields you say are required will need to have an input text field. Are multiple choice questions - such "How Likely Are You?" going to be radio or check boxes? Or a dropdown? Questions should such as "What do you like most of our business?" should either be a text input or a selection that allows one answer with an Other option which should have an input if chosen. You haven't really styled anything either. You can wrap the entire container in a specific style, or create different divs for each question type.
hifede
@hifede
Sep 17 2017 21:09 UTC
hi guys! i really need your help. I've been trying to make my portfolio page mobile responsive by putting my rows into containers. however, now my navbar brand and the contact form have both moved to the right of the page, and it still doesnt fit a mobile screen well. could anyone help me on what to do ? https://codepen.io/arolf_flora/full/WEoYmd/
Toni Shortsleeve
@KoniKodes
Sep 17 2017 21:17 UTC
@hifede First, try to move your top link from the HTML page to the head section of the HTML Settings. Then remove the body tag from HTML because CodePen already takes care of the document head. I'm not as familiar with Bootstrap 4 as I am with 3, but I know there is a media break on the smaller devices. Double-check their nav documentation. You might try to place this in the HTML header section: <body data-spy="scroll" data-target=".navbar" data-offset="0">
hifede
@hifede
Sep 17 2017 21:18 UTC
thanks so much @KoniKodes. will try it and see how i get on
CamperBot
@camperbot
Sep 17 2017 21:18 UTC
hifede sends brownie points to @konikodes :sparkles: :thumbsup: :sparkles:
:cookie: 397 | @konikodes |http://www.freecodecamp.com/konikodes
Richard
@rylew0925
Sep 17 2017 21:48 UTC
Referring back to the "Profile Lookup" lesson, I played around with it and tried to return "firstName" only to find that there would be no output. How come it only outputs "prop" but not "firstName"?
Gersho
@Gersho
Sep 17 2017 21:52 UTC
i'm not sure i understand what you're looking for, but maybe
Object.getOwnPropertyNames()
or
Object.prototype.hasOwnProperty()
?
Richard
@rylew0925
Sep 17 2017 21:53 UTC
I meant I was trying to replace "return contacts[x][prop];" with "return contacts[x][firstName];" yet it would not output firstName for some reason
Gersho
@Gersho
Sep 17 2017 21:55 UTC
put quotation around "firstName" so it looks for that name, instead of looking for a variable with that name (like prop) or use dot notation
return contacts[x]["firstName"];
or
return contacts[x].firstName;
assuming your x is valid
Richard
@rylew0925
Sep 17 2017 21:56 UTC
Strange how prop didn't need quotations around it
Gersho
@Gersho
Sep 17 2017 21:56 UTC
prop was a variable
so prop was equivalent to a string "John" for exemple
or "firstName" in that case
Richard
@rylew0925
Sep 17 2017 21:58 UTC
So firstName didn't need quotations because it was already listed under contacts?
Gersho
@Gersho
Sep 17 2017 21:59 UTC
if
var prop = "firstName";

//all statements are the same
obj.firstName
obj["firstName"]
obj[prop]
when you use [] it evaluates the inside first before passing it, so if the inside is a variable, it'll look it up, if it's a string, it'll pass it right away
Richard
@rylew0925
Sep 17 2017 22:02 UTC
@Gersho Thanks again!
CamperBot
@camperbot
Sep 17 2017 22:02 UTC
rylew0925 sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 436 | @gersho |http://www.freecodecamp.com/gersho
Toni Shortsleeve
@KoniKodes
Sep 17 2017 23:14 UTC
@hifede Thank you for the brownies. I look forward to seeing your final code.
CamperBot
@camperbot
Sep 17 2017 23:14 UTC
konikodes sends brownie points to @hifede :sparkles: :thumbsup: :sparkles:
api offline
fefo360
@fefo360
Sep 17 2017 23:25 UTC
Hey guys
iso
@iso1048
Sep 17 2017 23:25 UTC
hi
fefo360
@fefo360
Sep 17 2017 23:25 UTC
I got a newbie question
iso
@iso1048
Sep 17 2017 23:26 UTC
go ahead
fefo360
@fefo360
Sep 17 2017 23:26 UTC
I have a div and inside the div it has h4 and I elements
Are the h4 and I children of the div?
iso
@iso1048
Sep 17 2017 23:27 UTC
yep
fefo360
@fefo360
Sep 17 2017 23:28 UTC
How come #mydiv:nth-child (2) won't work ?
iso
@iso1048
Sep 17 2017 23:30 UTC
try removing the space between 'child' and '(2)'
piteto
@piteto
Sep 17 2017 23:32 UTC
@fefo360 it would be #mydiv h4:nth-child(2)
for the second h4 child of the #mydiv element
iso
@iso1048
Sep 17 2017 23:32 UTC
yeah true just realised that.
fefo360
@fefo360
Sep 17 2017 23:32 UTC
But I also want the I styled
<i>
It won't work
piteto
@piteto
Sep 17 2017 23:33 UTC
Can you show your HTML?
<i> is old school HTML4
fefo360
@fefo360
Sep 17 2017 23:33 UTC
Is on my pc :(
Gersho
@Gersho
Sep 17 2017 23:33 UTC
wouldn't be easier to give a class or id to the elements you want to aim for ?
piteto
@piteto
Sep 17 2017 23:33 UTC
usually used for icons
fefo360
@fefo360
Sep 17 2017 23:34 UTC
Yes I'm using an icon
piteto
@piteto
Sep 17 2017 23:34 UTC
just copy/paste the <div><h4><i> structure here in chat
we don't need all of your HTML
fefo360
@fefo360
Sep 17 2017 23:35 UTC
Let me check if I can get gitter running here
<div id="followus" class="col-lg-4 col-md-4 col-sm-12 col-xs-12 nopaddinglr">
  <h4 style="padding-left: 30%">FOLLOW US</h4>
  <i style="padding-left: 30%" class="fa fa-5x fa-instagram" aria-hidden="true"></i><br><span style="padding-left: 30%">Instagram</span><br><br>
  <i style="padding-left: 30%" class="fa fa-5x fa-facebook-official" aria-hidden="true"></i><br><span style="padding-left: 30%">Facebook</span>
</div>
my goal is to remove those padding styles from there
piteto
@piteto
Sep 17 2017 23:41 UTC
It gets complicated when you're using those <br> tags
the h4 is the first child (nth-child(1))
the first <i> tag is nth-child(2)
the second <i> tag though is nth-child(7)
An easier approach might be:
#followus h4,
#followus i,
#followus span {
  padding-left: 30%;
}
fefo360
@fefo360
Sep 17 2017 23:46 UTC
let me try it
nice
thank you so much
piteto
@piteto
Sep 17 2017 23:48 UTC
Sure, no problem. I'd recommend using <div> instead of <br> though - if you want to try and get it working that way
fefo360
@fefo360
Sep 17 2017 23:48 UTC
i tried #follow us h4, i {} but now i see that my syntax was wrong
use <div></div>
like this?
piteto
@piteto
Sep 17 2017 23:49 UTC
Yes, like that
I'll show what I mean
fefo360
@fefo360
Sep 17 2017 23:49 UTC
ok thanks
piteto
@piteto
Sep 17 2017 23:49 UTC
<div id="followus" class="col-lg-4 col-md-4 col-sm-12 col-xs-12 nopaddinglr">
  <h4>FOLLOW US</h4> 
  <i class="fa fa-5x fa-instagram" aria-hidden="true"></i>
  <div>Instagram</div>
  <i class="fa fa-5x fa-facebook-official" aria-hidden="true"></i>
  <div>Facebook</div>
</div>
then your css is:
#followus {
  padding-left: 30%;
}
fefo360
@fefo360
Sep 17 2017 23:50 UTC
ah i see
piteto
@piteto
Sep 17 2017 23:51 UTC
<div> is a block element - it takes up its own line
similar to <p>
fefo360
@fefo360
Sep 17 2017 23:51 UTC
you are right
piteto
@piteto
Sep 17 2017 23:52 UTC
I'm guessing some might say that <p> is actually more appropriate in this case, search engines at least might have a better idea of what you're trying to do
fefo360
@fefo360
Sep 17 2017 23:52 UTC
so people dont use br anymore?
piteto
@piteto
Sep 17 2017 23:52 UTC
br is mainly for poems, addresses, etc. where you need to break in the middle of a text string
fefo360
@fefo360
Sep 17 2017 23:52 UTC
yeah i felt wrong just trowing the text without wrapping it
piteto
@piteto
Sep 17 2017 23:53 UTC
it's confusing because there are probably 100 different ways to do this :)
fefo360
@fefo360
Sep 17 2017 23:54 UTC
yes i hate that part about coding :(
i can get stuff done but usually not in the best way