Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Flexbox + Grid + Question related to JS

Svenβ€’ 295

@Sven72

Desktop design screenshot for the Social media dashboard with theme switcher coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi all, I am interested in:

  1. How to declutter my JS?
  2. How to prevent the content of the page from "jumping"? When in mobile (light) mode switching to darkmode, appears s a divider between "Dark Mode" and "Total Followers". This divider is only visible in darkmode. Due to the class ".visible_divider" which is append via JS.
  3. The switcher / Toggle Buttons after reload does not switch to the right but stays on the left. (Dark Mode side) Best and stay healthy

Community feedback

Samuel Palaciosβ€’ 615

@samuelpalaciosdev

Posted

Hi, SvenπŸ‘‹

Good job on this challenge! Your solution looks good and it scales pretty well.πŸ‘

I only suggest some things πŸ˜‰:

  • Changing the styles for the social media icons. As I see on you project, the twitter icon looks different from the others. That's because you set a width on them, I'd delete it, makes them look better.

  • Setting a padding on the main element. You only have padding for the left & right, but the "Social media dashboard" is too close to the top of the page, I'd add padding: 2rem 3rem on the 768px media query.

I hope this would help you, have a nice day, keep coding!πŸ’™

1

Samuel Palaciosβ€’ 615

@samuelpalaciosdev

Posted

Btw, I forgot, check those HTMl Issues, I suggest you to use the [W3C Markup Validation Service] (https://validator.w3.org) everytime you make a project, hope this helps you ;)

0
Karimβ€’ 590

@Galielo-App

Posted

hello Sven!

here a few things:

  • About your js, I would put most of the variables inside the function, take a look at this article on why global variables suck
  • your content is jumping because you're removing the <div id="divider" class="visible_divider"></div>, don't remove it! just add visibility: hidden; opacity: 0; and you're done.
  • Because you're reloading the page without saving in the memory that the user changed to another mode. Memory management in javascript is a little bit advanced, so make sure you know javascript well before getting into it. But here you have an article about memory management.

happy coding and if I was helpful please upvote my comment.

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord