cc71e0d6ca
Added automatic dark mode detection to home.blade.php via a cookie with js.cookie.min.js (see previous commit). Detecting the dark mode setting is done with JavaScript. The script detects the preferred dark mode setting in the client's browser and saves it with a cookie. If the script detects a change in this setting, it corrects the cookie. Loading the appropriate skeleton.css is done via PHP with an if-else statement. If the cookie (saved by the previous script) color scheme equals 'dark' it will load skeleton-dark.css (found in /littlelink/css). If dark mode is not detected OR nothing is detected/cookie is getting blocked, the statement defaults to skeleton-light.css (also found in /littlelink/css). You could change what the if-else statement defaults to (i.e. which color scheme is loaded if the cookie fails to detect) by switching 'skeleton-dark.css' 'skeleton-light.css around' (see comment in if statement). Everything added is commented and marked with begin/end. Credit to 'user1575941' on Stack Overflow who's commented code REALLY helped getting behind all this. |
||
---|---|---|
.. | ||
css | ||
js | ||
lang/en | ||
views |