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

[feature] Added a toggle button for dark mode and enhanced UI #306

Open
Unnati-Gupta24 opened this issue Dec 1, 2024 · 0 comments · May be fixed by #307
Open

[feature] Added a toggle button for dark mode and enhanced UI #306

Unnati-Gupta24 opened this issue Dec 1, 2024 · 0 comments · May be fixed by #307

Comments

@Unnati-Gupta24
Copy link

Unnati-Gupta24 commented Dec 1, 2024

Problem Description

The current NetJSONGraph.js examples page lacks a modern, user-friendly design and accessibility features.
And also there is no dark mode option.

Proposed Solution

Implement a comprehensive UI redesign with the following key features:
A more engaging and visually appealing interface
Improved readability across different device sizes
Also added a toggle button to introduce dark mode.
A dark mode option to reduce eye strain and support user preferences

Technical details

Main css changes which i have worked on

:root {
  /* Light mode color variables */
  --bg-primary: #f4f4f4;
  --bg-secondary: #ffffff;
  --text-primary: #1a1a1a;
}

:root.dark-mode {
  /* Dark mode color variables */
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --text-primary: #e0e0e0;
}

Toggle button using js idea

const applyDarkMode = (isDark) => {
  document.documentElement.classList.toggle('dark-mode', isDark);
  localStorage.setItem('theme', isDark ? 'dark' : 'light');
};

themeToggle.addEventListener('click', () => {
  const isDarkMode = document.documentElement.classList.contains('dark-mode');
  applyDarkMode(!isDarkMode);
});
gsoc openwisp gsoc openwisp1

@nemesifier please review it .

@Unnati-Gupta24 Unnati-Gupta24 changed the title [feature] [feature] Added a toggle button for dark mode and enhanced UI Dec 1, 2024
@Unnati-Gupta24 Unnati-Gupta24 linked a pull request Dec 1, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant