Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
css
:root { --tab-background: hsl(0deg, 33%, 99%); --background: hsl(313deg, 96%, 10%); --stroke-color: hsl(358deg, 99%, 65%); } body { display: -webkit-box; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; min-height: 100vh; margin: 0; padding: 20px; box-sizing: border-box; background: var(--background); } svg:not(.twitter-icon) { color: var(--stroke-color); height: inherit; fill: var(--tab-background); stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; position: absolute; } #container { --r: 50px; min-width: 400px; width: 400px; max-width: 400px; height: 380px; display: -webkit-box; display: flex; -webkit-box-align: end; align-items: flex-end; border-radius: 2px 2px var(--r) var(--r); overflow: hidden; } #tab { background: var(--tab-background); width: inherit; height: 120px; border-radius: inherit; padding: 20px 80px; box-sizing: border-box; position: relative; display: -webkit-box; display: flex; -webkit-box-pack: justify; justify-content: space-between; -webkit-box-align: center; align-items: center; } .icon { width: 38px; height: 38px; position: relative; z-index: 5; cursor: pointer; } .icon.active.box .l1, .icon.active.home .l1, .icon.active.calender .l1 { --in: -252px; -webkit-animation: in 0.4s 1.1s forwards, landed 0.5s 1.5s forwards; animation: in 0.4s 1.1s forwards, landed 0.5s 1.5s forwards; } .icon.active.box .l2 { --in: -212px; } .icon.active.box .l3 { --in: -200px; } .icon.active.home .l2 { --in: -216px; -webkit-animation: in 0.26s 1.14s forwards, landed 0.5s 1.5s forwards; animation: in 0.26s 1.14s forwards, landed 0.5s 1.5s forwards; } .icon.active.box .l2, .icon.active.box .l3, .icon.active.calender .l2, .icon.active.calender .l3 { -webkit-animation: in 0.3s 1.1s forwards, landed 0.5s 1.5s forwards; animation: in 0.3s 1.1s forwards, landed 0.5s 1.5s forwards; } .icon.active.calender .l2 { --in: -190px; } .icon.active.calender .l3 { --in: -214px; } .icon.active .l1 svg { -webkit-animation: out 0.1s 1s forwards, in_again 0.2s 1.6s forwards; animation: out 0.1s 1s forwards, in_again 0.2s 1.6s forwards; } .icon:not(.active) { -webkit-animation: back 0.2s forwards; animation: back 0.2s forwards; } @-webkit-keyframes in { 50% { -webkit-transform: translateY(calc(var(--in) + 10px)); transform: translateY(calc(var(--in) + 10px)); } 100% { -webkit-transform: translateY(var(--in)); transform: translateY(var(--in)); } } @keyframes in { 50% { -webkit-transform: translateY(calc(var(--in) + 10px)); transform: translateY(calc(var(--in) + 10px)); } 100% { -webkit-transform: translateY(var(--in)); transform: translateY(var(--in)); } } @-webkit-keyframes out { 100% { fill: transparent; } } @keyframes out { 100% { fill: transparent; } } @-webkit-keyframes landed { 70% { -webkit-transform: translateY(-55px); transform: translateY(-55px); } 100% { -webkit-transform: translateY(-59px); transform: translateY(-59px); } } @keyframes landed { 70% { -webkit-transform: translateY(-55px); transform: translateY(-55px); } 100% { -webkit-transform: translateY(-59px); transform: translateY(-59px); } } @-webkit-keyframes in_again { 100% { fill: var(--tab-background); } } @keyframes in_again { 100% { fill: var(--tab-background); } } @-webkit-keyframes back { 0% { -webkit-transform: translateY(-59px); transform: translateY(-59px); } 100% { -webkit-transform: translateY(0px); transform: translateY(0px); } } @keyframes back { 0% { -webkit-transform: translateY(-59px); transform: translateY(-59px); } 100% { -webkit-transform: translateY(0px); transform: translateY(0px); } } .box .l2 svg { fill: transparent; } .home .l2 svg { -webkit-transform: translateY(-1px); transform: translateY(-1px); fill: transparent; } .circle { --s: 86px; width: var(--s); height: var(--s); border-radius: var(--s); -webkit-transform: translateX(0); transform: translateX(0); position: absolute; top: -34%; left: 56px; display: -webkit-box; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; } .circle[data-active="0"] { -webkit-transform: translateX(0); transform: translateX(0); } .circle[data-active="1"] { -webkit-transform: translateX(101px); transform: translateX(101px); } .circle[data-active="2"] { -webkit-transform: translateX(202px); transform: translateX(202px); } .circle[data-animating="true"] { -webkit-animation: landY 0.5s forwards, moveX 0.5s 0.5s forwards, jumpY 0.5s 1s forwards, landedY 0.5s 1.5s forwards; animation: landY 0.5s forwards, moveX 0.5s 0.5s forwards, jumpY 0.5s 1s forwards, landedY 0.5s 1.5s forwards; } .circle[data-animating="true"] > .circle-inner::before { -webkit-transform: scale(0); transform: scale(0); -webkit-animation: scale 0.3s 1.2s forwards; animation: scale 0.3s 1.2s forwards; } @-webkit-keyframes landY { 100% { top: 80%; } } @keyframes landY { 100% { top: 80%; } } @-webkit-keyframes moveX { 100% { -webkit-transform: translateX(var(--x)); transform: translateX(var(--x)); } } @keyframes moveX { 100% { -webkit-transform: translateX(var(--x)); transform: translateX(var(--x)); } } @-webkit-keyframes jumpY { 100% { top: -62%; } } @keyframes jumpY { 100% { top: -62%; } } @-webkit-keyframes landedY { 70% { top: -30%; } 100% { top: -34%; } } @keyframes landedY { 70% { top: -30%; } 100% { top: -34%; } } .circle-inner { width: inherit; height: inherit; border-radius: inherit; } .circle-inner::before, .circle-inner::after { content: ""; display: inline-block; width: inherit; height: inherit; border-radius: inherit; -webkit-transform-origin: center center; transform-origin: center center; position: absolute; } .circle-inner::before { background: var(--tab-background); opacity: 0.1; -webkit-transform: scale(1.4); transform: scale(1.4); } .circle-inner::after { background: var(--stroke-color); } @-webkit-keyframes scale { 0% { -webkit-transform: scale(1); transform: scale(1); } 100% { -webkit-transform: scale(1.4); transform: scale(1.4); } } @keyframes scale { 0% { -webkit-transform: scale(1); transform: scale(1); } 100% { -webkit-transform: scale(1.4); transform: scale(1.4); } } .abs-twitter { position: fixed; right: calc(24px + .6vw); top: calc(22px + .6vw); -webkit-transform: translate(-8px, 4px); transform: translate(-8px, 4px); opacity: 0; -webkit-transition: .3s ease-in; transition: .3s ease-in; } .abs-twitter--show { -webkit-transform: translate(0, 0); transform: translate(0, 0); opacity: 1; -webkit-animation: birdie 1s .8s linear infinite; animation: birdie 1s .8s linear infinite; } @-webkit-keyframes birdie { 13% { -webkit-transform: rotate(14deg); transform: rotate(14deg); } 26% { -webkit-transform: rotate(28deg); transform: rotate(28deg); } 100% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } } @keyframes birdie { 13% { -webkit-transform: rotate(14deg); transform: rotate(14deg); } 26% { -webkit-transform: rotate(28deg); transform: rotate(28deg); } 100% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } }
JavaScript
// By @AbubakerSaeed96 (Twitter) // ================================================================ // Helpers // ======= const $ = (e) => document.querySelector(e); const $$ = (e) => document.querySelectorAll(e); // Main // ==== const t = $("#tab"); const ics = $$(".icon"); const c = $(".circle"); let s = { animating: false, animated: true, }; // On Load setTimeout(() => { ics[1].removeAttribute("style"); ics[2].removeAttribute("style"); c.removeAttribute("style"); c.setAttribute("data-animating", "false"); }, 2000); // On Event ics.forEach((i, index) => { i.addEventListener("click", ({ target }) => { if (s.animated === true && index != c.getAttribute("data-active")) { t.style.setProperty("--x", target.getAttribute("data-x") * 101 + "px"); $(".active").classList.remove("active"); i.classList.add("active"); c.setAttribute("data-animating", "true"); s.animating = true; s.animated = false; setTimeout(() => { c.setAttribute("data-active", index); c.setAttribute("data-animating", "false"); s.animating = false; s.animated = true; }, 2000); } }); }); // Professional Abubaker ;P // ===================== const twitter = $(".abs-twitter"); window.addEventListener( "mousemove", () => twitter.classList.add("abs-twitter--show"), { once: true } );
粒子
时间
文字
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号