Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Stephen James
@sjames1958gm
The parameter to the then will contain the data from the file, if you want it to go into the DOM you will need to put it there yourself
J. Guidry
@J-Guidry

For those who know React, I have a simon game I've been making with Reactjs. I have a boolean to disable clicking when a sequence is playing but it doesn't work. I used sourcemaps and React dev tools on Chrome in my local repo to try to find the problem, but the best I could do is seeing that the boolean toggling is happening when I set breakpoints but it is not reflected in react dev tools and buttons are still clickable. Aside from that, the app works if you don't click during a sequence and you don't double click a color. I haven't done the strict button or created the win condition yet for winning 20 turns.

I have a glitch repo with the code and a gist with the steps/psueudocode. I have been working on this for a while. I appreciate any help.
https://gist.github.com/J-Guidry/55422112c2e62b0ef3b389d91b90681e
https://glitch.com/edit/#!/reactjs-simongame

Christopher McCormack
@cmccormack
@J-Guidry is this your toggle?
toggleClickable(){
        this.setState({clickable: this.state.clickable = !this.state.clickable});
    }
It would make more sense for you to not use a toggle function if you are trying to specifically set it to clickable or not
Also you don't want to try and store a value in state, that's what setState is for in the first place.
toggleClickable() {
    this.setState( prevState => ({
        clickable: !prevState.clickable,
    }));
 }
J. Guidry
@J-Guidry

I tried both

this.state.clickable = !this.state.clickable

and

!prevState.clickable
The 2nd one will toggle it to false when it is my turn to click on the 2nd turn
I will make that change now on the glitch
Christopher McCormack
@cmccormack
@J-Guidry you should never be using this.state.clickable = !this.state.clickable
setState is to set state
might behoove you to add a boolean parameter to your toggleClickable so you can pass a boolean value that you want to specifically set, for any scenario you want to update the clickable state but want it set a specific way
J. Guidry
@J-Guidry
@cmccormack If I set a parameter, how would I use it in set state? As a third argument? I think that was a callback function if I remember right
Looks like the start button creates errors saying clickable is undefined when the change was made
SN
@SNoon85_twitter
Hi All, curious how to get animations that you can make in After Effects over into an app. Like how do advanced animations carry over to programming? Example: https://cdn.dribbble.com/users/32512/screenshots/4034207/natural_mobile_dribbble25.gif
I can make these in After Effects, but Im a newbie and I am having a hard time understanding how you could incorporate these into an app, like an AI voice app. Many thanks!
Christopher McCormack
@cmccormack
@J-Guidry you can just do something like
toggleClickable(set) {
    this.setState( prevState => ({
        clickable: set || !prevState.clickable,
    }));
 }
probably want a better name than that
J. Guidry
@J-Guidry
@cmccormack Trying it now
Christopher McCormack
@cmccormack
@SNoon85_twitter Do you want these to be clickable or just animations?
SN
@SNoon85_twitter
It would just be animations of the AI talking
obviously "reactive animations" to the sound waves of the voice when answering a question. Similar to Siri
Christopher McCormack
@cmccormack
Does after effects have a web api?
SN
@SNoon85_twitter
Im not sure actually, I will look into that. I dont think so
Christopher McCormack
@cmccormack
I have no idea how this would be done, btw. I imagine you would need something to take input to produce the animated output. This looks complex, so I imagine it would be a library you would have to import
J. Guidry
@J-Guidry
@cmccormack no good. clickable still false/disabled at 2nd turn
Christopher McCormack
@cmccormack
@J-Guidry I wasn't really answering how to fix that problem, just pointing out flaws in your function
J. Guidry
@J-Guidry
Perhaps I need to rethink the logic somewhere or place the toggleClickable call elsewhere
SN
@SNoon85_twitter
this is what I found "https://www.adobe.io/apis/creativecloud/aftereffects.html" so maybe it is possible via API.
Christopher McCormack
@cmccormack
@J-Guidry yes I was going to suggest exactly that
follow your logic and see where it's failing. log what the state is and what you think it should be and compare
SN
@SNoon85_twitter
Thanks @cmccormack for suggestion, this should yield something!
Christopher McCormack
@cmccormack
@SNoon85_twitter good luck
SN
@SNoon85_twitter
thank you!
Christopher McCormack
@cmccormack
Chris Tram
@ctram

@sjames1958gm

The parameter to the then will contain the data from the file, if you want it to go into the DOM you will need to put it there yourself

How do you make it go to the DOM? directly manipulating document?

SN
@SNoon85_twitter
@cmccormack perfect, will check that out also.
Chris Tram
@ctram
@sjames1958gm Thanks! So it is incorrect to expect the browser to automatically update the DOM when receiving a 302 redirect response via a fetch() ?
Stephen James
@sjames1958gm
Yes when you use fetch you are asking for the data to be provided to your JavaScript code
Chris Tram
@ctram
@sjames1958gm Great, thanks for the help!
Morchid Chellali
@Morched23MJ
I can submit a Github repo instead of a pen? In this case, I'm making a portfolio, and I want to seperate the CSS of each part, for a better maintenance. :P
Chris Cullen
@123xylem
@123xylem
Hi guys.. I need to change a select dropdown arrows and replace it with 2 Icons instead. Any Idea how???
I know a lot of people use css background but that is when changing only 1 arrow
Chris Cullen
@123xylem
So far I have this on my select and its working But I cant put a background color on the select input now
` height: 21px; width: 94%; background: url(assets/ArrowUp-Icon.svg),url(assets/ArrowDown-Icon.svg); background-position: top right,bottom right; padding-left: 0px; background-repeat: no-repeat; -webkit-appearance: none; -moz-appearance: none; -o-appearance: none; appearance: none; /* background: #ECF0F9; */ padding-right: 5px;
Rahul Nayak
@pragyes31
hi guys, I'm working on pomodoro clock. so I have 2 section. Both section has a + and - button and a number . Clicking + and - will add or subtract the number. How do I write code such that if I hit + from one section, it only add to the number present in that particular section?
Mandeep Sharma
@mandeephub

Hello TO all

can any one help me with this
https://codepen.io/mandeep9362/pen/XPWqjd?editors=1100

i want to fix the nav but when im using position:fixed the white portion is getting disturbed

abraham anak agung
@padunk
@mandeephub you can give 0px to the body margin. And if you want to comment css use /* code */
@pragyes31 use different ID on the section?
Mandeep Sharma
@mandeephub
@padunk fixed thanks brother