I’ve been trying to add dark mode to my website using Wix Corvid. But, to no avail.
Is there a step by step easy to follow tutorial? I’ve already tried https://heathh-m.wixsite.com/wix-code-extracts/forum/tips-updates/dark-mode - it doesn’t seem to work. Please help!
Hi! I can help you put dark mode on your website.
~Haiden~
Here is the link: https://www.wix.com/corvid/example/dark-mode
~Haiden~
No need to add all of the code for it in the forum itself, just add the link for the example which the forum poster can open up themselves in their own Wix Editor with all the code and elements set up for them.
Also, note that the example in the original link will only change the background of the site as it only applies to the document, it does not change anything else on the page itself, whereas the Wix tutorial covers all of the site and not just the document only.
$w.onReady(function () {
$w('#darkModeSwitch').onChange(function () {
if ($w('#darkModeSwitch').checked) {
$w('Document').background.src = "https://dummyimage.com/1/000000" $w('#darkModeState').text = "Dark Mode On"
} else {
$w('Document').background.src = "https://dummyimage.com/1/555555" $w('#darkModeState').text = "Dark Mode Off" }
});
});
Read here about Document.
A complete web page, which consists of a Header, Page, and Footer.
Can you please help me with it? I’ve been having trouble