在2014年的圣诞节,爱编程小编给大家分分享一款纯css3实现的雪人动画特效。该实例实现一个雪人跳动的特效,效果图如下:
在线预览 源码下载
实现的代码。
html代码:
<span class="text">lolwut<small>-@rsmswlln</small></span> <div class="body"> <div class="hat"> <div class="ribbon"> </div> </div> <div class="face"> </div> <div class="scarf"> </div> <div class="right-arm"> <div class="hand"> </div> </div> <div class="left-arm"> <div class="hand"> </div> </div> </div> <div class="puddle"> </div>
css代码:
body { background: #c0392b;}.body { width: 250px; height: 250px; background: #ffffff; border-radius: 50%; box-shadow: inset -20px -5px 35px rgba(0, 0, 0, 0.2); position: absolute; right: 0; left: 0; margin: 300px auto; animation: jump 1s infinite;}.body:before { z-index: 2; content: ""; width: 180px; height: 180px; background: #ffffff; border-radius: 50%; box-shadow: inset -10px -5px 10px rgba(0, 0, 0, 0.2); position: relative; display: inline-block; top: -120px; left: 25px;}.body:after { content: ""; width: 140px; height: 140px; background: #ffffff; border-radius: 50%; box-shadow: inset -10px -5px 10px rgba(0, 0, 0, 0.2); position: relative; display: inline-block; top: -400px; left: 20px;}.body > .hat { width: 200px; height: 15px; border-radius: 50%; background-color: #111111; position: absolute; z-index: 4; top: -200px; left: -15px;}.body > .hat:before { content: ""; width: 100px; height: 65px; background-color: #111111; display: inline-block; position: relative; top: -55px; left: 51px;}.body > .hat:after { z-index: 5; content: ""; display: inline-block; position: relative; top: -145px; left: 51px; width: 100px; height: 5px; border-radius: 50%; background-color: #2b2b2b;}.body > .hat > .ribbon { height: 10px; width: 100px; background-color: #6d2018; position: relative; top: -90px; left: 51px; z-index: 6;}.body > .face { z-index: 3; width: 12px; height: 12px; background-color: #2c3e50; border-radius: 50%; position: absolute; top: -170px; left: 38px;}.body > .face:before { content: ""; background-color: transparent; display: inline-block; position: relative; top: 30px; left: -45px; transform: rotate(-15deg); border-top: 12px solid transparent; border-bottom: 12px solid transparent; border-right: 40px solid #e67e22;}.body > .face:after { content: ""; background-color: transparent; display: inline-block; position: relative; top: 0; left: -46px; transform: rotate(-15deg); border-top: 12px solid transparent; border-right: 40px solid #bf6516;}.body > .scarf { z-index: 3; width: 150px; height: 30px; background-color: #2980b9; position: absolute; top: -110px; left: 25px; transform: rotate(-15deg); border-radius: 20%;}.body > .scarf:after { content: ""; width: 75px; height: 30px; background-color: #2980b9; display: inline-block; position: relative; top: 16px; left: 80px; transform: rotate(85deg); border-radius: 20%;}.body > .left-arm,.body .right-arm { z-index: 7; width: 100px; height: 6px; background-color: #825a2c; position: absolute; top: 10px; left: -20px; transform: rotate(-15deg); animation: rub-right 0.5s infinite;}.body > .left-arm > .hand,.body .right-arm > .hand { width: 25px; height: 6px; background-color: #825a2c; position: absolute; top: -32px; left: -60px; transform: rotate(75deg);}.body > .left-arm:after,.body .right-arm:after { content: ""; width: 75px; height: 6px; background-color: #a87439; display: inline-block; position: relative; top: -24px; left: -70px; transform: rotate(25deg);}.body > .left-arm.left-arm,.body .right-arm.left-arm { background-color: #a87439; animation: rub-left 0.5s infinite; top: -15px; z-index: 1;}.body > .left-arm.left-arm > .hand,.body .right-arm.left-arm > .hand { background-color: #a87439; top: -14px; transform: rotate(45deg);}.body > .left-arm.left-arm:after,.body .right-arm.left-arm:after { background-color: #825a2c; transform: rotate(5deg); top: -12px; left: -74px;}.puddle { z-index: -1; width: 200px; height: 100px; background: #2980b9; border-radius: 50%; position: absolute; right: 0; left: -50px; margin: 500px auto;}.puddle:after { content: ""; width: 120px; height: 80px; display: inline-block; border-radius: 50%; left: 150px; position: relative; background-color: #2980b9;}.text { text-align: center; font-family: 'Lobster', cursive; font-size: 74px; display: inline-block; transform: rotate(-15deg); position: absolute; margin: 50px 30px; color: #ffffff; text-shadow: 3px 3px 2px rgba(0, 0, 0, 0.5);}.text > small { font-size: 20px; display: block;}@keyframes rub-left { 0% { margin-left: 0px; margin-top: 0; } 50% { margin-left: 5px; margin-top: 1px; } 100% { margin-left: 0px; margin-top: 0; }}@keyframes rub-right { 0% { margin-left: 4px; } 50% { margin-left: 0px; } 100% { margin-left: 4px; }}@keyframes jump { 0% { margin: 300px auto; } 40% { margin: 250px auto; } 80% { margin: 300px auto; }}
via:http://www.w2bc.com/Article/13508

公众号网页更新缓存,这玩意儿,说简单也简单,说复杂也够你喝一壶的。你辛辛苦苦更新了公众号文章,结果用户打开还是老版本,这滋味,谁受得了?这篇文章,咱就来扒一扒这背后的弯弯绕绕,以及如何优雅地解决这个问题。读完之后,你就能轻松应对各种缓存难题,让你的用户始终体验到最新鲜的内容。先说点基础的。网页缓存,说白了就是浏览器或者服务器为了提高访问速度,把一些静态资源(比如图片、CSS、JS)或者页面内容存储起来。下次访问时,直接从缓存里取,不用再重新下载,速度自然快。但这玩意儿,也是个双刃剑。新版本上线,

本文讨论了使用HTML5表单验证属性,例如必需的,图案,最小,最大和长度限制,以直接在浏览器中验证用户输入。

本文展示了使用CSS为网页中添加有效的PNG边框。 它认为,与JavaScript或库相比,CSS提供了出色的性能,详细介绍了如何调整边界宽度,样式和颜色以获得微妙或突出的效果

本文讨论了html&lt; datalist&gt;元素,通过提供自动完整建议,改善用户体验并减少错误来增强表格。Character计数:159

本文讨论了HTML&lt; Progress&gt;元素,其目的,样式和与&lt; meter&gt;元素。主要重点是使用&lt; progress&gt;为了完成任务和LT;仪表&gt;对于stati

本文解释了HTML5&lt; time&gt;语义日期/时间表示的元素。 它强调了DateTime属性对机器可读性(ISO 8601格式)的重要性,并在人类可读文本旁边,增强Accessibilit

本文讨论了HTML&lt; meter&gt;元素,用于在一个范围内显示标量或分数值及其在Web开发中的常见应用。它区分了&lt; meter&gt;从&lt; progress&gt;和前


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

螳螂BT
Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

Dreamweaver Mac版
视觉化网页开发工具