<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>透明白色花环特效</title>
<style>
body {
margin: 0;
padding: 0;
overflow: hidden;
background: #000;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: 'Arial', sans-serif;
}
.flower-ring {
position: relative;
width: 300px;
height: 300px;
animation: rotate 30s linear infinite;
}
.flower {
position: absolute;
width: 40px;
height: 40px;
opacity: 0.8;
filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
}
.petal {
position: absolute;
width: 100%;
height: 100%;
background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.3) 70%, transparent 100%);
border-radius: 50% 50% 0 50%;
transform-origin: bottom right;
}
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes pulse {
0%, 100% {
opacity: 0.7;
transform: scale(1);
}
50% {
opacity: 0.9;
transform: scale(1.1);
}
}
.content {
position: absolute;
text-align: center;
color: white;
z-index: 10;
}
h1 {
font-size: 2.5em;
margin-bottom: 20px;
text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}
.link {
margin-top: 30px;
}
a {
color: #fff;
text-decoration: none;
font-size: 1.2em;
transition: all 0.3s;
padding: 8px 15px;
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 20px;
background: rgba(255, 255, 255, 0.1);
}
a:hover {
background: rgba(255, 255, 255, 0.2);
text-shadow: 0 0 5px #fff;
}
</style>
</head>
<body>
<div class="flower-ring" id="flowerRing"></div>
<div class="content">
<h1>白色花环</h1>
<p>纯净透明的美丽</p>
</div>
<script>
// 创建花环
function createFlowerRing() {
const flowerRing = document.getElementById('flowerRing');
const flowerCount = 12; // 花朵数量
const radius = 120; // 花环半径
for (let i = 0; i < flowerCount; i++) {
const flower = document.createElement('div');
flower.className = 'flower';
// 计算花朵位置
const angle = (i * (360 / flowerCount)) * Math.PI / 180;
const x = radius * Math.cos(angle);
const y = radius * Math.sin(angle);
flower.style.left = `calc(50% + ${x}px - 20px)`;
flower.style.top = `calc(50% + ${y}px - 20px)`;
// 创建花瓣
const petalCount = 5;
for (let j = 0; j < petalCount; j++) {
const petal = document.createElement('div');
petal.className = 'petal';
petal.style.transform = `rotate(${j * (360 / petalCount)}deg)`;
// 添加脉动动画
petal.style.animation = `pulse ${2 + Math.random() * 3}s ease-in-out infinite ${j * 0.2}s`;
flower.appendChild(petal);
}
flowerRing.appendChild(flower);
}
}
// 页面加载后创建花环
window.addEventListener('load', createFlowerRing);
</script>
</body>
</html>
2863

被折叠的 条评论
为什么被折叠?



