js+css实现等距婵原则立体柱体动画效果代码
代码语言:html
所属分类:动画
代码描述:js+css实现等距婵原则立体柱体动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Arial", sans-serif;
background: radial-gradient(
circle at center,
#2a2a4a 0%,
#1a1a2e 70%,
#0d0d1a 100%
);
color: white;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
overflow: hidden;
position: relative;
}
.container {
text-align: center;
width: 100%;
z-index: 1;
}
h1 {
margin-bottom: 2rem;
font-size: 2.5rem;
text-transform: uppercase;
letter-spacing: 3px;
text-shadow: 0 0 10px rgba(102, 252, 241, 0.7);
animation: glow 2s ease-in-out infinite alternate;
position: relative;
}
h1::after {
content: "";
position: absolute;
left: 50%;
bottom: -10px;
transform: translateX(-50%);
width: 0;
height: 3px;
background: linear-gradient(90deg, transparent, #66fcf1, transparent);
animation: line-grow 3s ease-in-out infinite;
}
.isometric-grid {
position: relative;
margin: 0 auto;
width: 80vmin;
height: 80vmin;
perspective: 1000px;
transform-style: preserve-3d;
transform: rotateX(60deg) rotateZ(45deg);
animation: gridFloat 20s ease-in-out infinite alternate;
}
.tile {
position: absolute;
width: 10%;
height: 10%;
transform-style: preserve-3d;
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
opacity 0.3s;
backface-visibility: hidden;
}
.tile-face {
position: absolute;
width: 100%;
height: 100%;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
backface-visibility: hidden;
transition: all 0.3s;
}
.tile-top {
transform: translateZ(0);
background: var(--top-color);
box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.2);
}
.tile-left {
transform: rotateY(90deg) translateZ(0);
width: 100%;
height: 100%;
transform-origin: left;
background: var(--left-color);
}
.tile-right {
transform: rotateX(90deg) translateZ(0);
width: 100%;
height: 100%;
transform-origin: top;
background: var(--right-color);
}
.tile-glow {
position: absolute;
top: -20%;
left: -20%;
width: 140%;
height: 140%;
border-radius: 50%;
background: radial-gradient(
circle,
rgba(255, 255, 255, 0.8) 0%,
rgba(255, 255, 255, 0) 70%
);
opacity: 0;
pointer-events: none;
z-index: 5;
animation: pulse 3s ease-in-out infinite;
}
.active-tile .tile-glow {
opacity: 0.6;
animation: pulse 1s ease-in-out infinite;
}
.active-tile .tile-top {
filter: brightness(1.3);
}
.neighbor-tile .tile-top {
filter: brightness(1.1);
}
#particleCanvas {
position: fixed;
top: 0;
left: 0;
pointer-events: none;
z-index: 2;
}
.wave-effect {
animation: wave 0.5s ease-out;
}
@keyframes wave {
0% {
transform: translateZ(0) scale(1);
filter: brightness(1);
}
50% {
transform: translateZ(30px) scale(1.2);
filter: brightness(1.5);
}
100% {
transform: translateZ(0) scale(1);
filter: brightness(1);
}
}
@keyframes float {
0% {
transform: translateZ(0);
}
50% {
transform: translateZ(20px);
}
100% {
transform: translateZ(0);
}
}
@keyframes pulse {
0% {
opacity: 0;
transform: scale(0.8);
}
50% {
opacity: 0.4;
transform: scale(1.1);
}
100% {
opacity: 0;
transform: scale(0.8);
}
}
@keyframes glow {
from {
text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #66fcf1, 0 0 20px #66fcf1;
}
to {
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #66fcf1, 0 0 40px #66fcf1,
0 0 50px #66fcf1;
}
}
@keyframes line-grow {
0% {
width: 0;
}
50% {
width: 50%;
}
100% {
width: 0;
}
}
@keyframes gridFloat {
0% {
transform: rotateX(60deg) rotateZ(45deg) translateY(0);
}
50% {
transform: rotateX(65deg) rotateZ(42deg) translateY(-20px);
}
100% {
transform: rotateX(60deg) rotateZ(45deg) translateY(0);
}
}
body::before {
content: "";
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: radial-gradient(
white,
rgba(255, 255, 255, 0.2) 2px,
transparent 2px
);
background-size: 50px 50px;
opacity: 0.1;
animation: twinkling 8s infinite linear;
}
@keyframes twinkling {
0% {
transform: translateY(0);
}
100% {
transform: translateY(50px);
}
}
@media (max-width: 768px) {
h1 {
font-size: 1.8rem;
}
.isometric-grid {
width: 95vmin;
height: 95vmin;
}
}
.page-credits {
position: fixed;
bottom: 0px;
width: 100%;
display: flex;
justify-content: space-between;
padding: 0 20px;
z-index: 100;
pointer-events: none;
}
.code-credit {
position: relative;
bottom: 0px;
font-family: "Arial", sans-serif;
color: rgba(255, 255, 255, 0.7);
font-size: 0.9rem;
letter-spacing: 1px;
text-shadow: 0 0 5px rgba(102, 252, 241, 0.5);
pointer-events: none;
}
.my-work-btn {
position: relative;
top: -20px;
text-decoration: none;
color: #66fcf1;
border: 2px solid rgba.........完整代码请登录后点击上方下载按钮下载查看
网友评论0