-
-
Notifications
You must be signed in to change notification settings - Fork 792
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
Dynamic Material Theme (Dark/Light) #1380
Conversation
Fixed few issues and restyled back to top button
Thanks for the PR! I'm traveling for the next few days - will give this a closer look when I return. |
In the minimal testing I've done the 'theme' cookie value isn't being set for some reason. |
@marek-guran new themes also need to be defined here: raspap-webgui/app/js/custom.js Lines 562 to 567 in 4bb1873
|
Yes, I found out about this yesterday. For some reason it's not able to change to my themes, I am currently troubleshooting it and trying to make it work. |
Still cant change themes in settings
Managed to make it work, for some reason it wasnt switching because of some caching so it did not get updated (even after today commit). Then reloaded the page on one device (cleaned cache) and it switched themes correctly. But other device lets say phone that had it cached, refused to change it. |
Yes, the issue is that the whole layout of items placed are basically cards on cards and it makes that effect. Basically it could be hidden, but if I did it... I might break default themes. I will try to fix it and not break them. Will take a look on it and mark this as draft until the issue is not resolved and you don't get spammed by my commits. I got an idea with the lazy way and adding in CSS for the header and footer the 18 px down and up so it could overlap the cards or make the footer and header to be floating on top of them and then giving them defined space which would hide the unwanted corners. |
Removed dark theme since it will be enabled by switch at top bar
Updated dark theme switcher so now it can switch between dark and light material theme while keeping it's functionality to stock theme.
1. The rounded corners issue is gone 2. Fixed light theme status indicator, so on latest insiders it wont hide active green button 3. Added new visuals to navigation menu to make it more clear what card is active
The issue is fixed and improved both themes. Now it is in settings as one theme and can be switchable by the dark theme switcher. Also fixed for insiders light theme (changed background color to secondary color) for status indicator button that switched from text to icon. Also the navigation menu got improved indicators for active items, so it is more clear to see what is active. Material Theme (Non insiders look)material-noninsiders-look.mp4Material Theme (Insiders look)material-insiders-look.mp4 |
Nice work. You can also apply your theme colors to the link quality graph, if you wish. raspap-webgui/app/js/linkquality.js Lines 3 to 6 in dee77c7
I've considered changing the |
Sure, will take a look on it. |
So I tried to implement it, I tried many ways but made it furthest with adding this to theme:
This basically saves the colors to .json which looks for example like this:
Then I was trying to load them by that JavaScript code with:
But no matter what I tried... For some reason it loaded full black or white colors for link quality. Most likely will have to use hard coded values to make it readable on all color schemes. But will try to make it work. If you have any suggestions or see any errors in my way how I want to achieve these colors, please let me know. |
includes/system.php
Outdated
]; | ||
$selectedTheme = array_search($_COOKIE['theme'], $themeFiles); | ||
|
||
// widget options | ||
$widgetOpt = $_SESSION["widgetOpt"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$widgetOpt is from the Insiders edition 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$widgetOpt is from the Insiders edition 😉
Sorry my bad, didnt notice it here when i was copying the files to github. Now it is fixed and also made it the easy way and hard coded the color values. Now it uses white with transparency also. Chose this variant since it looked to me like best for both versions.
No problem, for this PR it's not an issue. Post-merge I'll set the background color to transparent. |
Added hard coded colors to material theme. Now it is more readable on dark and light versions.
@marek-guran well done! we're good to merge. this is a great contribution to the project |
@marek-guran looks like the modal dialog could use some attention. Not super critical, so rather than create a new issue I thought I'd mention it here. |
Oh... Will fix this once I find time for it. |
Hey, just commenting to let you know that I didn't forget about this issue. I just didn't find time to fix this yet. It is still on my mind in To Do things. |
About
Material You Inspired dark and light theme, which supports both stable and insiders versions. It uses PHP to calculate colors from color picker in system tab.
⚠ Themes support only dark color pallete, light color pallete will make everything unreadable
❌ Wasnt able to make them switchable by settings
Screenshots - PC (light)
Screenshots - PC (dark)
Screenshots - Mobile (light)
Screenshots - Mobile (dark)