Forum Discussion
Dark Mode via States & Variables
Hi there,
First time posting here. I am working on a Dark Mode using States and Variables. I was playing with a few things and had it working, then I guess somewhere along the way I messed it up and can't seem to get it back on track again.
Essentially, I've done the following on a Feedback Master Layer:
- Made a navigation bar with a Light/Dark state
- Created a "DarkMode" True/False variable
- Added a button with a trigger: When user clicks button = adjust variable DarkMode to True
- If variable DarkMode = True, Change State of Rectangle to Dark (Added Dark State)
I can get that all working fine. But what I can't seem to get working is having it carry over to other slides (For example, if DarkMode = True, DarkMode should carry to all slides until DarkMode = False). So on my non-master I tried setting
- Layer to automatically show (Works)
- Turned off "reset initial state" in layer proprties
- Set trigger (on the layer): Adjust variable to DarkMode when Timeline Starts on This Layer if DarkMode = True
Any ideas? Dummy slides added below since my working file is confidential.
- RonPricePartner
Interesting design - It seems to me that the "toggle" triggers for true/false variable and a selected state will serve you better. See attachment
- MattBotelhoCommunity Member
Funny, I was just playing with the toggle option as you replied - this is perfect, I'll give it a go in my live workspace shortly.
Thank you Ron!
- RonPricePartner
a dummy file would be great to see.
- MattBotelhoCommunity Member
Hi Ron,
Drew this up quick - hope this helps. As you can see, the logic works to toggle it on/off. Then when you move over to the next slide, the Nav Bar resets to white and my Dark Mode button can no longer be touched, whether you go backward or forward - the button becomes null.