Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the dark / light switch on demo website should be instant. #20

Closed
delata opened this issue May 29, 2020 · 11 comments
Closed

the dark / light switch on demo website should be instant. #20

delata opened this issue May 29, 2020 · 11 comments

Comments

@delata
Copy link

delata commented May 29, 2020

it takes more than a seconds. and lags. it should me smooth.

@ghost
Copy link

ghost commented May 29, 2020

@delata It seems to be instantaneous for me on the latest versions of Chrome, Firefox, and Safari on MacOS. Would you mind showing a video?

@delata
Copy link
Author

delata commented May 29, 2020

i am using chrome ( actually Brave) on android running on a 3 years old 75 dollar phone.

@delata
Copy link
Author

delata commented May 30, 2020

again you are running on a macbook.
yes on my laptop lag is less noticeable.
test this on a low powered phone.

@Anachron
Copy link

I'm running it on a Samsung Galaxy A40 which costes $150 when it was new a year ago but it takes at most a second to change.

Are you sure it is not causes by addons or other applications slowing down your phone?

Also I'm running it on firefox, maybe try that as well.

@delata
Copy link
Author

delata commented May 30, 2020

this is a problem, i have used other websites that had this kind of mechanism, but they were smooth on my phone.

@Anachron
Copy link

Were they also written in react or just switched stylesheets?

@delata
Copy link
Author

delata commented May 30, 2020

i don't know, they were simple website. the whole react thing is a garbage. worse thing is that people are now using it every where.

@ghost
Copy link

ghost commented May 30, 2020

@delata I see what you're talking about: 6x Slowed CPU + 3G, but I believe this is just the result of making large changes to the DOM on slower devices, which is why you don't notice it on other websites. I think a solution could be to maybe make the opposite version (dark/light) hidden instead of completely removed from the DOM; however, this feels like an edge case.

@ghost
Copy link

ghost commented May 30, 2020

Were they also written in react or just switched stylesheets?

They're two separate React components which are removed and added with the switch, which causes quite a bit of distress to the CPU, etc.. Only around ten CSS classes are changed, so I can see possible merging these two components into one, but it will reduce readability of the source code.

@Anachron
Copy link

Anachron commented May 30, 2020

Were they also written in react or just switched stylesheets?

They're two separate React components which are removed and added with the switch, which causes quite a bit of distress to the CPU, etc.. Only around ten CSS classes are changed, so I can see possible merging these two components into one, but it will reduce readability of the source code.

I was talking about the other websites, if they were switching stylesheets or also are written in react. I am well aware how this library handles it, given that I've read the source code.

@ghost
Copy link

ghost commented May 30, 2020

@Anachron Sorry, I guess I misread it.

@mertJF mertJF closed this as completed Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants