Open Source

Let there be night… mode

For lab 5 of DPS909, we were tasked with implementing night mode to an open source project called Bridge Troll.

Bridge Troll is a browser based geolocation game that has the user unlocking bridges by getting within a certain distance of them.

day

As you can see it’s almost all white which can make it hard on the eyes when used during the night. This is the purpose of this feature.

One of the requirements of this feature is to have it switch between day and night mode is to avoid cluttering the UI with addition buttons or menus but instead use libraries , such as mourner’s suncalc, to determine if sun has set on the user’s current location. I have also looked for dark layout for the leaflet map along side appropriate icons to substitute into the application when it’s determined to be night time in the user’s current location. I had some difficulties putting it all together but this was more due to my editor than anything else. But I must say I am rather happy with the end product.

night

Leave a comment