国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

分享一個(gè)菜單標(biāo)簽頁(yè)動(dòng)畫,切換絲滑無比

這篇具有很好參考價(jià)值的文章主要介紹了分享一個(gè)菜單標(biāo)簽頁(yè)動(dòng)畫,切換絲滑無比。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

先上效果圖:
分享一個(gè)菜單標(biāo)簽頁(yè)動(dòng)畫,切換絲滑無比
代碼如下,復(fù)制粘貼大法拿走即可使用:文章來源地址http://www.zghlxwxcb.cn/news/detail-426232.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>

        html {
            box-sizing: border-box;
            --bgColorMenu : #1d1d27;
            --duration: .7s;
        }

        html *,
        html *::before,
        html *::after {
            box-sizing: inherit;
        }

        body{
            margin: 0;
            display: flex;
            height: 100vh;
            overflow: hidden;
            align-items: center;
            justify-content: center;
            background-color: #ffb457;
            -webkit-tap-highlight-color: transparent;
            transition: background-color var(--duration);
        }

        .menu{
            margin: 0;
            display: flex;
            /* Works well with 100% width  */
            width: 32.05em;
            font-size: 1.5em;
            padding: 0 2.85em;
            position: relative;
            align-items: center;
            justify-content: center;
            background-color: var(--bgColorMenu);
        }

        .menu__item{
            all: unset;
            flex-grow: 1;
            z-index: 100;
            display: flex;
            cursor: pointer;
            position: relative;
            border-radius: 50%;
            align-items: center;
            will-change: transform;
            justify-content: center;
            padding: 0.55em 0 0.85em;
            transition: transform var(--timeOut , var(--duration));
        }

        .menu__item::before{
            content: "";
            z-index: -1;
            width: 4.2em;
            height: 4.2em;
            border-radius: 50%;
            position: absolute;
            transform: scale(0);
            transition: background-color var(--duration), transform var(--duration);
        }

        .menu__item.active {transform: translate3d(0, -.8em , 0);

        }

        .menu__item.active::before{
            transform: scale(1);
            background-color: var(--bgColorItem);
        }

        .icon{
            width: 2.6em;
            height: 2.6em;
            stroke: white;
            fill: transparent;
            stroke-width: 1pt;
            stroke-miterlimit: 10;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-dasharray: 400;
        }

        .menu__item.active .icon {
            animation: strok 1.5s reverse;
        }

        @keyframes strok {
            100% {
                stroke-dashoffset: 400;
            }
        }

        .menu__border{
            left: 0;
            bottom: 99%;
            width: 10.9em;
            height: 2.4em;
            position: absolute;
            clip-path: url(#menu);
            will-change: transform;
            background-color: var(--bgColorMenu);
            transition: transform var(--timeOut , var(--duration));
        }

        .svg-container {
            width: 0;
            height: 0;
        }

        @media screen and (max-width: 50em) {
            .menu{
                font-size: .8em;
            }
        }
    </style>
</head>

<body>
<menu class="menu">
    <button class="menu__item active" style="--bgColorItem: #ff8c00;" >
        <svg class="icon" viewBox="0 0 24 24">
            <path d="M3.8,6.6h16.4"/>
            <path d="M20.2,12.1H3.8"/>
            <path d="M3.8,17.5h16.4"/>
        </svg>
    </button>
    <button class="menu__item" style="--bgColorItem: #f54888;">
        <svg class="icon" viewBox="0 0 24 24">
            <path  d="M6.7,4.8h10.7c0.3,0,0.6,0.2,0.7,0.5l2.8,7.3c0,0.1,0,0.2,0,0.3v5.6c0,0.4-0.4,0.8-0.8,0.8H3.8
        C3.4,19.3,3,19,3,18.5v-5.6c0-0.1,0-0.2,0.1-0.3L6,5.3C6.1,5,6.4,4.8,6.7,4.8z"/>
            <path  d="M3.4,12.9H8l1.6,2.8h4.9l1.5-2.8h4.6"/>
        </svg>
    </button>
    <button class="menu__item" style="--bgColorItem: #4343f5;" >
        <svg class="icon" viewBox="0 0 24 24">
            <path  d="M3.4,11.9l8.8,4.4l8.4-4.4"/>
            <path  d="M3.4,16.2l8.8,4.5l8.4-4.5"/>
            <path  d="M3.7,7.8l8.6-4.5l8,4.5l-8,4.3L3.7,7.8z"/>
        </svg>
    </button>
    <button class="menu__item" style="--bgColorItem: #e0b115;" >
        <svg class="icon" viewBox="0 0 24 24" >
            <path  d="M5.1,3.9h13.9c0.6,0,1.2,0.5,1.2,1.2v13.9c0,0.6-0.5,1.2-1.2,1.2H5.1c-0.6,0-1.2-0.5-1.2-1.2V5.1
          C3.9,4.4,4.4,3.9,5.1,3.9z"/>
            <path  d="M4.2,9.3h15.6"/>
            <path  d="M9.1,9.5v10.3"/>
        </svg>
    </button>
    <button class="menu__item" style="--bgColorItem:#65ddb7;">
        <svg class="icon" viewBox="0 0 24 24" >
            <path  d="M5.1,3.9h13.9c0.6,0,1.2,0.5,1.2,1.2v13.9c0,0.6-0.5,1.2-1.2,1.2H5.1c-0.6,0-1.2-0.5-1.2-1.2V5.1
          C3.9,4.4,4.4,3.9,5.1,3.9z"/>
            <path  d="M5.5,20l9.9-9.9l4.7,4.7"/>
            <path  d="M10.4,8.8c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6C7.3,8,8,7.3,8.9,7.3C9.7,7.3,10.4,8,10.4,8.8z"/>
        </svg>
    </button>
    <div class="menu__border"></div>
</menu>
<div class="svg-container">
    <svg viewBox="0 0 202.9 45.5" >
        <clipPath id="menu" clipPathUnits="objectBoundingBox" transform="scale(0.0049285362247413 0.021978021978022)">
            <path  d="M6.7,45.5c5.7,0.1,14.1-0.4,23.3-4c5.7-2.3,9.9-5,18.1-10.5c10.7-7.1,11.8-9.2,20.6-14.3c5-2.9,9.2-5.2,15.2-7
          c7.1-2.1,13.3-2.3,17.6-2.1c4.2-0.2,10.5,0.1,17.6,2.1c6.1,1.8,10.2,4.1,15.2,7c8.8,5,9.9,7.1,20.6,14.3c8.3,5.5,12.4,8.2,18.1,10.5
          c9.2,3.6,17.6,4.2,23.3,4H6.7z"/>
        </clipPath>
    </svg>
</div>
</body>
<script>
    "use strict";
    const body = document.body;
    const bgColorsBody = ["#ffb457", "#ff96bd", "#9999fb", "#ffe797", "#cffff1"];
    const menu = body.querySelector(".menu");
    const menuItems = menu.querySelectorAll(".menu__item");
    const menuBorder = menu.querySelector(".menu__border");
    let activeItem = menu.querySelector(".active");

    function clickItem(item, index) {
        menu.style.removeProperty("--timeOut");
        if (activeItem === item) return;
        if (activeItem) {
            activeItem.classList.remove("active");
        }
        item.classList.add("active");
        body.style.backgroundColor = bgColorsBody[index];
        activeItem = item;
        offsetMenuBorder(activeItem, menuBorder);
    }

    function offsetMenuBorder(element, menuBorder) {
        const offsetActiveItem = element.getBoundingClientRect();
        const left = Math.floor(offsetActiveItem.left - menu.offsetLeft - (menuBorder.offsetWidth  - offsetActiveItem.width) / 2) +  "px";
        menuBorder.style.transform = `translate3d(${left}, 0 , 0)`;
    }

    offsetMenuBorder(activeItem, menuBorder);
    menuItems.forEach((item, index) => {
        item.addEventListener("click", () => clickItem(item, index));
    })

    window.addEventListener("resize", () => {
        offsetMenuBorder(activeItem, menuBorder);
        menu.style.setProperty("--timeOut", "none");
    });
</script>
</html>

到了這里,關(guān)于分享一個(gè)菜單標(biāo)簽頁(yè)動(dòng)畫,切換絲滑無比的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 卡通動(dòng)畫項(xiàng)目 —— 寫代碼 —— 睡覺 —— 絲滑如德芙

    卡通動(dòng)畫項(xiàng)目 —— 寫代碼 —— 睡覺 —— 絲滑如德芙

    ? 目錄 本次實(shí)現(xiàn)效果 ?目錄結(jié)構(gòu) ?index static/css/style.css static/js/script.js 結(jié)語: ? 前期回顧? ???? 【 css動(dòng)畫 】—— 把你喜歡css動(dòng)畫嵌入到瀏覽器中_0.活在風(fēng)浪里的博客-CSDN博客 常用酷炫動(dòng)畫999+合集,代碼直接復(fù)制可用,總用你想找的,快來抱走吧,三連,停!聽鵝說,下

    2024年02月09日
    瀏覽(21)
  • Stable Diffusion 絲滑無閃爍AI動(dòng)畫 Temporalkit+Ebsynth+Controlnet

    Stable Diffusion 絲滑無閃爍AI動(dòng)畫 Temporalkit+Ebsynth+Controlnet

    早期的EbSynth制作的AI視頻閃爍能閃瞎人的雙眼,可以通過【temporalkit+ebsynth+controlnet】讓視頻變得絲滑不閃爍。 下載安裝 EbSynth官網(wǎng),這里需要輸入email地址。 下載壓縮包解壓縮到任意位置,這里我放到了 ebsynth_utility 下。 透明背景工具下載地址: https://pypi.org/project/transparen

    2024年02月16日
    瀏覽(19)
  • 分分鐘搞定MAC絲滑切換node版本,升級(jí)node

    分分鐘搞定MAC絲滑切換node版本,升級(jí)node

    在日常工作中,我們經(jīng)常會(huì)遇到不同項(xiàng)目的依賴需要不同的node版本來運(yùn)行,這個(gè)時(shí)候就需要切換node版本啦~~ 用node.js的多版本管理器 n 來解決問題 查看node所有版本 查看當(dāng)前node版本 安裝n模塊: 升級(jí)到穩(wěn)定版本 切換或者升級(jí)到某個(gè)版本 清除node.js的cache 升級(jí)到最新版本 安裝

    2024年04月23日
    瀏覽(19)
  • uniapp h5 豎向的swiper內(nèi)嵌視頻實(shí)現(xiàn)抖音短視頻垂直切換,絲滑切換視頻效果,無限數(shù)據(jù)加載不卡頓

    uniapp h5 豎向的swiper內(nèi)嵌視頻實(shí)現(xiàn)抖音短視頻垂直切換,絲滑切換視頻效果,無限數(shù)據(jù)加載不卡頓

    一、項(xiàng)目背景 :實(shí)現(xiàn)仿抖音短視頻全屏視頻播放、點(diǎn)贊、評(píng)論、上下切換視頻、視頻播放暫停、分頁(yè)加載、上拉加載下一頁(yè)、下拉加載上一頁(yè)等功能。。。 二、前言 :博主一開始一直想實(shí)現(xiàn)類似抖音進(jìn)入頁(yè)面自動(dòng)播放當(dāng)前視頻,上下滑動(dòng)切換之后播放當(dāng)前視頻,但最后在

    2024年02月11日
    瀏覽(18)
  • 微信小程序 - 簽到打卡旋轉(zhuǎn) 3D 動(dòng)畫功能,仿釘釘打卡簽到時(shí) “容器“ 動(dòng)畫翻轉(zhuǎn)效果(超詳細(xì)完整示例源碼教程,代碼簡(jiǎn)潔、絲滑流暢、示例復(fù)制即用)

    微信小程序 - 簽到打卡旋轉(zhuǎn) 3D 動(dòng)畫功能,仿釘釘打卡簽到時(shí) “容器“ 動(dòng)畫翻轉(zhuǎn)效果(超詳細(xì)完整示例源碼教程,代碼簡(jiǎn)潔、絲滑流暢、示例復(fù)制即用)

    由于微信小程序的動(dòng)畫與普通 CSS 動(dòng)畫稍有不同,所以網(wǎng)上基本沒有這方面的功能源碼。 本文 實(shí)現(xiàn)了微信小程序開發(fā)中,類似釘釘簽到打卡時(shí)的動(dòng)畫效果,圓形硬幣形狀的翻轉(zhuǎn)功能, 您可以直接復(fù)制示例源碼,功能都做好了只需要把你的內(nèi)容放進(jìn)入即可。 如下圖所示,當(dāng)點(diǎn)

    2024年02月11日
    瀏覽(81)
  • 若依前端,菜單欄切換時(shí)刷新問題[頁(yè)面菜單切換時(shí),頁(yè)面總是重新刷新,導(dǎo)致頁(yè)面輸入的查詢參數(shù)重載清空]...

    若依前端,菜單欄切換時(shí)刷新問題[頁(yè)面菜單切換時(shí),頁(yè)面總是重新刷新,導(dǎo)致頁(yè)面輸入的查詢參數(shù)重載清空]...

    前端頁(yè)面菜單切換時(shí),頁(yè)面總是重新刷新,導(dǎo)致頁(yè)面輸入的查詢參數(shù)重載清空 這樣切換時(shí),頁(yè)面就刷新了,解決方法在這里 1,頁(yè)面代碼,這里指定name name: \\\"Item\\\", 注意 name的首字母必須大寫 2,頁(yè)面代碼,這里指定id id=\\\"item\\\" 注意,id的首字母必須小寫 3,頁(yè)面配置,這里的路由

    2024年02月12日
    瀏覽(40)
  • 如何獲得一個(gè)絲滑的麥輪底盤(原理+代碼詳解)

    如何獲得一個(gè)絲滑的麥輪底盤(原理+代碼詳解)

    ? ? ? ? 本文將用最直白的方式講述麥輪底盤的控制原理,并且將附上全套stm32代碼。 目錄 一、準(zhǔn)備工作 1. 麥輪簡(jiǎn)介 2. 安裝底盤 二、原理分析 1. 先從一個(gè)輪子開始 2. 再到整個(gè)底盤 三、運(yùn)動(dòng)學(xué)逆解 1. 繼續(xù)從整體分析 2. 最后回到一個(gè)輪子 四、離散化和PID 1. 數(shù)據(jù)離散化 2. 增

    2024年02月05日
    瀏覽(63)
  • Axure教程—菜單滾動(dòng)切換交互

    Axure教程—菜單滾動(dòng)切換交互

    本文接受的是用Axure中的動(dòng)態(tài)面板和熱區(qū)制作菜單滾動(dòng)切換交互 效果 預(yù)覽地址:https://u5ircj.axshare.com 功能 頁(yè)面滾動(dòng)到某一內(nèi)容部分,顯示其相應(yīng)的菜單。 制作 一、所需元件 矩形、動(dòng)態(tài)面板、熱區(qū) 二、制作過程 拖入一個(gè)矩形元件,其大小設(shè)置為1000×92,命名為”導(dǎo)航“ 在導(dǎo)

    2024年02月12日
    瀏覽(35)
  • 安卓11菜單實(shí)現(xiàn)hdmi-4K動(dòng)態(tài)切換

    客戶要求系統(tǒng)實(shí)現(xiàn)動(dòng)態(tài)hdmi-4K與普通分辨率直接熱切換,先在菜單中做個(gè)試驗(yàn),設(shè)置中加個(gè)切換開關(guān),點(diǎn)擊開關(guān)就可以直接切到hdmi-4K,這個(gè)功能實(shí)現(xiàn)后可以通過插拔hdmi那個(gè)狀態(tài)(sys/class/drm/card0-HDMI-A-1/status)直接實(shí)現(xiàn)切換,測(cè)試代碼也很簡(jiǎn)單,方法如下:

    2024年01月22日
    瀏覽(19)
  • 通過css動(dòng)畫來驅(qū)動(dòng)顯示菜單面板的收縮-原理-不占位

    通過css動(dòng)畫來驅(qū)動(dòng)顯示菜單面板的收縮-原理-不占位

    菜單進(jìn)入的方向可以用絕對(duì)定位來控制。設(shè)置小菜單顯示寬度,就可以實(shí)現(xiàn)不占位的菜單收縮欄

    2023年04月17日
    瀏覽(22)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包