These are chat archives for FreeCodeCamp/HelpFrontEnd

5th
Dec 2017
hi can anyone help to make the texts (along w hover effects) appear after the header texts animates to the left?
SampathKumar27896
@SampathKumar27896
Dec 05 2017 04:30 UTC
Hello Everyone ! Could anyone tell me how to create horizontally scrolling website?.
Ken Haduch
@khaduch
Dec 05 2017 05:01 UTC
@SampathKumar27896 - this is an old post in the CSS tricks site, but https://css-tricks.com/how-to-create-a-horizontally-scrolling-site/ - that might be one place to check for an answer to your question? Perhaps there is some updated information or better ways to do it, but I'd give CSS tricks a shot...
Ghost
@ghost~56969a4516b6c7089cc26696
Dec 05 2017 05:04 UTC
Hi all, trying to get a react app up on GitHub pages. npm run deploy with the pre-deploy and deploy scripts for gh-pages seems not to push the modules to the repo. I figure that's supposed to happen? All I get is the readme though
should I expect to wait for the app to become visible? OR will it not even work if it's a router-based site?
Ken Haduch
@khaduch
Dec 05 2017 05:07 UTC
@SampathKumar27896 - https://css-tricks.com/pure-css-horizontal-scrolling/ seems to be a newer post on the same topic. But I'm going to have to say that I cannot really see either one of those actually working? This page: https://forum.webflow.com/t/tutorial-how-to-make-a-horizontal-scrolling-page/13409/5 has an example that actually seems to work!
SampathKumar27896
@SampathKumar27896
Dec 05 2017 05:12 UTC
Thank you very much @khaduch
CamperBot
@camperbot
Dec 05 2017 05:12 UTC
sampathkumar27896 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3563 | @khaduch |http://www.freecodecamp.org/khaduch
Ken Haduch
@khaduch
Dec 05 2017 05:18 UTC
@SampathKumar27896 - this page https://codeburst.io/how-to-create-horizontal-scrolling-containers-d8069651e9c6 seems to be new and maybe a simpler approach? I just made a quick CodePen pen to see how it works.
Ryan Nelson
@iamryandnelson
Dec 05 2017 06:10 UTC
Tic-Tac-Toe
After a player moves, I want it to check if the game is tied, and if so exit the function. Is this how I would write it?
/ Check if game is tied /
if (checkIfTie()) {
return;
/ If the computer wins... /
} else if (checkIfPlayerWon("bone")) {
/ Animate their winning score... /
Codepen: https://codepen.io/iamryandnelson/pen/YQGzXJ?editors=0010
Ryan Williams
@Ryanwfile
Dec 05 2017 06:23 UTC
@Skidle Thank you, I will try that out
CamperBot
@camperbot
Dec 05 2017 06:23 UTC
ryanwfile sends brownie points to @skidle :sparkles: :thumbsup: :sparkles:
:cookie: 313 | @skidle |http://www.freecodecamp.org/skidle
Coy Sanders
@coymeetsworld
Dec 05 2017 06:23 UTC
@iamryandnelson you need to think about what are the criteria for a tied game state is
there's 3
you're repeating some of the code you're executing, like checkIfPlayerWon(), you're calling that inside your checkIfTie function and outside of it. You should just need to call it once
Ryan Nelson
@iamryandnelson
Dec 05 2017 06:36 UTC
Thank you @coymeetsworld :)
CamperBot
@camperbot
Dec 05 2017 06:36 UTC
iamryandnelson sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 3012 | @coymeetsworld |http://www.freecodecamp.org/coymeetsworld
phillip shields
@efe-in-the-mountains
Dec 05 2017 07:48 UTC
hey everyone. i would like to invite any of you to give my js a onceover, i finished my web app after some frustration. i feel good about my weather app, and i plan to add more to it. i tried to be simple and direct with the js, but i am not sure i put things in the right places. thanks kindly. js:https://github.com/efe-in-the-mountains/weatherAPI-project/blob/master/js/script.js project:https://efe-in-the-mountains.github.io/weatherAPI-project/
any and all advice/criticism is greatly appreciated
phillip shields
@efe-in-the-mountains
Dec 05 2017 07:56 UTC
crap, sorry all. thought this was code review room.....
Marianissimus
@Marianissimus
Dec 05 2017 08:06 UTC
@efe-in-the-mountains don't worry; anyway, your farenheit and celsius converter don't work :P
Henry
@GitHub-Henry
Dec 05 2017 08:34 UTC
image.png
@efe-in-the-mountains location, current temperature and conversion work. the icon used didn't have any meaning for me, perhaps it has meaning for you, also, not sure what the numbers on the right represent. i compared them to the local weather forecast for the upcoming day, and the previous day, but numbers on the right didn't match either. lastly, i wasn't a fan of the blur affect. made me feel like i had eye problems. all this said, it does seem to meet the project requirements.
aejeong
@aejeong
Dec 05 2017 10:04 UTC
Hello guys, I'm learning Javascript course, but I'm stuck in "Counting Cards" part. Can anyone help me please? before I solve this part, I barely can understand what question they gave me : ( what dose it mean? "a player can gain an advantage over the house by keeping track of the relative number of high and low cards remaining in the deck. "
Henry
@GitHub-Henry
Dec 05 2017 10:06 UTC
@aejeong for example, if you know all the kings, queens and jacks have been used, you have an idea what remains
Kris Baillargeon
@krisb1220
Dec 05 2017 10:10 UTC
@aejeong do you know how to play blackjack?
& do you know the number values for playing cards?
the second one isn't really necessary but it helps :P
aejeong
@aejeong
Dec 05 2017 10:11 UTC
No.... I've never done it ..so I'm confused : S ... hahaha
Markus Kiili
@Masd925
Dec 05 2017 10:11 UTC
@aejeong In blackjack, the dealer has a large deck of cards and we play several hands against the dealer with the same deck. Having more than average amount of large cards on the remaining deck benefits the player, so we can take advantage by keeping track of what cards have been played off the deck.
Kris Baillargeon
@krisb1220
Dec 05 2017 10:12 UTC
This article should help you out a lot
aejeong
@aejeong
Dec 05 2017 10:14 UTC
Ok, I'll try to solve the part with all of hints that you guys gave to me :clap: :clap: :smile: :+1: Thank youuuu !
Alvaro
@minutazos
Dec 05 2017 12:29 UTC
Hi guys, I know maybe it's a very stupid question, but how do you do to (in the menu) set to active the link of the page you are visiting? You can do this with html/css or you have to do it via jquery/js?
Alvaro
@minutazos
Dec 05 2017 12:37 UTC
lol, very stupid question sorry :P
Rajat
@rajataudichya
Dec 05 2017 12:55 UTC
just give me hint here I am solving stand in line challenge in basic JS
```js

function nextInLine(arr, item) {
  // Your code here

   arr = testArr;
 item = 1;
 var number = testArr.push(item);
 var remove = testArr.shift();


  return remove;  // Change this line

}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
anyone der?
@\all
Markus Kiili
@Masd925
Dec 05 2017 12:57 UTC
@rajataudichya Use only arr and item, not testArr.
testArr is only for FCC tests on your function.
Rajat
@rajataudichya
Dec 05 2017 12:58 UTC

function nextInLine(arr, item) {
  // Your code here
 item = 1;
 var number = arr.push(item);
 var remove = arr.shift();


  return remove;  // Change this line

}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
Rajat
@rajataudichya
Dec 05 2017 13:05 UTC
can you explain me
function nextInLine(arr, item) {
  // Your code here
 var number = arr.push(item);
 var remove = arr.shift();


  return remove;  // Change this line

}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
Markus Kiili
@Masd925
Dec 05 2017 13:07 UTC
@rajataudichya arr and item are the parameters of the function, and when the function is called and executed, they hold the passed array and number from the function call. So you should just use arr and item on the function code. Don't overwrite their values with item=1 etc.
You don't need those variables number and remove.
Rajat
@rajataudichya
Dec 05 2017 13:08 UTC
are they parameters in js? as my confusion is that we have not assigned any value to the arr or item so how can it take any value
what should i return then?
@Masd925
Markus Kiili
@Masd925
Dec 05 2017 13:11 UTC
@rajataudichya When a function call nextInLine(testArr, 6) is made, the function code is executed with arr having the value stored in testArr and item being 6. Some other function call would give other values to the parameters. By using the parameters arr and item in the function code, your function can respond to any function call with any passed arguments.
Here is a simple example of how parameters and arguments work. A function that concatenates the passed strings together and returns the result:
function adder(str1, str2) {
  return str1+str2;
}

console.log("Hello ", "world!"); // Logs: "Hello  world!"
So the passed arguments from the function call are stored on the parameters when the function call is executed.
Rajat
@rajataudichya
Dec 05 2017 13:15 UTC
Thans got it....
function nextInLine(arr, item) {
  // Your code here
 arr.push(item);



  return arr.shift();  // Change this line

}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
this worked
@Masd925
Markus Kiili
@Masd925
Dec 05 2017 13:16 UTC
@rajataudichya :+1:
aejeong
@aejeong
Dec 05 2017 13:17 UTC
How can I upload image on here ? hahaha : p .........?
Markus Kiili
@Masd925
Dec 05 2017 13:18 UTC
@aejeong Try drag and drop.
aejeong
@aejeong
Dec 05 2017 13:18 UTC
oh Thank you !
ScreenClip.png
I'm wondering how "5 bet" come out ..
aejeong
@aejeong
Dec 05 2017 13:33 UTC
How come did that code return "5 bet" ? I don't get it :worried: .. Can someone explain it please?
abraham anak agung
@padunk
Dec 05 2017 13:56 UTC
@aejeong for every card less than 7, you add the counter and put a bet word if the sum of the count bigger than 0
aejeong
@aejeong
Dec 05 2017 14:07 UTC
Thank you so much :+1: :+1:
kreuel
@kreuel
Dec 05 2017 15:53 UTC
hi Guys, can you assist me on the Mutations challenge below is my code. Thanks in advance!

function mutation(arr) {
var tempVal1 = arr[0].toLowerCase().split("");
var tempVal2 = arr[1].toLowerCase().split("");
var finalVal = "";

for (var i = 0; i < tempVal1.length; i++){
if(tempVal2.indexOf(tempVal1[i]) !== -1){
return false;
}else {
return true;
}

}
}

Stephen James
@sjames1958gm
Dec 05 2017 15:59 UTC
@kreuel You cannot return true until you have tested every letter.
You will return true or false based only on the first letter.
@kreuel Also, you should be testing letters from arr[1] inside of arr[0] not the other way around
kreuel
@kreuel
Dec 05 2017 16:06 UTC
@sjames1958gm , thanks for your reply, let me reverse it. then for returning true or false i think i need to put the condition after the loop execute
CamperBot
@camperbot
Dec 05 2017 16:06 UTC
kreuel sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8749 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
Dec 05 2017 16:07 UTC
@kreuel The condition should be inside the loop, but only return the false case inside the loop.
If you finish the loop without returning false, then true can be returned
kreuel
@kreuel
Dec 05 2017 16:08 UTC
okay let me do some test @sjames1958gm
Stephen James
@sjames1958gm
Dec 05 2017 16:21 UTC
@kreuel :+1:
Pavel
@teiwik
Dec 05 2017 16:44 UTC
Hello, I have problem with bootstrap 4 navbar - it's always collapsed. Does anybody know how to fix it ?
A-J Roos
@Asjas
Dec 05 2017 16:46 UTC
@teiwik Can you post a codepen link? No-one would be able to say without seeing actual code
@teiwik Are there any errors in the Chrome Dev tools?
Pavel
@teiwik
Dec 05 2017 16:49 UTC
@Asjas It's from official bootstrap 4 documentation, when i put this code on codepen everything is fine. But in my editor it doesn't work.
A-J Roos
@Asjas
Dec 05 2017 16:50 UTC
You didn't say if there are error in Chrome Dev Tools or not?
Pavel
@teiwik
Dec 05 2017 16:50 UTC
@Asjas No there isn't any error
@Asjas if i'm using bootstrap cdn from their official website it doesn't work, but when i copy cdn from codepen it's fine.
A-J Roos
@Asjas
Dec 05 2017 16:53 UTC
Then the bootstrap cdn is either way newer or needs different classes for the nav
Marc
@MWBauer
Dec 05 2017 16:55 UTC
Anyone here?
Nick
@rhozeta
Dec 05 2017 17:29 UTC
@MWBauer what’s up
Marc
@MWBauer
Dec 05 2017 17:37 UTC
Having issues with transparent box
I can put my background up, but I can't seem to get a transbox overlaid
LydaTech
@lydatech
Dec 05 2017 17:39 UTC
@MWBauer got an example on codepen?
Marc
@MWBauer
Dec 05 2017 17:39 UTC
lol
I have the background turned off for now until I figure out this box
Currently I'm trying to use a black background and a white transbox.
I want the box to be about 90%H and 90%W
And on a totally different line of thought, is there any reason to think that PVC pipe would cause electronic noise or disrupt the flow of data if I use it to encase the cables around my house
?
A-J Roos
@Asjas
Dec 05 2017 17:41 UTC
@MWBauer You are aware you are using #transbox as a selector which is a ID selector not class selector
In html you have a class transbox. Not an ID transbox
LydaTech
@lydatech
Dec 05 2017 17:42 UTC
@MWBauer ok so a few things youre doing wrong
Marc
@MWBauer
Dec 05 2017 17:43 UTC
changed
LydaTech
@lydatech
Dec 05 2017 17:43 UTC
first dont use body as a selector
second you have a typo in your border property
third and empty containers will collapse by default with no content
Marc
@MWBauer
Dec 05 2017 17:44 UTC
ok.
check again
dev-gbassanini
@dev-gbassanini
Dec 05 2017 17:45 UTC
Hi, is there like a general gitter room for freecodecamp?
Marc
@MWBauer
Dec 05 2017 17:45 UTC
yes
freecodecamp/freecodecamp
dev-gbassanini
@dev-gbassanini
Dec 05 2017 17:45 UTC
thanks!
Marc
@MWBauer
Dec 05 2017 17:45 UTC
yw
:wave: have a great day
and don't forget to smile
:smile:
I tried text-align: center to center the box. That's not working.
dev-gbassanini
@dev-gbassanini
Dec 05 2017 17:46 UTC
thanks my friend! have a great day you guys too
LydaTech
@lydatech
Dec 05 2017 17:47 UTC
@MWBauer the box is a block element
you need to use margin
margin: 0 auto; for example
Marc
@MWBauer
Dec 05 2017 17:50 UTC
take A LOOK
oy
Marc
@MWBauer
Dec 05 2017 17:54 UTC
poking around
Our margin: 0 auto are doing different things.
why do you have a min-height?
Marc
@MWBauer
Dec 05 2017 18:02 UTC
why can't I change the background color of the box?
I tried background: white. I tried background-color: white. I tried background: #000000 and #ffffff. All I get is grey
Marc
@MWBauer
Dec 05 2017 18:09 UTC
it was the opacity. I'm not sure why it makes the white box turn grey instead of allowing the background to show thru
LydaTech
@lydatech
Dec 05 2017 18:10 UTC
@MWBauer post your link again
LydaTech
@lydatech
Dec 05 2017 18:13 UTC
@MWBauer i see what youre doing. you have a background of black for the body then your setting to opacity of the white box. white and black will give you a grey
Ken Haduch
@khaduch
Dec 05 2017 18:13 UTC
@MWBauer - if you put the background-image on the body instead of html, and change the background of the transbox class to background: rgba(255, 255, 255, 0.4); and remove that opacity: 0.5; then it looks like what you're after.
LydaTech
@lydatech
Dec 05 2017 18:17 UTC
@MWBauer the higher your opacity is the more the white will show through
@MWBauer
I tried coming from the other direction and bleed out the black. that's just...black.
LydaTech
@lydatech
Dec 05 2017 18:22 UTC
@MWBauer youre overlaying a semi-trasparent white box over black. that will give you different shades of grey
Ken Haduch
@khaduch
Dec 05 2017 18:22 UTC
@MWBauer - change $("html").css("background-image", "url(" + URL + ")");} to this: $("body").css("background-image", "url(" + URL + ")"); - put the background-image on the body instead of the html. Take away the opacity: 0.5; from the .transbox CSS styles...
Marc
@MWBauer
Dec 05 2017 18:25 UTC
Now...ya'll are great!
Thank you.
Now this I can play with
See?
I knew someone knew what to do
Ken Haduch
@khaduch
Dec 05 2017 18:27 UTC
@MWBauer :+1:
Marc
@MWBauer
Dec 05 2017 18:27 UTC
thanks @khaduch @lydatech
CamperBot
@camperbot
Dec 05 2017 18:27 UTC
mwbauer sends brownie points to @khaduch and @lydatech :sparkles: :thumbsup: :sparkles:
:star2: 2553 | @lydatech |http://www.freecodecamp.org/lydatech
:star2: 3565 | @khaduch |http://www.freecodecamp.org/khaduch
Marc
@MWBauer
Dec 05 2017 18:28 UTC
You mentioned that without content the box will collapse. Is there a height: 100% or something that would make it just be whole page?
LydaTech
@lydatech
Dec 05 2017 18:29 UTC
100vh
Marc
@MWBauer
Dec 05 2017 18:29 UTC
what's vh?
Ken Haduch
@khaduch
Dec 05 2017 18:29 UTC
viewport height
Marc
@MWBauer
Dec 05 2017 18:29 UTC
OY! yeah
thanks
Ken Haduch
@khaduch
Dec 05 2017 18:29 UTC
100vh = 100% viewport height...
Marc
@MWBauer
Dec 05 2017 18:31 UTC
right. thanks
Marc
@MWBauer
Dec 05 2017 18:36 UTC
how can I center vertically?
the box
nvm
Tiago Correia
@tiagocorreiaalmeida
Dec 05 2017 18:36 UTC
you can use position absolute
or display flex
depends of the situation and what you need to do :D
Marc
@MWBauer
Dec 05 2017 18:40 UTC
I need to actually display the weather information that we call
LydaTech
@lydatech
Dec 05 2017 18:42 UTC
@MWBauer
.transbox {
    display: flex;
    flex-direction: column;  /* make main axis vertical */
    justify-content: center; /* center items vertically, in this case */
    align-items: center;     /* center items horizontally, in this case */
    background: rgba(255, 255, 255, 0.2);
    margin-left: 20px;
    margin-right: 20px;
    border-radius: 10px;
    z-index: 0;
    height: 90vh;
    text-align: center;
}
Marc
@MWBauer
Dec 05 2017 18:47 UTC
why the display flex? what's different with that?
LydaTech
@lydatech
Dec 05 2017 18:49 UTC
@MWBauer what do you mean?
Marc
@MWBauer
Dec 05 2017 18:50 UTC
Between display: flex and position: absolute, what are the differences?
LydaTech
@lydatech
Dec 05 2017 18:50 UTC
@MWBauer its a display format like block or inline or inline-block. It basicaly starts flexbox
@MWBauer you should almost never need to use position absolute
Marc
@MWBauer
Dec 05 2017 18:51 UTC
OH. good to know. THanks
Ok. Moving on. THe first part of the JS is the geolocation. All that does is check your device's position on earth getting the long and lat to report to the weather site and get the weather report. Correct?
Ken Haduch
@khaduch
Dec 05 2017 19:13 UTC
@MWBauer - yes, the geolocation code gets your current latitude and longitude. You have to give it a callback function, which you are doing, because it is asynchronous and will complete at a non-specific time relative to the request. Those parameters come back from geolocation and are in the position variable, looks like you are accessing them properly.
Sly Fox
@Gurukorgi
Dec 05 2017 19:56 UTC
hey does any one here know how to downgrade from windows 8.1 to windows 7
cos it is refusing to downgrade instead it is trying to upgrade
AbrisM
@AbrisM
Dec 05 2017 20:27 UTC
Hello does anyone know of tutorials that shows how to create an shopping website?
an online store on a page?
Jean Marco Romero
@volkranium
Dec 05 2017 20:46 UTC
Currently having trouble with JS regular expressions , any tip?
Ken Haduch
@khaduch
Dec 05 2017 21:29 UTC
@volkranium - what are you trying to do with regular expressions?
Bartek Lewandowski
@Jabarlew
Dec 05 2017 21:31 UTC
thanks @Otto-AA
CamperBot
@camperbot
Dec 05 2017 21:31 UTC
:cookie: 402 | @otto-aa |http://www.freecodecamp.org/otto-aa
jabarlew sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
Himad Mouhtar
@hmouhtar
Dec 05 2017 21:41 UTC
@volkranium which kind of trouble?
Jean Marco Romero
@volkranium
Dec 05 2017 21:43 UTC
@hmouhtar Syntax is kind of weird but i guess ill get soon
Himad Mouhtar
@hmouhtar
Dec 05 2017 21:58 UTC
@volkranium haha yes regular expressions are hard to understand at the beginning but after a few algorithms you will master it
Ken Haduch
@khaduch
Dec 05 2017 22:12 UTC
@volkranium - have you tried the sites that are recommended in the lessons - regex101.com, for example? They give a nice set of progressive steps to learning and understanding regular expressions. I agree that they are not the most straightforward concepts to understand, but they are useful.