Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Fun facts about
<coding>
css
body { background-color: #ff5d73; padding-bottom: 3em; } .heading__container { position: relative; top: 5em; left: 50%; -webkit-transform: translate(-50%); transform: translate(-50%); width: 430px; height: 165px; } .heading { position: absolute; top: 0; right: 0; width: 300px; display: inline-block; margin-top: 0; padding-bottom: 7px; font-family: 'Poppins', sans-serif; font-size: 2.1em; font-weight: 600; color: #fff; text-align: right; } .heading:before { content: ""; position: absolute; left: -130px; bottom: -0.2em; width: 430px; height: 0.02em; background-color: #fff; } .bold { display: inline-block; line-height: 0.6; font-family: 'Oswald', sans-serif; font-size: 1.5em; font-weight: 300; color: #fff838; } .facts__container { position: absolute; bottom: -2em; left: 0; width: 430px; height: 78px; background-color: #fff; border-radius: 5px; box-shadow: 0 20px 18px -25px #555; } .icon { box-sizing: border-box; display: inline-block; height: 100%; padding: 15px; background-color: #12b48c; border-top-left-radius: 5px; border-bottom-left-radius: 5px; position: absolute; left: 0; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); overflow-y: hidden; } .fa.fa-code, .fa.fa-google, .fa.fa-child, .fa.fa-mortar-board, .fa.fa-bug, .fa.fa-lightbulb-o, .fa.fa-headphones, .fa.fa-keyboard-o { height: auto; color: #fff; line-height: 46px; -webkit-animation: animateEl 5s infinite; animation: animateEl 5s infinite; } .fa-2x { font-size: 2.5em; } .text__container { box-sizing: border-box; width: 320px; height: auto; padding: 5px 0; position: absolute; left: 98px; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); overflow-y: hidden; } .text { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 400; font-size: 1em; color: #12b48c; position: relative; -webkit-animation: animateEl 5s infinite; animation: animateEl 5s infinite; } footer { width: 100%; height: 50px; padding: 1em 0; background-color: #ff5d73; position: relative; top: 10em; text-align: center; } .footer__text { font-family: 'Poppins', sans-serif; font-weight: 400; font-size: 0.9em; color: #fff; } .footer__text a { text-decoration: none; color: #fff838; } @-webkit-keyframes animateEl { 0% { -webkit-transform: translateY(2em); transform: translateY(2em); opacity: 0; } 8% { -webkit-transform: translateY(-0.3em); transform: translateY(-0.3em); opacity: 1; } 13% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; } 87% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; } 93% { -webkit-transform: translateY(0.5em); transform: translateY(0.5em); opacity: 1; } 100% { -webkit-transform: translateY(-2em); transform: translateY(-2em); opacity: 0; } } @keyframes animateEl { 0% { -webkit-transform: translateY(2em); transform: translateY(2em); opacity: 0; } 8% { -webkit-transform: translateY(-0.3em); transform: translateY(-0.3em); opacity: 1; } 13% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; } 87% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; } 93% { -webkit-transform: translateY(0.5em); transform: translateY(0.5em); opacity: 1; } 100% { -webkit-transform: translateY(-2em); transform: translateY(-2em); opacity: 0; } } @media screen and (min-width: 320px) and (max-width: 480px) { .heading__container { width: 280px; top: 3em; } .heading { width: auto; } .heading:before { width: 300px; left: 50%; -webkit-transform: translate(-50%); transform: translate(-50%); } .facts__container { width: 300px; height: 110px; bottom: -4em; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); } .text__container { left: 88px; width: 200px; padding: 10px 0; } .text { line-height: 1.3; } .icon { padding-left: 10px; padding-right: 10px; } .fa.fa-code, .fa.fa-google, .fa.fa-child, .fa.fa-mortar-board, .fa.fa-bug, .fa.fa-lightbulb-o, .fa.fa-headphones, .fa.fa-keyboard-o { line-height: 1.9; } }
JavaScript
(function(){ var iconList = [ "fa-code", "fa-google", "fa-child", "fa-bug", "fa-keyboard-o", "fa-headphones", "fa-lightbulb-o", "fa-mortar-board" ]; var factsList = [ "It's never too late to learn to code.", "When learning to code, Google is your best friend.", "You feel like a super hero when fixing a bug in your code.", "Sometime code is full of bugs.", "It can turn from hobby to addiction in no time.", "Coding often ocupies your mind even when you are doing something else.", "It develops a creative thinker in you, don't underestimate it.", "There is always something new to learn, coding is a lifetime learning process." ]; function createElement(text, icon){ var p = document.querySelector(".text"); p.textContent = text; var span = document.querySelector(".icon span"); span.className = ""; span.classList.add("fa", icon, "fa-2x", "fa-fw"); } var i = 0; var length = factsList.length; var delayTime = 5000; function nextFact(){ var fact = factsList[i]; var icon = iconList[i]; createElement(fact, icon); i++; if(i >= length){ i = 0; } setTimeout(nextFact, delayTime); } nextFact(); })();
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>文字滚动带图标-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号