This is a pretty nice card trick I love to perform in real life. It's a mathematical trick. This is my result to convert it into javascript for the internet :)