+ 1

Web code different look and behaviour on tablet and phone

I am puzzled because the attached code: -produces few particles on my phone and lots (as it should) on tablet -Trails dissappear as they should on ipad but linger on phone -Particles seem to dissappear on the corners rather than bouncing back forever. Help welcome, credits to Mirielle for borrowing templates from her codes. https://code.sololearn.com/W1XpXs59vF1r/?ref=app

5th Jul 2020, 11:25 AM
bell
bell - avatar
5 Respostas
+ 1
1. possibly becaue only half of the canvas are showing, try add css with width 100w and height 100vh to the canvas, because initialstate of screen are taken immidiately, ex. if i run the code with keyboard open, the canvas will have height of the screen minus keyboard height. though, i'm not 100% sure this is the problem causing that 2. maybe because the transparancy not add up to 1, i change it to .05 and it's not leaving any trail EDIT: this may not be the case, experiment with it some more and it and any value >= .5 didnt leave trail. 3. i didnt encounter that but i what i have encounter here in my device is some particle already grey-ish color at start, and blend/disappear when the background goes black, could related to your first problem. i notice it easily because my phone run canvas in half speed
5th Jul 2020, 12:39 PM
Taste
Taste - avatar
0
Every browser has its own slightly different interpretation of the design. Also not every function will be supported. The code must therefore be converted to the "old" JavaScript. Afterwards possibly still additionally fine-tuned.
5th Jul 2020, 11:51 AM
JaScript
JaScript - avatar
0
Ja Play thanks for answering but I need some specific feedback on js: the code should produce 50 particles but on my phone it gives 6 at most. What is the new/old js in my code?
5th Jul 2020, 12:03 PM
bell
bell - avatar
0
Taste thank you for your help! i am seeing the whole display in both phone and ipad because i see the particles bounce, the css sets the scale. But the gray particles might be it, maybe some colour does not show on the phone? I will try setting proper codes rather than names. Still missing a proper black background om the phone, I want trails but not if they stay forever!
5th Jul 2020, 1:58 PM
bell
bell - avatar