three实现图片卡片光速分解为字符动画效果代码
代码语言:html
所属分类:动画
代码描述:three实现图片卡片光速分解为字符动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;700&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #000000;
min-height: 100vh;
overflow: hidden;
font-family: "Arial", sans-serif;
}
.controls {
position: absolute;
top: 20px;
left: 20px;
display: flex;
gap: 10px;
z-index: 100;
}
.control-btn {
padding: 10px 20px;
background: rgba(255, 255, 255, 0.2);
border: none;
border-radius: 25px;
color: white;
font-weight: bold;
cursor: pointer;
backdrop-filter: blur(5px);
transition: all 0.3s ease;
font-size: 14px;
}
.control-btn:hover {
background: rgba(255, 255, 255, 0.3);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.speed-indicator {
position: absolute;
top: 20px;
right: 20px;
color: white;
font-size: 16px;
background: rgba(0, 0, 0, 0.3);
padding: 8px 16px;
border-radius: 20px;
backdrop-filter: blur(5px);
z-index: 100;
}
.info {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
color: rgba(255, 255, 255, 0.9);
text-align: center;
font-size: 14px;
background: rgba(0, 0, 0, 0.3);
padding: 15px 25px;
border-radius: 20px;
backdrop-filter: blur(5px);
z-index: 100;
line-height: 1.4;
}
.container {
position: relative;
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.card-stream {
position: absolute;
width: 100vw;
height: 180px;
display: flex;
align-items: center;
overflow: visible;
}
.card-line {
display: flex;
align-items: center;
gap: 60px;
white-space: nowrap;
cursor: grab;
user-select: none;
will-change: transform;
}
.card-line:active {
cursor: grabbing;
}
.card-line.dragging {
cursor: grabbing;
}
.card-line.css-animated {
animation: scrollCards 40s linear infinite;
}
@keyframes scrollCards {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(100vw);
}
}
.card-wrapper {
position: relative;
width: 400px;
height: 250px;
flex-shrink: 0;
}
.card {
position: absolute;
top: 0;
left: 0;
width: 400px;
height: 250px;
border-radius: 15px;
overflow: hidden;
}
.card-normal {
background: transparent;
box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 0;
color: white;
z-index: 2;
position: relative;
overflow: hidden;
}
.card-image {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 15px;
transition: all 0.3s ease;
filter: brightness(1.1) contrast(1.1);
box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}
.card-image:hover {
filter: brightness(1.2) contrast(1.2);
}
.card-ascii {
background: transparent;
z-index: 1;
position: absolute;
top: 0;
left: 0;
width: 400px;
height: 250px;
border-radius: 15px;
overflow: hidden;
}
.card-chip {
width: 40px;
height: 30px;
background: linear-gradient(45deg, #ffd700, #ffed4e);
border-radius: 5px;
position: relative;
margin-bottom: 20px;
}
.card-chip::before {
content: "";
position: absolute;
top: 3px;
left: 3px;
right: 3px;
bottom: 3px;
background: linear-gradient(45deg, #e6c200, #f4d03f);
border-radius: 2px;
}
.contactless {
position: absolute;
top: 60px;
left: 20px;
width: 25px;
height: 25px;
border: 2px solid rgba(255, 255, 255, 0.8);
border-radius: 50%;
background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent);
}
.contactless::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 15px;
height: 15px;
border: 1px solid rgba(255, 255, 255, 0.6);
border-radius: 50%;
}
.card-number {
font-size: 22px;
font-weight: bold;
letter-spacing: 3px;
margin-bottom: 15px;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.card-info {
display: flex;
justify-content: space-between;
align-items: flex-end;
}
.card-holder {
color: white;
font-size: 14px;
text-transform: uppercase;
}
.card-expiry.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0