« first day (1469 days earlier)      last day (3462 days later) » 

10:14 PM
@BadgerGirl Happy birthday 3>
15
 
m59
node app with google sign in auth - my session is lost on refresh on safari ios. Does anyone have suggestions on what could be wrong?
Or how I would go about debugging such a thing?
 
apparently my parseInt(1/Math.random()) got featured?
http://www.codepen.io
 
@BadgerGirl Happy birthday!
 
@Zirak Thanks! :)
 
hey, looking for some advice. I have created a star field in my canvas of about 500 stars (they are just 1by1 pixels). But i want to add parallax scrolling to give the perception of depth and also want some to "twinkle", but it seems my only option is to make a huge array of objects for all these stars. Is there any tricks you might know where i can get the same effect with less storage of all these points?
 
@Dave no
 
cries
 
having that huge array is the correct and most elegant way to do it
also, it's really not resource heavy
 
10:43 PM
i would of thought 500 stars to iterate every frame would be quite heavy
 
@Dave nah, it's not
 
i guess i could create the array on the fly although that means every refresh the star layout will change, don't think any one will really notice though :P
i dont like the idea of having it stored in a database
 
take a look at this
ever used codepen before?
 
i usually just use fiddle but have heard o it
of it
 
there are about 200 stars in there. I have no problems at geting 10 times the stars. You just need use some easily computable moving algorithms, and store only what's needed
 
10:47 PM
which var can i change to let me add more
 
in this case I just get every star to be an object, with an x, a y, and any velocity
wait, let me check the line
@Dave line 20: total
in this case is window.innerWidth/2, so it's based on the screen's width
 
i put 12000 but its not inceasing the particle count
 
even with 10.000 stars I have no lag at all
@Dave every time a star gets out of your view I recycle it and get it to the origin, and give it a different velocity
so you may not see 12.000 stars at once, but the distribution is much greater
 
so reduce velocity max and i should see more
 
I feel like there should be a world record for longest running infinite loop.
 
10:52 PM
ill try it out and see if i can get a good performance out of it
 
Seriously though.
I wonder what went through the person's mind the first time an infinite loop was encountered discovered invented.
 
m59
Is this madness or do I just not understand the OP?
@m59: why not? express would likely be a module required in some module/service inside that app! i love the declarative approach of building angular apps.. and i think that it would be very flexible on a server too! — aleclofabbro 42 mins ago
 
11:11 PM
Hello everyone.
 
@NewToJS Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
m59
yo
 
How are you?
 
can I select an element with multiple attributes in JQuery?
Like $("#first [data-num='1']"); ?
 
11:30 PM
#first would = ID first, if you want to target multiple elements i think you would be better targeting the class. Duplicated ID's can cause problems so using a class will allow you to target all with that class. (If i'm not mistaken, i'm new with Javascript and used a little jQuery)
Oh my apologies, i think i have read your question wrong, you asked about multiple attributes not elements.
 
@DemCodeLines the space indicates descendants
#first[data-num='1']
if it is an attribute on the same element
 
@rlemon <i id="first" data-num="1"></i>
 
11:50 PM
"Let's talk to the bot"?
 
@towc almost got it but the scrolling with the mouse is acting strange jsfiddle.net/rgjtkz3t
 
@CapricaSix how was your day, honey?
 

« first day (1469 days earlier)      last day (3462 days later) »