评论资讯 [ 总 775 则 ]
·悄然 - 2026-1-17 10:21
·飞飞 - 2026-1-17 10:19
·马黑 - 2026-1-17 10:09
·飞飞 - 2026-1-15 16:20
·悄然 - 2026-1-15 16:19
·马黑 - 2026-1-15 12:19
·悄然 - 2026-1-15 08:58
·飞飞 - 2026-1-14 15:25
·飞飞 - 2026-1-1 08:43
·飞飞 - 2025-12-24 18:49
·飞飞 - 2026-1-17 10:19
·马黑 - 2026-1-17 10:09
·飞飞 - 2026-1-15 16:20
·悄然 - 2026-1-15 16:19
·马黑 - 2026-1-15 12:19
·悄然 - 2026-1-15 08:58
·飞飞 - 2026-1-14 15:25
·飞飞 - 2026-1-1 08:43
·飞飞 - 2025-12-24 18:49
友情链接
网站统计
CSS+HTML :金球藏娇
效果:
实现思路:背景图 + 两个伪元素半圆。代码:
<style>
#ball {
--size: 260px;
position: absolute;
margin: 200px calc(50% - var(--size) / 2);
width: var(--size);
height: var(--size);
background: url('https://638183.freep.cn/638183/t22/rabbit.gif') no-repeat center/cover;
filter: drop-shadow(6px 6px 20px #000);
}
#ball::before, #ball::after {
position: absolute;
content: '';
width: 100%;
height: 100%;
background: linear-gradient(45deg, gold, tan);
border-radius: 50%;
transition: 0.5s;
transform-origin: 50% 100%;
}
#ball::before {
clip-path: inset(0 50% 0 0);
}
#ball::after {
clip-path: inset(0 0 0 50%);
}
#ball:hover::before {
transform: rotate(-60deg);
}
#ball:hover::after {
transform: rotate(60deg);
}
</style>
<div id="ball"></div>
前一篇: 菇凉、竹子和CSS三维动画
下一篇: 《Amernan - Matsuri》代码解析
发表评论:
评论列表 [2条]
#2 | 悄然 于 2025-7-14 09:33 发布: 兔子是蛋孵出来的呀~好可爱~这是两只不一样的跳舞兔……看留言小球还有有不同的打开方式~后面再试
#1 | 知名不具 于 2025-7-12 12:48 发布: 这个方向的打开圆球好,连兔子的脚都看到了。

