Nothing fancy here. When you click a box, it is moved to the front of the stack. Most recently clicked boxes at the front - so as you click other boxes, they will move back in the order they were clicked.
This awesome code ( changing order of flex boxes. ) is write by Aaron James Young, you can se more from this user in the personal repository
You can find the original code on Codepen.io
2018 © Aaron James Young