Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
:)
:|
:(
css
body, html { padding: 0; margin: 0; width: 100%; height: 100%; } body { min-height: 500px; background: #f5f5f5 } /* Buttons */ .buttons { width: 100%; max-width: 500px; margin: auto; text-align: center; padding: 50px 0 0; } button { background: #FFCD00; border: 0; color: #B57700; padding: 15px; min-width: 60px; font-size: 18px; font-weight: bold; margin: 10px } /* Smiley */ .smiley { background: linear-gradient(135deg, rgb(255, 233, 25) 0%, rgb(251, 192, 0) 100%); border-radius: 100%; padding: 25px; position: relative; width: 100px; height: 100px; left: 50%; top: 50%; transform: translateX(-50%) translateY(calc(-50% - 121px)); box-shadow: rgba(211, 165, 110, 0.498039) 0px 30px 30px 1px, rgb(245, 245, 245) 0px 20px 10px 1px; } .mouth { width: 60%; height: 30%; border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-left-radius: 100px; border-bottom-right-radius: 100px; box-sizing: border-box; position: absolute; bottom: 18%; left: 50%; margin-left: -30%; background: #B57700; -webkit-transition: all 300ms cubic-bezier(0.645, 0.045, 0.355, 1); transition: all 300ms cubic-bezier(0.645, 0.045, 0.355, 1); } .eyes { width: 100%; margin-top: 15%; box-sizing: border-box; padding: 0 5px; -webkit-transition: all 300ms cubic-bezier(0.645, 0.045, 0.355, 1); transition: all 300ms cubic-bezier(0.645, 0.045, 0.355, 1); } .eyes .eye { width: 20px; height: 20px; background: #B57700; float: left; border-radius: 100%; position: relative; } .eyes .eye:nth-of-type(2) { float: right; } .eyes .eye::after { content: ""; display: block; position: absolute; width: 0%; height: 0%; background: #fed800; transform: rotate(0deg); -webkit-transform: rotate(0deg); top: -15px; left: 5px; -webkit-transition: all 300ms cubic-bezier(0.645, 0.045, 0.355, 1); transition: all 300ms cubic-bezier(0.645, 0.045, 0.355, 1); } .eyes .eye:first-of-type::after { transform: rotate(0deg); -webkit-transform: rotate(0deg); left: auto; right: 5px; } /* Normal animation */ .smiley.normal .mouth { border-top-left-radius: 100px; border-top-right-radius: 100px; border-bottom-left-radius: 100px; border-bottom-right-radius: 100px; height: 10%; width: 40%; bottom: 25%; margin-left: -20%; } .smiley.normal .eyes { margin-top: 30% } /* angry animation */ .smiley.angry .mouth { width: 40%; height: 20%; border-top-left-radius: 100%; border-top-right-radius: 100%; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; bottom: 18%; left: 50%; margin-left: -20%; border-bottom: 0; } .smiley.angry .eyes { margin-top: 35% } .smiley.angry .eye::after { width: 120%; height: 50%; transform: rotate(-35deg); -webkit-transform: rotate(-35deg); top: -3px; left: -5px; border-radius: 0; } .smiley.angry .eye:first-of-type::after { transform: rotate(35deg); -webkit-transform: rotate(35deg); left: auto; right: -5px; } /* */ .smiley.happy .mouth { -webkit-animation: move-mouth-down .8s; animation: move-mouth-down .8s; -webkit-animation-delay: .3s; animation-delay: .3s; } @-webkit-keyframes move-mouth-down { 0% { bottom: 18%; } 35% { bottom: 16%; } 65% { bottom: 16%; } 100% { bottom: 18%; } } @keyframes move-mouth-down { 0% { bottom: 18%; } 35% { bottom: 16%; } 65% { bottom: 16%; } 100% { bottom: 18%; } } .smiley.happy .eyes { -webkit-animation: move-eyes-down .8s; animation: move-eyes-down .8s; -webkit-animation-delay: .3s; animation-delay: .3s; } @-webkit-keyframes move-eyes-down { 0% { margin-top: 15%; } 35% { margin-top: 19%; } 65% { margin-top: 19%; } 100% { margin-top: 15%; } } @keyframes move-eyes-down { 0% { margin-top: 15%; } 35% { margin-top: 19%; } 65% { margin-top: 19%; } 100% { margin-top: 15%; } } .smiley.happy .eye:nth-of-type(2) { height: 20px; margin-top: 0; -webkit-animation: wink .8s; animation: wink .8s; -webkit-animation-delay: .3s; animation-delay: .3s; } @-webkit-keyframes wink { 0% { height: 20px; margin-top: 0; } 35% { height: 3px; margin-top: 8px; } 65% { height: 3px; margin-top: 8px; } 100% { height: 20px; margin-top: 0; } } @keyframes wink { 0% { height: 20px; margin-top: 0; } 30% { height: 3px; margin-top: 8px; } 70% { height: 3px; margin-top: 8px; } 100% { height: 20px; margin-top: 0; } } .smiley.normal .eye { height: 20px; margin-top: 0; -webkit-animation: blink .6s; animation: blink .6s; -webkit-animation-delay: .3s; animation-delay: .3s; } @-webkit-keyframes blink { 0% { height: 20px; margin-top: 0; } 25% { height: 3px; margin-top: 8px; } 50% { height: 20px; margin-top: 0; } 75% { height: 3px; margin-top: 8px; } 100% { height: 20px; margin-top: 0; } } @keyframes blink { 0% { height: 20px; margin-top: 0; } 25% { height: 2px; margin-top: 8px; } 50% { height: 20px; margin-top: 0; } 75% { height: 2px; margin-top: 8px; } 100% { height: 20px; margin-top: 0; } } .smiley.angry .eyes, .smiley.angry .mouth { -webkit-animation: move-angry-head .6s; animation: move-angry-head .6s; -webkit-animation-delay: .3s; animation-delay: .3s; } @-webkit-keyframes move-angry-head { 0% { -webkit-transform: translateX(0%); } 20% { -webkit-transform: translateX(-20%); } 40% { -webkit-transform: translateX(15%); } 60% { -webkit-transform: translateX(-10%); } 80% { -webkit-transform: translateX(5%); } 100% { -webkit-transform: translateX(0%); } } @keyframes move-angry-head { 0% { transform: translateX(0%); } 20% { transform: translateX(-20%); } 40% { transform: translateX(15%); } 60% { transform: translateX(-10%); } 80% { transform: translateX(5%); } 100% { transform: translateX(0%); } }
JavaScript
$(function() { $(".normal-button").click(function() { $(".smiley").addClass("normal", 500); $(".smiley").removeClass("happy", 500); $(".smiley").removeClass("angry", 500); }); }); $(function() { $(".angry-button").click(function() { $(".smiley").addClass("angry", 500); $(".smiley").removeClass("happy", 500); $(".smiley").removeClass("normal", 500); }); }); $(function() { $(".happy-button").click(function() { $(".smiley").addClass("happy", 500); $(".smiley").removeClass("angry", 500); $(".smiley").removeClass("normal", 500); }); });
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>CSS笑脸-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号