New Site Navigation

I’m sorry I have not been writing daily these past few days. I had a patch installed to fix a birth defect in my heart, and I have been taking it pretty easy for the past few days. That being said I finally sat down and got some work done on the new website. In particular, I now have a way of scrolling through posts on both the devlog/blog and portfolio. The only catch is that the back button will not work unless you previously moved forward through items. The reason for that limitation is how JavaScript and NodeJS handle arrays, and the fact I am trying to limit how much information gets to the user.

In languages such as Python an index of ‘-1’ represents the final index of the array. Positive array values move forward through the array starting from the beginning of the array. Whereas negative array values move backwards through the array with the final element as the starting point. Unfortunately JavaScript does not support negative indices without some trickery. I decided to just keep it simple because if I ever do decide to retrieve posts in batches and process them client side then this code would need very little change. You can see a work in progress demonstration of the navigation system below. There will also be a system in place for mobile users too, but it is not demonstrated in this video.

Leave a comment

Your email address will not be published. Required fields are marked *