These are chat archives for FreeCodeCamp/HelpFrontEnd

25th
Mar 2018
DarkxPunk
@DarkxPunk
Mar 25 2018 00:24
Anyone wanna give me some commentary on my pure css tab system?
Kent Saeteurn
@sansae
Mar 25 2018 02:06
Hello, I was wondering if anyone can help me with the Markdown Previewer app? I'm not sure how to implement the actual markdown
不吃猫的鱼
@n0ruSh
Mar 25 2018 02:42
For people who are learning JS, just thought this might help: https://github.com/n0ruSh/the-art-of-reading
lagunasurfer
@lagunasurfer
Mar 25 2018 03:10
Hi all, for the 2nd project
portfolio thing
when it says

3User Story: I can access all of the portfolio webpage's content just by scrolling.

do i need to add a special scroll bar?
im a bit confused on that
to me, it seems like something rather automatic
Ghost
@ghost~55a04b725e0d51bd787af54c
Mar 25 2018 03:16
hi all
can someone help me fix my code plz/
lagunasurfer
@lagunasurfer
Mar 25 2018 03:17
what's your problem?
Ghost
@ghost~55a04b725e0d51bd787af54c
Mar 25 2018 03:17
When I click the button, it does not display hte function output
lagunasurfer
@lagunasurfer
Mar 25 2018 03:18
which button?
Ghost
@ghost~55a04b725e0d51bd787af54c
Mar 25 2018 03:18
It may be because I'm using document.wrote, I'm not sure
<button onclick="result()">Click me</button>
lagunasurfer
@lagunasurfer
Mar 25 2018 03:18
oh isee
Ghost
@ghost~55a04b725e0d51bd787af54c
Mar 25 2018 03:18
Yeah
lagunasurfer
@lagunasurfer
Mar 25 2018 03:19
in your format I'm not sure
Ghost
@ghost~55a04b725e0d51bd787af54c
Mar 25 2018 03:19
any ideas?
lagunasurfer
@lagunasurfer
Mar 25 2018 03:19
I use <a> for buttons
maybe you could change it?
here's an example i used
<h2 class ="text-center"> Here's a link about <a href= "https://en.wikipedia.org/wiki/Barack_Obama"target="_blank">Obama</a></h2>
that works
this is the important part
<a href= "https://en.wikipedia.org/wiki/Barack_Obama"target="_blank">Obama</a>
I hope that helps:O
Otherwise I don't know, im also a beginner
good luck
are you trying to send people to a link?
Ghost
@ghost~55a04b725e0d51bd787af54c
Mar 25 2018 03:21
hm, wow
No, I'm trying to solve a math problem
lagunasurfer
@lagunasurfer
Mar 25 2018 03:21
oh
Ghost
@ghost~55a04b725e0d51bd787af54c
Mar 25 2018 03:22
Yeah, no that's not what I need, but thanks for trying
prreciate it
lagunasurfer
@lagunasurfer
Mar 25 2018 03:22
sure
goodluck
Ghost
@ghost~55a04b725e0d51bd787af54c
Mar 25 2018 03:22
thx
habibaatify
@habibatify_twitter
Mar 25 2018 06:13
i know HTML ,CSS, JS,Jquery,php,laravel, angular now i want to work on real project not just for practices.what is your advice for me?
Dhaval Vira
@dhavalveera
Mar 25 2018 06:26
@habibatify_twitter you want to Work as Freelancer or as Employee ?
habibaatify
@habibatify_twitter
Mar 25 2018 06:29
freelancer
Dhaval Vira
@dhavalveera
Mar 25 2018 06:32
@habibatify_twitter message me directly
coderNewby
@coderNewby
Mar 25 2018 07:33
pm for you @DarrenfJ will be heading into jquery. thanks
CamperBot
@camperbot
Mar 25 2018 07:33
codernewby sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2437 | @darrenfj |http://www.freecodecamp.org/darrenfj
David Rivera
@dvriv
Mar 25 2018 08:16
Hello
For the Twitch API project, can I use the client ID and secret that twitch gives you?
I want to include a search channel function on my app and the suggested api doesn't provide the search endpoint
Sorin Ruse
@sorinr
Mar 25 2018 08:33
@dvriv yes. you can use your client id provided by twitch for the registered app. you can delete it anytime and get a new one if you feel someone is abusing your id
David Rivera
@dvriv
Mar 25 2018 08:36
ok thank you @sorinr
Sorin Ruse
@sorinr
Mar 25 2018 08:38
@dvriv welcome
Austin Tice
@AustinTice
Mar 25 2018 15:44
Hello all!
Stephen James
@sjames1958gm
Mar 25 2018 16:11
@AustinTice :wave:
Austin Tice
@AustinTice
Mar 25 2018 16:20
How's everybody doing
Stephen James
@sjames1958gm
Mar 25 2018 16:25
@AustinTice Chillin' on a Sunday morning
AbrisM
@AbrisM
Mar 25 2018 16:25
Watching some vids
mustimuu
@mustimuu
Mar 25 2018 16:37

Hey guys & Girls

I am trying to transfer the parent style to the child-theme in wordpress. But it doesent seem to work. Heres the code:

<?php
function my_theme_enqueue_styles() {

    $parent_style = 'understrap-style'; // This is 'understrap-style' for the understrap theme.

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
CrispyCB
@CrispyCB
Mar 25 2018 16:38
Hey all, can I get some help with the object lookup problem?
mustimuu
@mustimuu
Mar 25 2018 16:38


/*
Theme Name: understrap Child
Theme URI: http://beproductive.dk/understrap-child/
Description: understrap Child Theme
Author: Musti
Author URI: http://bepductive.dk
Template: understrap
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: understrap-child
*/
Travis Tan
@TravisTtk
Mar 25 2018 16:38

https://codepen.io/TravisTtk/pen/bvWwBp

hey guys need some help on this.
1) how can i align the "Experience" with the text on the right side of it?
2) The vertical grey background color only fills the window but when i scroll it doesn't fill all the way to the right.

some advices would be much appreciated!

CrispyCB
@CrispyCB
Mar 25 2018 16:40

function phoneticLookup(val) {
var result = "";

// Only change code below this line
var lookup = {
"alpha":"Adams",
"bravo":"Boston",
"charlie":"Chicago",
"delta":"Denver",
"echo":"Easy",
"foxtrot":"Frank"
};

// Only change code above this line
return result;
}

// Change this value to test
phoneticLookup("alpha");

is my code, and I'm not sure why it's returning errors.

Stephen James
@sjames1958gm
Mar 25 2018 16:42
@CrispyCB you aren't modifying the returned value
CrispyCB
@CrispyCB
Mar 25 2018 16:42
How do you mean?
Stephen James
@sjames1958gm
Mar 25 2018 16:43
@CrispyCB return result is returning the value of the variable result which is not modified by your code
CrispyCB
@CrispyCB
Mar 25 2018 16:43
Right...?
So should it be var result then?
Or is there something that needs to be done before it returns the result?
e.g. result == something?
Stephen James
@sjames1958gm
Mar 25 2018 16:49
@CrispyCB After your lookup object to assign something to result (before the return)
result = something (single = for assignment)
CrispyCB
@CrispyCB
Mar 25 2018 16:51
Right. Now to figure out what to assign it to.
Stephen James
@sjames1958gm
Mar 25 2018 16:51
@CrispyCB :+1:
@CrispyCB Using the input parameter val and your object lookup
CrispyCB
@CrispyCB
Mar 25 2018 16:53
so result = lookup[val] or result = lookup(val)?
Stephen James
@sjames1958gm
Mar 25 2018 16:55
The first one
lookup(val) is calling a function lookup
CrispyCB
@CrispyCB
Mar 25 2018 16:56
Right. Thanks!
M98Ani
@M98Ani
Mar 25 2018 16:56
CrispyCB
@CrispyCB
Mar 25 2018 17:08

So I'm managing to get one test to pass, but not the other two:

function checkObj(checkProp) {
if (myObj.hasOwnProperty("gift")){
return "pony";
}
if (myObj.hasOwnProperty("pet")){
return "kitten";
}
if (myObj.hasownProperty("house")) {
return "Not Found";
}
}

The first if statement passes, but not the other two.

Yogender
@yb1997
Mar 25 2018 17:17
That's cuz as soon as first if statement becomes true the inner content runs i.e. return "pony"
Anything after return statement won't be executed cuz program has already exited from the function as soon as it saw return
Stephen James
@sjames1958gm
Mar 25 2018 17:28
@CrispyCB you aren’t using the parameter. Should only need a single if
There should be no hard coded strings other than “Not Found”
CrispyCB
@CrispyCB
Mar 25 2018 17:36
I'm not sure I understand. So all I should have is if (myObj.hasOwnProperty("house")){ return "Not Found";}?
Stephen James
@sjames1958gm
Mar 25 2018 17:39
@CrispyCB No you should be testing checkProp variable only return "Not Found" if checkProp fails the check
@CrispyCB The challenge is showing how you can use a parameter value and make a function more generic
CrispyCB
@CrispyCB
Mar 25 2018 17:42
Right. I'm not really understanding how I just check for the generic property -- is it really so simple as:
myObj.hasOwnProperty("gift")`
or similar?
Stephen James
@sjames1958gm
Mar 25 2018 18:05
@CrispyCB basically you pass the property on to the hasOwnProperty function myObj.hasOwnProperty(checkProp)
CrispyCB
@CrispyCB
Mar 25 2018 18:17
Okay. I'm still not getting the first two tests to pass, but now the last test passes.
function checkObj(checkProp) { myObj.hasOwnProperty(checkProp); if (myObj.hasOwnProperty("house")) return "Not Found"; }
wait, nvm.
nope, that didn't work.
Stephen James
@sjames1958gm
Mar 25 2018 18:25
@CrispyCB
you need to use if with with hasOwnProperty and checkProp - don't use "house" at all
CrispyCB
@CrispyCB
Mar 25 2018 18:27
IF (myObj.hasOwnProperty(checkProp){return "bot found";}?
Stephen James
@sjames1958gm
Mar 25 2018 18:30
@CrispyCB if it has the property then you need to return the property value, if it doesn't return "Not Found"
In pseudo code:
if myObj has the property from checkProp
    return the property value
else
   return "Not Found"
CrispyCB
@CrispyCB
Mar 25 2018 18:33
if (myObj.hasOwnProperty(checkProp)){
 return checkProp;}
  else {
  return "Not Found";}
}
Wait. No. The second checkprop needs to be replaced by something
return myObj?
Moisés Man
@moigithub
Mar 25 2018 18:38
an object is a key:value pair data.. to access its value.. u need to use the object name and the key (key == property.. same thing)
CrispyCB
@CrispyCB
Mar 25 2018 18:41
How do I not specify a key?
e.g. myObj[SomethingGoesHere]
Moisés Man
@moigithub
Mar 25 2018 18:49
ur variable checkProp contains the property/keys values, so u can just drop the variable in there and it will work
CrispyCB
@CrispyCB
Mar 25 2018 18:50
if (myObj.hasOwnProperty(checkProp)){
 return myObj;}
  else {
  return "Not Found";}
Stephen James
@sjames1958gm
Mar 25 2018 18:51
@CrispyCB Just like on the look up challenge
CrispyCB
@CrispyCB
Mar 25 2018 18:52
I tried myObj[val] and it told me val was undefined.
Stephen James
@sjames1958gm
Mar 25 2018 18:57
checkProp here not Val
CrispyCB
@CrispyCB
Mar 25 2018 18:57
I see, now! Thanks!
Stephen James
@sjames1958gm
Mar 25 2018 19:03
:+1:
German Gamboa Gonzalez
@germangamboa95
Mar 25 2018 21:16
Guys I am looking for feedback on my typing test app thingy. https://germangamboa95.github.io/typingTest.io/
Stephen James
@sjames1958gm
Mar 25 2018 21:26
@germangamboa95 Interesting. Seems to work pretty well. I didn't realize I was supposed to type on final space at the end.
And my WPM was 2889?
German Gamboa Gonzalez
@germangamboa95
Mar 25 2018 21:28
Hmmm that does not seem right lol
Stephen James
@sjames1958gm
Mar 25 2018 21:40
@AmitP88 I see some console.log errors relating to r=""
Amit Patel
@AmitP88
Mar 25 2018 21:43
@sjames1958gm oh yeah, I noticed those two. However, I was following this tutorial here: https://bytes.babbel.com/en/articles/2015-03-19-radial-svg-progressbar.html and implemented their solution. The errors were there before I added the minute circle, and the seconds circle works as intended, so I know that the errors are unrelated
Stephen James
@sjames1958gm
Mar 25 2018 21:47
@AmitP88 BEcause you are setting the r attribute in the js
@AmitP88 Put the code from run() that updates the circle in a function and call it from run() and decrement()
James Wright
@CodeGod666_twitter
Mar 25 2018 21:50
hello
Amit Patel
@AmitP88
Mar 25 2018 21:50
@sjames1958gm are you referring to this code?
    // decrements seconds circle for each second counted down
    var seconds_offset = -(seconds_circumference / maxSecondsCount) * currentSecondsCount + 'em';
    console.log(currentSecondsCount, seconds_offset);
    document.querySelector('.seconds-radial-progress-cover').setAttribute('stroke-dashoffset', seconds_offset);
    currentSecondsCount++;

    // decrements minutes circle for each minute counted down
    var minutes_offset = -(minutes_circumference / maxMinutesCount) * currentMinutesCount + 'em';
    console.log(currentMinutesCount, minutes_offset);
    document.querySelector('.minutes-radial-progress-cover').setAttribute('stroke-dashoffset', minutes_offset);
Stephen James
@sjames1958gm
Mar 25 2018 21:50
@AmitP88 Well the minutes part if you want the minutes to be decremented with the decrement button
Amit Patel
@AmitP88
Mar 25 2018 21:57
@sjames1958gm ah ok

@sjames1958gm I tried this:

function minutes_circle() {
    // decrements minutes circle for each minute counted down
    var minutes_offset = -(minutes_circumference / maxMinutesCount) * currentMinutesCount + 'em';
    console.log(currentMinutesCount, minutes_offset);
    document.querySelector('.minutes-radial-progress-cover').setAttribute('stroke-dashoffset', minutes_offset);  
}

then calling it in run and decrement functions

but it still does the same thing
Stephen James
@sjames1958gm
Mar 25 2018 22:17
@AmitP88 hmm, seems like that should work. You probably need to call it once at the beginning to set the minutes to 25
Amit Patel
@AmitP88
Mar 25 2018 22:23
@sjames1958gm hmmm, it sorta works, but only up to setting the timer up to 30 mins. If I try to set it to say 35+, the circle actually decreases rather than increases
t.png
Stephen James
@sjames1958gm
Mar 25 2018 22:23
@AmitP88 Does your output to the console tell you anything?
Amit Patel
@AmitP88
Mar 25 2018 22:25
it just tells me the minute_offset and second_offset
Stephen James
@sjames1958gm
Mar 25 2018 22:26
@AmitP88 When it stops decreasing does the minute offset number do something unexpected?
Amit Patel
@AmitP88
Mar 25 2018 22:27
you mean when the timer reaches 00:00?
Stephen James
@sjames1958gm
Mar 25 2018 22:28
@AmitP88 When you are incrementing the timer as you described above and it starts decreasing instead of increasing
Amit Patel
@AmitP88
Mar 25 2018 22:30
m.png
the lines on app.78 are minute_offset
and the ones on 87 are second_offset
Stephen James
@sjames1958gm
Mar 25 2018 22:34
So what are the numbers when you click + and it goes the wrong direction?
Amit Patel
@AmitP88
Mar 25 2018 22:37
when I set the timer to 40 mins, I get -43 and -45 and -45 when I hit start
all ending in em
those are for minute_offset
Stephen James
@sjames1958gm
Mar 25 2018 22:56
@AmitP88 I don't see this variable currentMinutesCount updated in decrement?