微件:Intro:修订间差异
来自SOKA CAFE
![]() こばと(留言 | 贡献) (创建页面,内容为“<div id="intro-animation-container" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); z-index: 9999; display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 1s ease-in-out;"> <div id="intro-content" style="text-align: center; transform: scale(0.8); opacity: 0; transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);"> <img src="https://soka.cafe/images/b/b…”) |
|||
(未显示同一用户的4个中间版本) | |||
第1行: | 第1行: | ||
< | <html lang="zh-CN"> | ||
< | <head> | ||
<meta charset="UTF-8"> | |||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |||
<title>八叶莲华会社</title> | |||
<style> | |||
/* 基础样式重置 */ | |||
* { | |||
margin: 0; | |||
padding: 0; | |||
box-sizing: border-box; | |||
} | |||
body { | |||
八叶莲华会社 | font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif; | ||
</ | } | ||
/* 动画容器 (全屏背景) */ | |||
.intro-container { | |||
position: fixed; | |||
top: 0; | |||
left: 0; | |||
width: 100%; | |||
height: 100%; | |||
background: radial-gradient(ellipse at center, rgba(34, 34, 34, 0.9) 0%, rgba(10, 10, 10, 0.98) 100%); | |||
z-index: 9999; | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
opacity: 0; | |||
transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1); | |||
} | |||
/* 花瓣装饰背景 */ | |||
.petals-background { | |||
position: absolute; | |||
width: 100%; | |||
height: 100%; | |||
opacity: 0.15; | |||
pointer-events: none; | |||
} | |||
.petal { | |||
position: absolute; | |||
background: rgba(255, 255, 255, 0.6); | |||
border-radius: 50% 50% 50% 0; | |||
width: 20px; | |||
height: 20px; | |||
opacity: 0; | |||
animation: fallDown 15s linear infinite; | |||
} | |||
@keyframes fallDown { | |||
0% { | |||
transform: translateY(-100px) rotate(0deg); | |||
opacity: 0; | |||
} | |||
10% { | |||
opacity: 0.6; | |||
} | |||
90% { | |||
opacity: 0.4; | |||
} | |||
100% { | |||
transform: translateY(100vh) rotate(360deg); | |||
opacity: 0; | |||
} | |||
} | |||
/* 进度条 */ | |||
.progress-container { | |||
position: absolute; | |||
bottom: 60px; | |||
left: 50%; | |||
transform: translateX(-50%); | |||
width: 280px; | |||
height: 3px; | |||
background: rgba(255, 255, 255, 0.2); | |||
border-radius: 4px; | |||
overflow: hidden; | |||
} | |||
.progress-bar { | |||
height: 100%; | |||
width: 0%; | |||
background: linear-gradient(90deg, #a17f3a, #d6b161, #a17f3a); | |||
border-radius: 4px; | |||
transition: width 0.3s ease; | |||
} | |||
/* 动画内容区 */ | |||
.intro-content { | |||
text-align: center; | |||
filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.15)); | |||
position: relative; | |||
} | |||
/* LOGO样式和动画 */ | |||
.intro-logo { | |||
max-width: 180px; | |||
height: auto; | |||
display: block; | |||
margin: 0 auto 25px; | |||
opacity: 0; | |||
transform: translateY(20px) scale(0.9); | |||
transition: all 1.5s cubic-bezier(0.23, 1, 0.32, 1); | |||
border-radius: 50%; | |||
padding: 10px; | |||
background: radial-gradient(ellipse at center, rgba(161, 127, 58, 0.2) 0%, transparent 70%); | |||
} | |||
/* 标题文字样式和动画 */ | |||
.intro-title { | |||
color: #FFFFFF; | |||
font-size: 3.2em; | |||
font-weight: 500; | |||
text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(0, 0, 0, 0.5); | |||
letter-spacing: 3px; | |||
margin-bottom: 10px; | |||
opacity: 0; | |||
transform: scale(0.95); | |||
transition: all 1.5s cubic-bezier(0.23, 1, 0.32, 1); | |||
} | |||
/* 副标题 */ | |||
.intro-subtitle { | |||
color: rgba(255, 255, 255, 0.7); | |||
font-size: 1.2em; | |||
font-weight: 300; | |||
letter-spacing: 2px; | |||
margin-top: 10px; | |||
opacity: 0; | |||
transform: translateY(10px); | |||
transition: all 1.2s cubic-bezier(0.23, 1, 0.32, 1) 0.6s; | |||
} | |||
/* 控制按钮 */ | |||
.intro-controls { | |||
position: absolute; | |||
bottom: 20px; | |||
right: 20px; | |||
display: flex; | |||
gap: 10px; | |||
} | |||
.control-btn { | |||
background: rgba(255, 255, 255, 0.1); | |||
border: none; | |||
color: white; | |||
padding: 8px 15px; | |||
border-radius: 20px; | |||
cursor: pointer; | |||
font-size: 0.9em; | |||
transition: all 0.3s ease; | |||
backdrop-filter: blur(5px); | |||
} | |||
.control-btn:hover { | |||
background: rgba(255, 255, 255, 0.2); | |||
} | |||
/* 花瓣装饰 */ | |||
.decoration { | |||
position: absolute; | |||
width: 100px; | |||
height: 100px; | |||
opacity: 0.1; | |||
pointer-events: none; | |||
} | |||
.decoration-1 { | |||
top: 20%; | |||
left: 15%; | |||
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50,0 C60,20 80,30 100,50 C80,60 60,80 50,100 C40,80 20,60 0,50 C20,30 40,20 50,0Z" fill="%23d6b161"/></svg>') no-repeat center; | |||
background-size: contain; | |||
animation: float 12s ease-in-out infinite; | |||
} | |||
.decoration-2 { | |||
bottom: 20%; | |||
right: 15%; | |||
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50,0 C60,20 80,30 100,50 C80,60 60,80 50,100 C40,80 20,60 0,50 C20,30 40,20 50,0Z" fill="%23a17f3a"/></svg>') no-repeat center; | |||
background-size: contain; | |||
animation: float 15s ease-in-out infinite reverse; | |||
} | |||
@keyframes float { | |||
0%, 100% { transform: translateY(0) rotate(0deg); } | |||
50% { transform: translateY(-20px) rotate(10deg); } | |||
} | |||
/* === 动画触发类 === */ | |||
.intro-container.is-active .intro-logo { | |||
opacity: 1; | |||
transform: translateY(0) scale(1); | |||
transition-delay: 0.2s; | |||
} | |||
.intro-container.is-active .intro-title { | |||
opacity: 1; | |||
transform: scale(1); | |||
transition-delay: 0.4s; | |||
} | |||
.intro-container.is-active .intro-subtitle { | |||
opacity: 1; | |||
transform: translateY(0); | |||
} | |||
/* 响应式设计 */ | |||
@media (max-width: 768px) { | |||
.intro-title { font-size: 2.2em; } | |||
.intro-subtitle { font-size: 1em; } | |||
.intro-logo { max-width: 130px; } | |||
.progress-container { width: 200px; } | |||
.control-btn { padding: 6px 12px; font-size: 0.8em; } | |||
} | |||
@media (max-width: 480px) { | |||
.intro-title { font-size: 1.8em; letter-spacing: 1px; } | |||
.intro-subtitle { font-size: 0.9em; letter-spacing: 1px; } | |||
.intro-logo { max-width: 100px; } | |||
.progress-container { width: 180px; bottom: 50px; } | |||
.control-btn { padding: 5px 10px; font-size: 0.7em; } | |||
.intro-controls { bottom: 15px; right: 15px; } | |||
} | |||
</style> | |||
</head> | |||
<body> | |||
<div id="intro-container" class="intro-container"> | |||
<div class="petals-background" id="petals-container"></div> | |||
<div class="decoration decoration-1"></div> | |||
<div class="decoration decoration-2"></div> | |||
<div class="intro-content"> | |||
<img src="https://soka.cafe/images/b/b3/%E5%85%AB%E5%8F%B6%E8%8E%B2%E5%8D%8E%E4%BC%9A%E7%A4%BE.jpg" alt="八叶莲华会社" class="intro-logo"> | |||
<h1 class="intro-title">八叶莲华会社</h1> | |||
<p class="intro-subtitle">“中华Air本文化的活化石,了解Air本文化的最好途径”</p> | |||
</div> | |||
<div class="progress-container"> | |||
<div class="progress-bar" id="progress-bar"></div> | |||
</div> | |||
<div class="intro-controls"> | |||
<button class="control-btn" id="skip-btn">跳过</button> | |||
<button class="control-btn" id="mute-btn">🔊</button> | |||
</div> | |||
</div> | </div> | ||
<script> | <script> | ||
document.addEventListener('DOMContentLoaded', function() { | document.addEventListener('DOMContentLoaded', function() { | ||
const container = document.getElementById('intro-container'); | |||
const progressBar = document.getElementById('progress-bar'); | |||
const skipBtn = document.getElementById('skip-btn'); | |||
const muteBtn = document.getElementById('mute-btn'); | |||
const petalsContainer = document.getElementById('petals-container'); | |||
// --- MODIFIED: Replaced oscillator with Audio element --- | |||
let backgroundAudio; | |||
let isMuted = false; | |||
let animationDuration = 4500; // 动画总时长(毫秒) | |||
let animationTimer; | |||
// 创建花瓣背景 | |||
function createPetals() { | |||
const petalCount = 15; | |||
for (let i = 0; i < petalCount; i++) { | |||
const petal = document.createElement('div'); | |||
petal.classList.add('petal'); | |||
const size = Math.random() * 15 + 10; | |||
petal.style.width = `${size}px`; | |||
petal.style.height = `${size}px`; | |||
petal.style.left = `${Math.random() * 100}%`; | |||
petal.style.animationDelay = `${Math.random() * 10}s`; | |||
petal.style.animationDuration = `${Math.random() * 10 + 10}s`; | |||
petal.style.transform = `rotate(${Math.random() * 90}deg)`; | |||
petal.style.background = `rgba(214, 177, 97, ${Math.random() * 0.5 + 0.3})`; | |||
petalsContainer.appendChild(petal); | |||
} | |||
} | |||
// --- REPLACED: Function now loads and plays the MP3 file --- | |||
function createSound() { | |||
try { | |||
const audioURL = 'https://vip.123pan.cn/1826204916/Composition/%E3%80%90%E6%BA%90%E6%96%87%E4%BB%B6%E3%80%91%E5%AE%97%E6%95%99%E9%83%BD%E5%B8%82%E7%A5%AD%20~%20Shukyo%20City%20Festival/%E3%80%90%E7%BB%84%E6%9B%B2%E3%80%91RB%20Suite%20of%20Trihydrate%20Final.mp3'; | |||
backgroundAudio = new Audio(audioURL); | |||
backgroundAudio.volume = 0.8; // Set initial volume | |||
backgroundAudio.play(); | |||
// Set up automatic fade out at the end of the animation | |||
setTimeout(fadeOutAndStop, animationDuration - 1200); | |||
} catch (e) { | |||
console.error('Error creating or playing audio:', e); | |||
} | |||
} | |||
// --- ADDED: New function to fade out the audio smoothly --- | |||
function fadeOutAndStop() { | |||
if (!backgroundAudio) return; | |||
const fadeDuration = 1200; // 1.2 seconds | |||
const fadeInterval = 50; // ms | |||
const volumeDecrement = backgroundAudio.volume / (fadeDuration / fadeInterval); | |||
const fade = setInterval(() => { | |||
let currentVolume = backgroundAudio.volume - volumeDecrement; | |||
if (currentVolume > 0) { | |||
backgroundAudio.volume = currentVolume; | |||
} else { | |||
backgroundAudio.volume = 0; | |||
backgroundAudio.pause(); | |||
clearInterval(fade); | |||
}); | } | ||
}, fadeInterval); | |||
} | |||
// --- MODIFIED: This function now controls the new audio element --- | |||
/ | function skipAnimation() { | ||
/ | document.body.style.overflow = ''; | ||
clearTimeout(animationTimer); | |||
{{ | |||
</ | // Fade out audio if it's playing | ||
if (backgroundAudio) { | |||
fadeOutAndStop(); | |||
} | |||
container.style.opacity = '0'; | |||
setTimeout(() => { | |||
container.style.display = 'none'; | |||
}, 1200); | |||
} | |||
// --- MODIFIED: This function now controls the new audio element --- | |||
function toggleMute() { | |||
if (!backgroundAudio) return; // Don't do anything if audio hasn't been created | |||
isMuted = !isMuted; | |||
backgroundAudio.muted = isMuted; | |||
muteBtn.textContent = isMuted ? '🔇' : '🔊'; | |||
} | |||
// 初始化 | |||
function init() { | |||
document.body.style.overflow = 'hidden'; | |||
createPetals(); | |||
requestAnimationFrame(() => { | |||
container.style.opacity = '1'; | |||
container.classList.add('is-active'); | |||
let progress = 0; | |||
const interval = 30; | |||
const increments = interval / animationDuration * 100; | |||
const progressInterval = setInterval(() => { | |||
progress += increments; | |||
progressBar.style.width = `${progress}%`; | |||
if (progress >= 100) { | |||
clearInterval(progressInterval); | |||
} | |||
}, interval); | |||
// --- MODIFIED: The click listener now creates the MP3 sound --- | |||
document.body.addEventListener('click', function() { | |||
if (!backgroundAudio) { // Only create sound once | |||
createSound(); | |||
} | |||
}, { once: true }); | |||
}); | |||
animationTimer = setTimeout(skipAnimation, animationDuration); | |||
skipBtn.addEventListener('click', skipAnimation); | |||
muteBtn.addEventListener('click', toggleMute); | |||
} | |||
init(); | |||
}); | |||
</script> | |||
</body> | |||
</html> |
2025年8月30日 (六) 06:53的最新版本

八叶莲华会社
“中华Air本文化的活化石,了解Air本文化的最好途径”