js+div+css实现鼠标滚动立体长廊走廊回顾画册相册滚动预览效果代码
代码语言:html
所属分类:画廊相册
代码描述:js+div+css实现鼠标滚动立体长廊走廊回顾画册相册滚动预览效果代码
代码标签: js div css 鼠标 滚动 立体 长廊 走廊 回顾 画册 相册 滚动 预览
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url(https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap);
body,
.container {
transform: translate3d(0, 0, 0); /* Force GPU acceleration */
will-change: transform;
}
body {
margin: 0;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: black;
overflow: hidden;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
--width: 500px;
--height: 500px;
--variable-length: 65000px;
--length: 65000px;
--half-length: calc(var(--length) / 2);
}
/* Controls */
.controls {
margin-bottom: 20px;
color: white;
font-family: "Bebas Neue", sans-serif;
font-size: 1.5rem;
display: flex;
flex-direction: column;
align-items: center;
position: absolute;
z-index: 999;
top: 50px;
}
.range-slider {
width: 300px;
}
/* Cube container */
.container {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
transform: scale(1);
transform-origin: center;
}
.cube {
perspective: 800px;
perspective-origin: 50% 50%;
position: relative;
width: var(--width);
height: var(--height);
transform-style: preserve-3d;
transition: transform 0.3s ease-out;
backface-visibility: hidden;
-webkit-backface-visibility: hidden; /* For compatibility */
will-change: transform;
}
.face {
position: absolute;
width: var(--width);
height: var(--height);
background: rgba(255, 255, 255, 1);
border: none;
display: flex;
align-items: center;
font-family: "Bebas Neue", sans-serif;
color: black;
will-change: transform;
}
.front {
transform: translateZ(calc(var(--length) - var(--variable-length)));
background-size: 500px;
background-blend-mode: difference;
}
.front.main {
transform: translateZ(calc(var(--length) - var(--variable-length)));
background-size: 500px;
background-color: rgba(255, 255, 255, 0.9);
opacity: 1; /* Initial state */
transition: opacity 5s ease-in-out; /* Smooth transition */
display: flex;
align-items: center;
justify-content: center;
}
.front.main.hidden {
opacity: 0.6; /* Final state */
}
.back {
transform: translateZ(calc(-1 * var(--variable-length))) rotateY(180deg)
scale(-1, 1);
background: rgb(17, 17, 17);
background: linear-gradient(
0deg,
rgba(17, 17, 17, 1) 0%,
rgba(28, 28, 28, 1) 33%,
rgba(99, 99, 99, 1) 94%,
rgba(255, 255, 255, 1) 100%
);
display: flex;
justify-content: center;
align-items: center;
}
.back .frame {
position: unset;
}
.left {
transform: translateZ(calc(var(--half-length) - var(--variable-length)))
translateX(calc(-1 * var(--half-length))) rotateY(-90deg) scale(-1, 1);
background: rgba(255, 255, 255, 1);
width: var(--length);
background: rgb(17, 17, 17);
background: linear-gradient(
0deg,
rgba(17, 17, 17, 1) 0%,
rgba(28, 28, 28, 1) 33%,
rgba(99, 99, 99, 1) 94%,
rgba(255, 255, 255, 1) 100%
);
}
.right {
transform: translateZ(calc(var(--half-length) - var(--variable-length)))
translateX(calc(-1 * (var(--half-length) - var(--width)))) rotateY(90deg)
scale(-1, 1);
background: rgba(255, 2.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0