CustomEase+gsap实现炫酷弹出式导航菜单效果代码
代码语言:html
所属分类:菜单导航
代码描述:CustomEase+gsap实现炫酷弹出式导航菜单效果代码
代码标签: CustomEase gsap 炫酷 弹出式 导航 菜单
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @font-face { font-family: 'PP Neue Corp Tight'; src: url('https://cdn.prod.website-files.com/673af51dea86ab95d124c3ee/673b0f5784f7060c0ac05534_PPNeueCorp-TightUltrabold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; } .osmo-ui { z-index: 0; pointer-events: none; flex-flow: column; justify-content: space-between; align-items: stretch; } .nav-row { justify-content: space-between; align-items: center; width: 100%; display: flex; } .nav-logo-row { pointer-events: auto; justify-content: space-between; align-items: center; width: 13em; display: flex; } .nav-logo__wordmark { width: 4em; } .nav-logo__icon { width: 1.5em; height: 1.5em; } .container { z-index: 1; max-width: var(--size-container); padding-left: var(--container-padding); padding-right: var(--container-padding); width: 100%; margin-left: auto; margin-right: auto; position: relative; } .container.is--full { max-width: 100%; } .nav-row__right { grid-column-gap: .625rem; grid-row-gap: .625rem; pointer-events: auto; justify-content: flex-end; align-items: center; display: flex; } .header { z-index: 110; padding-top: var(--gap); position: fixed; inset: 0% 0% auto; } .website-link { white-space: nowrap; text-decoration: none; position: relative; } .website-link.is--alt { grid-column-gap: .25em; grid-row-gap: .25em; justify-content: flex-start; align-items: center; height: 1.5em; display: flex; } .inline-link__p { margin-bottom: 0; } .body { background-color: var(--color-neutral-300); color: var(--color-dark); font-family: Arial, Helvetica, sans-serif; font-weight: 500; line-height: 1; } p{ margin: 0px } .cloneable { padding: var(--section-padding) var(--container-padding); justify-content: center; align-items: center; min-height: 100svh; display: flex; position: relative; --menu-padding: 2em; } .nav { z-index: 100; width: 100%; height: 100vh; margin-left: auto; margin-right: auto; display: block; position: fixed; inset: 0%; } .overlay { z-index: 0; cursor: pointer; background-color: #13131366; width: 100%; height: 100%; position: absolute; inset: 0%; } .menu { padding-bottom: var(--menu-padding); grid-column-gap: 5em; grid-row-gap: 5em; padding-top: calc(3 * var(--menu-padding)); flex-flow: column; justify-content: space-between; align-items: flex-start; width: 35em; height: 100%; margin-left: auto; position: relative; overflow: auto; } .menu-bg { z-index: 0; position: absolute; inset: 0%; } .menu-inner { z-index: 1; grid-column-gap: 5em; grid-row-gap: 5em; flex-flow: column; justify-content: space-between; align-items: flex-start; height: 100%; display: flex; position: relative; overflow: auto; } .bg-panel { z-index: 0; background-color: var(--color-neutral-300); border-top-left-radius: 1.25em; border-bottom-left-radius: 1.25em; position: absolute; inset: 0%; } .bg-panel.first { background-color: var(--color-primary); } .bg-panel.second { background-color: var(--color-neutral-100); } .menu-list { flex-flow: column; width: 100%; margin-bottom: 0; padding-left: 0; list-style: none; display: flex; } .menu-list-item { position: relative; overflow: hidden; } .menu-link-heading{ text-shadow: 0px 1em 0px var(--color-neutral-200); } .menu-link { padding-top: .75em; padding-bottom: .75em; padding-left: var(--menu-padding); grid-column-gap: .75em; grid-row-gap: .75em; width: 100%; text-decoration: none; display: flex; } .menu-link-heading { z-index: 1; text-transform: uppercase; font-family: PP Neue Corp Tight, Arial, sans-serif; font-size: 5.625em; font-weight: 700; line-height: .75; transition: transform .55s cubic-bezier(.65, .05, 0, 1); position: relative; } .eyebrow { z-index: 1; color: var(--color-primary); text-transform: uppercase; font-family: RM Mono, Arial, sans-serif; font-weight: 400; position: relative; } .menu-link-bg { z-index: 0; background-color: var(--color-neutral-800); transform-origin: 50% 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.65, .05, 0, 1); position: absolute; inset: 0%; transform: scale3d(1, 0, 1); } .menu-details { padding-left: var(--menu-padding); grid-column-gap: 1.25em; grid-row-gap: 1.25em; flex-flow: column; justify-content: flex-start; align-items: flex-start; display: flex; } .p-small { font-size: .875em; font-family: Arial, Helvetica; } .socials-row { grid-column-gap: 1.5em; grid-row-gap: 1.5em; flex-flow: row; display: flex; } .p-large { font-size: 1.125em; font-family: Arial, Helvetica; } .text-link { text-decoration: none; position: relative; } .menu-button { grid-column-gap: .625em; grid-row-gap: .625em; background-color: #0000; justify-content: flex-end; align-items: center; margin: -1em; padding: 1em; display: flex; border: none; } .menu-button-icon { width: 1em; height: 1em; } .menu-button-text { flex-flow: column; justify-content: flex-start; align-items: flex-end; height: 1.125em; display: flex; overflow: hidden; } .icon-wrap { transition: transform .4s cubic-bezier(.65, .05, 0, 1); } @media (hover:hover){ /* Menu toggle button*/ .menu-button:hover .icon-wrap{transform: rotate(90deg); } /* Menu Large Links */ .menu-link:hover .menu-link-heading{ transform: translate(0px, -1em); transition-delay: 0.1s; } .menu-link:hover .menu-link-bg{ transform: scale(1,1) } /* Menu Smaller Links */ .text-link::after{ content: ''; position:absolute; left: 0; bottom: 0; width:100%; height:1px; background: var(--color-primary); transform-origin: right center; transform: scale(0,1); transition: transform 0.4s var(--cubic-default) } .text-link:hover::after{ transform-origin: left center; transform: scale(1,1); } } .osmo-icon-svg { width: 8em; } @media screen and (max-width: 767px) { .cloneable{ --menu-padding: 1em; } .nav-logo-row { grid-column-gap: 2.5em; grid-row-gap: 2.5em; width: auto; } .nav-row__right { grid-col.........完整代码请登录后点击上方下载按钮下载查看
网友评论0