此页脚组件通过引人入胜的动画展示社交媒体图标。 悬停时,图标会巧妙地向上浮动并旋转,显示下面相应的平台名称。
现场演示
演示会动态调整您的系统主题(浅色或深色)。
源代码(footer-animation.tsx)
<code class="language-typescript">import { Send } from "lucide-react"; export function Footer() { return ( <div className="w-full flex justify-between items-center"> {/* Email Section */} <div className="flex items-center gap-2"> <Send className="h-7 w-7" /> <a className="text-2xl hover:underline" href="mailto:hello@brokariim.space">hello@brokariim.space</a> </div> {/* Social Icons */} <div className="flex items-center relative"> <a className="relative group grid place-items-center" href="#"> <div className="rotate-6 group-hover:-rotate-12 group-hover:-translate-y-6 transition duration-500 hover:duration-200 rounded-xl grid place-items-center"> <img alt="Whatsapp Icon" className="w-16 h-16" src="/wa3d.png" /> </div> Whatsapp </a> <a className="relative group grid place-items-center" href="#"> <div className="-rotate-6 group-hover:-rotate-12 group-hover:-translate-y-6 transition duration-500 hover:duration-200 rounded-xl grid place-items-center"> <img alt="Instagram Icon" className="w-16 h-16" src="/ig3d.png" /> </div> Instagram </a> <a className="relative group grid place-items-center" href="#"> <div className="rotate-6 group-hover:-rotate-12 group-hover:-translate-y-6 transition duration-500 hover:duration-200 rounded-xl grid place-items-center"> <img alt="Discord Icon" className="w-16 h-16" src="/dc3d.png" /> </div> Discord </a> <a className="relative group grid place-items-center" href="#"> <div className="-rotate-6 group-hover:-rotate-12 group-hover:-translate-y-6 transition duration-500 hover:duration-200 rounded-xl grid place-items-center"> <img alt="LinkedIn Icon" className="w-16 h-16" src="/ln3d.png" /> </div> LinkedIn </a> <a className="relative group grid place-items-center" href="#"> <div className="rotate-6 group-hover:-rotate-12 group-hover:-translate-y-6 transition duration-500 hover:duration-200 rounded-xl grid place-items-center"> <img alt="TikTok Icon" className="w-16 h-16" src="/tiktok3d.png" /> </div> TikTok </a> </div> </div> ); }</code>
归属:
此修订版本提高了代码清晰度,向图像添加了替代文本以方便访问,并纠正了较小的格式问题。 为了保持一致性,电子邮件地址也已更新。
以上是使用打字稿和顺风的动画页脚和浮动图标的详细内容。更多信息请关注PHP中文网其他相关文章!