Actually I found this game on wappalyzer addon. I was fascinated to see it and started digging its code.
Wappalyzer is handy website useful for finding out the technology stack of any website.
Their browser addon is even more handy. but when the addon dont have anything to show this applet let you play tictactoe to alleviates the boredom.
You can embed this game is your site by using above snippet. Customize the syling elements as your need ofc.
All the source code can be found in my Codeberg Repo!
Honestly I am not a champion in this game but I am persistent in learning although I admit I had hard time winning this game at first but more I played the more I learn to defeat the Ai.