<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>100周年数字滚动特效</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
font-family: 'Arial', sans-serif;
overflow: hidden;
}
.anniversary-container {
position: relative;
width: 800px;
height: 400px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
perspective: 1000px;
}
.title {
color: white;
font-size: 3em;
margin-bottom: 50px;
text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
text-align: center;
z-index: 10;
}
.number-counter {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 50px;
z-index: 10;
}
.digit-container {
position: relative;
width: 100px;
height: 150px;
margin: 0 10px;
perspective: 1000px;
}
.digit {
position: absolute;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.9);
border-radius: 15px;
display: flex;
justify-content: center;
align-items: center;
font-size: 6em;
font-weight: bold;
color: #b21f1f;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
transform-style: preserve-3d;
backface-visibility: hidden;
}
.digit::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 50%;
background: rgba(255, 255, 255, 0.5);
border-radius: 15px 15px 0 0;
}
.digit-1 {
animation: flip1 2s ease-in-out forwards;
}
.digit-0-1 {
animation: flip0 2s ease-in-out 0.5s forwards;
}
.digit-0-2 {
animation: flip0 2s ease-in-out 1s forwards;
}
.years-text {
color: white;
font-size: 2em;
margin-top: 20px;
text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
opacity: 0;
animation: fadeIn 1s ease-in-out 2.5s forwards;
}
.confetti {
position: absolute;
width: 15px;
height: 15px;
background: #ff0;
opacity: 0;
animation: confettiFall 3s ease-in-out 2s forwards;
}
.confetti:nth-child(1) {
left: 10%;
top: -50px;
background: #ff4757;
animation-delay: 2.2s;
}
.confetti:nth-child(2) {
left: 20%;
top: -50px;
background: #2ed573;
animation-delay: 2.4s;
}
.confetti:nth-child(3) {
left: 30%;
top: -50px;
background: #1e90ff;
animation-delay: 2.6s;
}
.confetti:nth-child(4) {
left: 40%;
top: -50px;
background: #ffa502;
animation-delay: 2.8s;
}
.confetti:nth-child(5) {
left: 50%;
top: -50px;
background: #7d5fff;
animation-delay: 2.1s;
}
.confetti:nth-child(6) {
left: 60%;
top: -50px;
background: #ff6b81;
animation-delay: 2.3s;
}
.confetti:nth-child(7) {
left: 70%;
top: -50px;
background: #70a1ff;
animation-delay: 2.5s;
}
.confetti:nth-child(8) {
left: 80%;
top: -50px;
background: #ff7f50;
animation-delay: 2.7s;
}
.confetti:nth-child(9) {
left: 90%;
top: -50px;
background: #eccc68;
animation-delay: 2.9s;
}
.link {
position: absolute;
bottom: 30px;
left: 0;
width: 100%;
text-align: center;
z-index: 10;
}
.link a {
color: white;
background: rgba(255, 255, 255, 0.3);
padding: 10px 20px;
border-radius: 30px;
text-decoration: none;
font-weight: bold;
transition: all 0.3s;
}
.link a:hover {
background: rgba(255, 255, 255, 0.5);
box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}
@keyframes flip1 {
0% {
transform: rotateX(0deg);
}
50% {
transform: rotateX(90deg);
opacity: 0;
}
51% {
content: '1';
opacity: 0;
}
100% {
transform: rotateX(0deg);
opacity: 1;
}
}
@keyframes flip0 {
0% {
transform: rotateX(0deg);
}
50% {
transform: rotateX(90deg);
opacity: 0;
}
51% {
content: '0';
opacity: 0;
}
100% {
transform: rotateX(0deg);
opacity: 1;
}
}
@keyframes fadeIn {
0% {
opacity: 0;
transform: translateY(20px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
@keyframes confettiFall {
0% {
transform: translateY(0) rotate(0deg);
opacity: 0;
}
10% {
opacity: 1;
}
100% {
transform: translateY(100vh) rotate(360deg);
opacity: 1;
}
}
.glow {
position: absolute;
width: 100%;
height: 100%;
background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, rgba(255,215,0,0) 70%);
animation: pulse 3s ease-in-out infinite alternate;
z-index: 1;
}
@keyframes pulse {
0% {
opacity: 0.3;
transform: scale(0.9);
}
100% {
opacity: 0.7;
transform: scale(1.1);
}
}
</style>
</head>
<body>
<div class="anniversary-container">
<div class="glow"></div>
<h1 class="title">热烈庆祝成立</h1>
<div class="number-counter">
<div class="digit-container">
<div class="digit digit-1">0</div>
</div>
<div class="digit-container">
<div class="digit digit-0-1">0</div>
</div>
<div class="digit-container">
<div class="digit digit-0-2">0</div>
</div>
</div>
<div class="years-text">周年</div>
<!-- 彩色纸屑 -->
<div class="confetti"></div>
<div class="confetti"></div>
<div class="confetti"></div>
<div class="confetti"></div>
<div class="confetti"></div>
<div class="confetti"></div>
<div class="confetti"></div>
<div class="confetti"></div>
<div class="confetti"></div>
<div class="link">
<a href="http://cqsf.100wanfu.com" target="_blank">访问示例网站</a>
</div>
</div>
<script>
// 数字滚动完成后显示100
setTimeout(() => {
document.querySelector('.digit-1').textContent = '1';
document.querySelector('.digit-0-1').textContent = '0';
document.querySelector('.digit-0-2').textContent = '0';
}, 1000);
</script>
</body>
</html>