js+css实现文字拖拽弹性回弹图片相册导航菜单代码

代码语言:html

所属分类:菜单导航

代码描述:js+css实现文字拖拽弹性回弹图片相册导航菜单代码

代码标签: js css 文字 拖拽 弹性 回弹 图片 相册 导航 菜单 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  
  
  
  
<style>
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: #fff0
}

body {
    background: rgb(255 255 255 / .88);
    overflow: hidden;
    font-family: 'Zen Tokyo Zoo', system-ui;
    width: 100%;
    height: 100%;
    position: fixed
}

a {
    color: tomato;
    text-decoration: none
}

a:hover {
    color: #2180ae
}

.font-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Zen Tokyo Zoo', system-ui;
    font-size: 2rem;
    color: #fff;
    transition: opacity 0.5s ease;
    flex-direction: column;
    gap: 20px
}

.font-loader.hidden {
    opacity: 0;
    pointer-events: none
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgb(255 255 255 / .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.sections-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(.2, .9, .4, 1.1);
    will-change: transform
}

.section {
    min-width: 100vw;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 60px 40px
}

.section::-webkit-scrollbar {
    width: 8px
}

.section::-webkit-scrollbar-track {
    background: rgb(0 0 0 / .3);
    border-radius: 10px
}

.section::-webkit-scrollbar-thumb {
    background: rgb(255 255 255 / .3);
    border-radius: 10px
}

.section::-webkit-scrollbar-thumb:hover {
    background: rgb(255 255 255 / .5)
}

.section {
    -webkit-overflow-scrolling: touch;
    background: #eee
}

.section-content {
    text-align: center;
    max-width: 1800px;
    width: 100%
}

.section-title {
    font-size: 5rem;
    margin-bottom: 30px;
    text-shadow: 0 0 20px currentColor;
    font-family: 'Zen Tokyo Zoo', system-ui;
    transform: translateY(-500px);
    opacity: 0;
    transition: transform 1.5s cubic-bezier(.2, .9, .4, 1.1), opacity 0.8s ease
}

.section-title.visible {
    transform: translateY(0) !important;
    opacity: 1 !important
}

.section-description {
    font-size: 1rem;
    margin-bottom: 40px;
    font-family: 'Roboto', sans-sherif
}

.frequency {
    font-size: 2rem;
    margin: 40px 0;
    opacity: .8
}

.masonry {
    column-count: 3;
    column-gap: 20px;
    margin-top: 40px;
    margin-bottom: 80px
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer
}

.masonry-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgb(0 0 0 / .3)
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px
}

.back-button {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 30px;
    background: rgb(0 0 0 / .7);
    backdrop-filter: blur(10px);
    border: 1px solid .........完整代码请登录后点击上方下载按钮下载查看

网友评论0