From cbc17db44c18a19702938b3fe70ea3de81d326ea Mon Sep 17 00:00:00 2001 From: "Alex Pooley (@zuedev)" Date: Mon, 1 Dec 2025 00:45:09 +0000 Subject: make it work --- source/about/public/tabAnimation.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 source/about/public/tabAnimation.js (limited to 'source/about/public/tabAnimation.js') diff --git a/source/about/public/tabAnimation.js b/source/about/public/tabAnimation.js new file mode 100644 index 0000000..f0040d0 --- /dev/null +++ b/source/about/public/tabAnimation.js @@ -0,0 +1,27 @@ +// animated tab +const animation = [ + { + emoji: "🌍", + title: "AROUND the world", + }, + { + emoji: "🌏", + title: "around THE world", + }, + { + emoji: "🌎", + title: "around the WORLD", + }, +]; + +let tabAnimationStep = 0; +const favicon = document.querySelector("link[rel='icon']"); +const updateTab = () => { + const currentAnimation = animation[tabAnimationStep % animation.length]; + favicon.href = `data:image/svg+xml,${currentAnimation.emoji}`; + document.title = currentAnimation.title; + tabAnimationStep++; + setTimeout(updateTab, 1000); +}; + +updateTab(); -- cgit v1.2.3