dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

[Theme/Greeter] Custom theme depending on time of day (Light/Dark theme)

Open ghost opened this issue 4 years ago • 2 comments

There is already a mechanism for greetings that changes depending on the time of the day. Could that toggle a different theme as well? Classic theme in the morning/afternoon; dark theme in the evening and night.

Thanks for the useful dashboard.

ghost avatar May 18 '21 20:05 ghost

Hi,

sorry for responding to this so late.

This sounds like a good feature, but I'm unsure as to how i would implement it. I'll make note of it though.

phntxx avatar Jun 03 '21 11:06 phntxx

Glad to hear you like the concept! I'd say the simplest implementation would be to leverage the functions that determines the greeter using the time of the day:

https://github.com/phntxx/dashboard/blob/e67e14397df4c749e251c6b760bf448a3fe38a1e/src/components/greeter.tsx#L50-L63

Could be a simple if-else based on the returned greeter string:

https://github.com/phntxx/dashboard/blob/e67e14397df4c749e251c6b760bf448a3fe38a1e/src/data/greeter.json#L26-L47

ghost avatar Jun 04 '21 18:06 ghost