Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Item #1
It just goes round and round
Item #2
It just goes round and round
Item #3
It just goes round and round
Item #4
It just goes round and round
Item #5
It just goes round and round
Item #6
It just goes round and round
Item #7
It just goes round and round
css
@charset "UTF-8"; * { margin: 0; padding: 0; border: 0; outline: none; box-sizing: border-box; font-family: "Poppins", sans-serif; } html, body { height: 100vh; width: 100vw; background-color: #1f1f21; } .main { display: flex; height: 100vh; width: 100vw; flex-wrap: wrap; flex-direction: column; justify-content: center; align-items: center; } .navigation-circle { display: block; position: relative; height: 320px; width: 320px; margin: auto; } .navigation-circle__inner { display: block; position: relative; height: 100%; width: 100%; } .navigation-circle__list { display: block; position: absolute; height: 320px; width: 320px; transform: rotate(-90deg); animation: 2.2s cubic-bezier(0.25, -0.25, 0.35, 1) 0 1 animate-in-list forwards; } .navigation-circle-svg { display: block; position: absolute; top: 0; right: 0; bottom: 0; left: 0; transform: rotateZ(-90deg); } .navigation-circle-svg--opaque { opacity: 0.5; } .navigation-circle-svg--mask circle { transition: all 0.5s ease; transition-delay: 0.5s; animation: 2.2s ease 0 1 animate-in-svg-circle-mask backwards; } .navigation-circle-list-item { display: block; position: absolute; height: 0; width: calc(50% + 16px); top: 50%; left: 50%; list-style: none; transform-origin: 0 0; } .navigation-circle-list-item__point { display: block; position: absolute; height: 32px; width: 32px; top: -16px; right: 2px; cursor: pointer; transform: scale(0); } .navigation-circle-list-item__point:before { content: "?"; display: block; position: absolute; height: 32px; width: 32px; top: 0; color: #c644fc; background-color: #1f1f21; font-size: 12px; font-weight: 400; line-height: 32px; text-align: center; border: 2px solid #c644fc; border-radius: 50%; box-shadow: inset 0px 0px 0px 0px #c644fc; transform: scale(0.75); transition: all 0.5s ease; } .navigation-circle-list-item__point:after { content: ""; display: block; position: absolute; height: 1px; width: 0px; top: 18px; left: 31px; background-color: #c644fc; transition: all 0.5s ease; } .navigation-circle-list-item__meta { display: block; position: absolute; overflow: hidden; opacity: 0; transform-origin: center; margin-left: 78px; min-width: 68px; padding: 4px; } .navigation-circle-list-item__title { display: block; color: #f7f7f7; text-align: left; font-size: 10px; border-bottom: 1px solid #f7f7f7; padding-bottom: 4px; margin-bottom: 6px; } .navigation-circle-list-item__subtitle { display: block; color: #f7f7f7; text-align: center; font-weight: 200; font-size: 8px; } .navigation-circle-list-item:nth-of-type(1) { transform: rotateZ(calc((360deg / 7) * 1)); } .navigation-circle-list-item:nth-of-type(1) .navigation-circle-list-item__meta { transform: rotateZ(38.5714285714deg); } .navigation-circle-list-item:nth-of-type(1) .navigation-circle-list-item__point { animation: 1s cubic-bezier(0.55, -0.3, 0.6, 1.5) 0s 1 animate-in-list-item-point forwards; } .navigation-circle-list-item:nth-of-type(2) { transform: rotateZ(calc((360deg / 7) * 2)); } .navigation-circle-list-item:nth-of-type(2) .navigation-circle-list-item__meta { transform: rotateZ(-12.8571428571deg); } .navigation-circle-list-item:nth-of-type(2) .navigation-circle-list-item__point { animation: 1s cubic-bezier(0.55, -0.3, 0.6, 1.5) 0.2s 1 animate-in-list-item-point forwards; } .navigation-circle-list-item:nth-of-type(3) { transform: rotateZ(calc((360deg / 7) * 3)); } .navigation-circle-list-item:nth-of-type(3) .navigation-circle-list-item__meta { transform: rotateZ(-64.2857142857deg); } .navigation-circle-list-item:nth-of-type(3) .navigation-circle-list-item__point { animation: 1s cubic-bezier(0.55, -0.3, 0.6, 1.5) 0.4s 1 animate-in-list-item-point forwards; } .navigation-circle-list-item:nth-of-type(4) { transform: rotateZ(calc((360deg / 7) * 4)); } .navigation-circle-list-item:nth-of-type(4) .navigation-circle-list-item__meta { transform: rotateZ(-115.7142857143deg); } .navigation-circle-list-item:nth-of-type(4) .navigation-circle-list-item__point { animation: 1s cubic-bezier(0.55, -0.3, 0.6, 1.5) 0.6s 1 animate-in-list-item-point forwards; } .navigation-circle-list-item:nth-of-type(5) { transform: rotateZ(calc((360deg / 7) * 5)); } .navigation-circle-list-item:nth-of-type(5) .navigation-circle-list-item__meta { transform: rotateZ(-167.1428571429deg); } .navigation-circle-list-item:nth-of-type(5) .navigation-circle-list-item__point { animation: 1s cubic-bezier(0.55, -0.3, 0.6, 1.5) 0.8s 1 animate-in-list-item-point forwards; } .navigation-circle-list-item:nth-of-type(6) { transform: rotateZ(calc((360deg / 7) * 6)); } .navigation-circle-list-item:nth-of-type(6) .navigation-circle-list-item__meta { transform: rotateZ(-218.5714285714deg); } .navigation-circle-list-item:nth-of-type(6) .navigation-circle-list-item__point { animation: 1s cubic-bezier(0.55, -0.3, 0.6, 1.5) 1s 1 animate-in-list-item-point forwards; } .navigation-circle-list-item:nth-of-type(7) { transform: rotateZ(calc((360deg / 7) * 7)); } .navigation-circle-list-item:nth-of-type(7) .navigation-circle-list-item__meta { transform: rotateZ(-270deg); } .navigation-circle-list-item:nth-of-type(7) .navigation-circle-list-item__point { animation: 1s cubic-bezier(0.55, -0.3, 0.6, 1.5) 1.2s 1 animate-in-list-item-point forwards; } .navigation-circle-list-item:hover .navigation-circle-list-item__point:before { transform: scale(1); font-size: 16px; } .navigation-circle-list-item:hover .navigation-circle-list-item__point:after { width: 32px; left: 34px; } .navigation-circle-list-item:hover .navigation-circle-list-item__meta { opacity: 1; } .navigation-circle-list-item:active .navigation-circle-list-item__point:before, .navigation-circle-list-item.active .navigation-circle-list-item__point:before { transform: scale(0.85); color: #1f1f21; box-shadow: inset 0px 0px 0px 16px #c644fc; border-color: transparent; } .navigation-circle-list-item:active .navigation-circle-list-item__point:after, .navigation-circle-list-item.active .navigation-circle-list-item__point:after { width: 34px; left: 32px; } .navigation-circle-list-item:active .navigation-circle-list-item__meta, .navigation-circle-list-item.active .navigation-circle-list-item__meta { opacity: 1; } @keyframes animate-in-list { 0% { transform: rotate(-540deg); } 100% { transform: rotate(-90deg); } } @keyframes animate-in-svg-circle-mask { 0% { stroke-dashoffset: 1005; } 100% { stroke-dashoffset: 0; } } @keyframes animate-in-list-item-point { 0% { transform: scale(0); } 100% { transform: scale(1); } }
JavaScript
const pointCount = 7; const circleRadius = 160; const startAnimDelta = 5; const circumference = Math.PI * circleRadius * 2; var selectedItemIndex = -1; var circlePath = document.getElementById('mask-circle'); /** * @description On Mouse Leave event handler for points */ const onMouseLeave = () => { let index = (selectedItemIndex !== -1) ? selectedItemIndex : 0; calculateOffset(index); }; /** * @description On Click event handler for points * @param {Number} index - Index of list item */ const onClick = (index) => { //If already selected, deselect selectedItemIndex = (selectedItemIndex === index) ? -1 : index; calculateOffset(index); //Find active item, deselect let activeListItem = document.querySelectorAll('.navigation-circle-list-item.active'); if (activeListItem.length > 0) activeListItem[0].classList.remove('active'); //Find new item by index, select let listItem = document.querySelectorAll('.navigation-circle-list-item:nth-of-type(' + selectedItemIndex + ')'); if (listItem.length > 0) listItem[0].classList.add('active'); }; /** * @description - Calculate offset for circle path by index of list item * @param {Number} index - Index of list item */ const calculateOffset = (index=0) => { let offset = 0; if (index !== 0) offset = (circumference / pointCount) * (pointCount - index); circlePath.style.strokeDashoffset = `${offset}px`; }; // INTRO let buffer = 500; let delay = 1000 * (1 + (pointCount / startAnimDelta) - (1 / startAnimDelta)) + buffer; setTimeout(() => onClick(1), delay);
粒子
时间
文字
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号