我的爱只能让你拥有
<meta charset="utf-8"><meta name="referrer" content="never">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<title>我的爱只能让你拥有 (烟嗓版) - 安倍儿</title>
</head>
<body>
<style>
@import url("https://fonts.googleapis.com/css2?family=Liu+Jian+Mao+Cao&family=Long+Cang&family=Ma+Shan+Zheng&family=ZCOOL+KuaiLe&family=ZCOOL+QingKe+HuangYou&display=swap");
#papa {position:relative; overflow:hidden; width:1280px; height: 750px; background: #FFFFFF url('https://img-baofun.zhhainiao.com/pcwallpaper_ugc/live/62e77b262e589589a6d63e6acf87180c.jpg') no-repeat center/cover;margin:30px 0;left:calc(50% - 110px);transform:translateX(-50%);animation: hue-rotate 3s linear infinite;z-index:1;}
#papa.stop,#bs.stop,#xiaobo.stop,#all.stop{ animation-play-state: paused; }
.vid { position: absolute;mix-blend-mode: screen; width: 120%; height: 120%;top: -10%; left: -10%; object-fit: cover;z-index:1; }
#baiBox { position:absolute; top:4%; left:4%; font-family: "Long Cang","Ma Shan Zheng","华文行楷",SimHei, Arial, "sans-serif"; font-size:clamp(20px, 2.5vw, 45px); font-weight:bold; color:#f46ff6; transform-origin:top; animation:yao 1.0s linear infinite alternate,color 3s linear infinite; z-index:10;}
@keyframes yao { from{transform:perspective(700px) rotatex(30deg)} to{transform:perspective(700px) rotatex(-30deg)} }
#lrcWrap { margin:620px 0; left:0%;width: 100%; height: 60px; border: 0px solid gray; position: absolute;filter:drop-shadow(#000 1px 0 0) drop-shadow(#000 0 1px 0) drop-shadow(#000 -1px 0 0) drop-shadow(#000 0 -1px0);}
#lrcWrap::before {content: attr(data-lrc); position: absolute; bottom: 0; width: 100%; height: 60px; text-align: center;font:600 50px/50px "Long Cang","Ma Shan Zheng","STKaiti";color: transparent; background: linear-gradient(45deg, red, orange, yellow, green, cyan, #fff, purple, red); -webkit-background-clip: text;}
#papa:fullscreen #lrcWrap{ z-index:88 !important;margin:850px 0;}
@keyframes hue-rotate{50%{filter:hue-rotate(360deg)contrast(200%)brightness(110%);}}
#bs {animation: color 3s linear infinite ;}
@keyframes color { 50% { filter: hue-rotate(360deg) brightness(260%);} }
#xiaobo { z-index: 10; width: 350px; height: 220px; margin: 0; position:absolute; overflow: hidden; --state: running; cursor:pointer; bottom:-3%; right:-3%; transform: scale(0.6);transform-origin: center; }
.hexahedron { width: 210px; height: 210px; margin: 0; border: 2px solid #8b4523; position: relative; z-index: 1; background:#8E731B url('https://img-baofun.zhhainiao.com/pcwallpaper_ugc/live/9760395dc64178d0cf57d5853d2d8bee.jpg') no-repeat center/cover; border-radius: 12px; -webkit-mask: radial-gradient(circle at 98% 50%,transparent 40px,red 0%); }
#cp { position: relative; top: 0; left: 0;z-index: 10; width: 200px; height: 200px; transition: 6s; background:repeating-radial-gradient(#000000, #333300 8px, #333333 8.35px); border-radius: 50%; }
.overlay { position: absolute; left: 0; top: 0; width: 200px; height: 200px; background: linear-gradient(55deg, transparent 40%, rgba(255,255,255,0.35),60%, transparent); border-radius: 50%; }
.inner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; box-shadow: 0 0 0 1px #333,0 0 0 2px #aaa; background:#FFD700; border-radius: 50%; }
.inner::after { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 8px; height: 8px; background: #FFCC00; border-radius: 50%; }
#all { position: absolute; width:200px; height:200px; top: 7px; left: 110px; z-index: -1; transition: 2s; animation:tion 3s linear 1.5s infinite; animation-play-state: var(--state); }
@keyframes tion { 0% {} 100% { transform: rotate(360deg); } }
#smsvg{ z-index: 10; position: relative; left: 50%; top: 50%; transform: translate(-50%, -50%); }
#statusDisplay{position:absolute;display: inline-block;transform: translate(-50%, -50%);text-align: center;z-index:3;font-size:1.5em;font-weight:50;left:65%;top:25%;color:#fff;}
#fullscreen{position: absolute;border-radius: 4px;color:#00F5FF;background:#0000;box-shadow:0px 0px 0px 0px #fff;padding: 8px 8px;z-index: 9;font-size:25px;font-weight:100;opacity:0;border: none;cursor: pointer;top: 20px;right:2%;}
#papa:hover #fullscreen { opacity:.8; }
#fullscreen:hover { font-style:italic; }
#mplayer{position:absolute;text-align:center;width:50%;top:92%;transform:translate(-50%);left:50%;z-index:10;font-size:18px;color:#0066CC;}
#mplayer::before{position:absolute;content:attr(data-tt);left:0;bottom:35px;width:100%;text-align-last:justify;}
#papa:fullscreen #mplayer{top:95%;}
#mprog{width:100%;height:2px;accent-color:darkgreen;outline:none;cursor:pointer;}
#watchContainer{ width:300px;height:300px; position:absolute; overflow:hidden;z-index: 10; cursor:pointer;bottom:-5.5%; left:-2%; transform: scale(0.5);transform-origin: center; }
#watchBg{ width:100%;height:100%; object-fit:cover; position:absolute; top:0;left:0; z-index:1; }
.clock-hand{ position:absolute; left:50%; bottom:50%; transform-origin:center bottom; border-radius:4px; z-index:2; transition:background-color 0.3s ease; }
.hour-hand{ width:8px;height:55px; margin-left:-4px; }
.min-hand{ width:5px;height:65px; margin-left:-2.5px; }
.sec-hand{ width:2px;height:75px; margin-left:-1px; }
.clock-center{ width:12px;height:12px; border-radius:50%; position:absolute; top:50%;left:50%; margin:-6px 0 0 -6px; z-index:3; transition:background-color 0.3s ease; }
.theme-violet .hour-hand{background:#e0bfff;}
.theme-violet .min-hand{background:#c9a0ff;}
.theme-violet .sec-hand{background:#ff4ee0;}
.theme-violet .clock-center{background:#e8c8ff;}
.theme-bronze .hour-hand{background:#b4d8ff;}
.theme-bronze .min-hand{background:#7cb8ff;}
.theme-bronze .sec-hand{background:#29d8ff;}
.theme-bronze .clock-center{background:#90c8ff;}
.theme-black .hour-hand{background:#ffd89c;}
.theme-black .min-hand{background:#ffb866;}
.theme-black .sec-hand{background:#ff4820;}
.theme-black .clock-center{background:#ffc270;}
.stage{
position:fixed;top:50%;left:50%;
width:1300px;height:720px;
transform:translate(-50%, -50%) scale(var(--stage-scale,1));
transform-origin:center center;
overflow:hidden;perspective:1400px;perspective-origin:50% 50%;
}
.stage canvas{position:absolute;inset:0;width:100%;height:100%;z-index:1;display:block;}
#papa:fullscreen .stage{position:absolute;top:55%;}
</style>
</head>
<body>
<div id="papa" >
<div class="stage" id="stage">
<canvas id="fountainCanvasFull"></canvas>
</div>
<video class="vid" src=" "autoplay loop preload="auto" playsinline muted></video>
<video class="vid" src="https://yw83yw.oss-cn-hangzhou.aliyuncs.com/lvzhou/flash/MP4/DH04.mp4"autoplay loop preload="auto" playsinline muted></video>
<div class='intro'></div>
<div id="baiBox">
<span >我的爱只能让你拥有 (烟嗓版) - 安倍儿</span>
</div>
<div id="fullscreen">全屏欣赏</div>
<span id="statusDisplay"></span >
<div id="bs" ><div id="lrcWrap" data-lrc="我的爱只能让你拥有 (烟嗓版) - 安倍儿"></div></div>
<div id="mplayer" data-tt="00:00 00:00"><input id="mprog" type="range" min="0" max="100" step="any" value="0" title="调节进度"/></div>
<div id="xiaobo">
<div class="hexahedron"></div>
<div id="all">
<div id="cp">
<div class="inner">
<svg id="smsvg" width="200" height="200">
<defs>
<path id="path" d="M0 100 A100 100 0 1 1 200 100 A100 100 0 1 1 0 100"/>
</defs>
<text dx="77" dy="77" font-size="16" fill="#aaaaaa" font-family="'楷体'">
<textPath href="#path" textLength="535"> KAIXINKUAILEXIAOXIAOBO</textPath>
</text>
</svg>
</div>
<div class="overlay"></div>
</div>
</div>
</div>
<div id="watchContainer">
<img id="watchBg" alt="钟表背景" />
<div class="clock-hand hour-hand"></div>
<div class="clock-hand min-hand"></div>
<div class="clock-hand sec-hand"></div>
<div class="clock-center"></div>
</div>
</div>
<script>
const xiaobo = document.getElementById('xiaobo');
const all = document.getElementById('all');
const lrcWrap = document.getElementById('lrcWrap');
const baiBox = document.getElementById('baiBox');
const vids = document.querySelectorAll('video');
const statusDisplay = document.getElementById('statusDisplay');
const fullscreen = document.getElementById('fullscreen');
const mplayer = document.getElementById('mplayer');
const mprog = document.getElementById('mprog');
let aud;
aud = new Audio('https://www.joy127.com/url/159789.mp3');
aud.loop = true;
aud.preload = 'auto';
aud.muted = true;
var lrcAr = [];
let rafId = null;
let lastLrcIdx = -1;
var getAr = (text) => {
var ar = text.trim().split('\n');
var reg = /\[(\d+):(\d+)\.(\d+)\](.*)/;
ar.forEach(item => {
let result = item.match(reg);
if(!result) return;
let tmsg = parseInt(result) * 60 + parseInt(result) + parseInt(result) / 100;
lrcAr.push(.trim()]);
});
lrcAr.sort((a,b)=> a-b);
};
var mseek = false;
const toMin = (val) => {
if (!val || isNaN(val)) return '00:00';
val = Math.floor(val);
let min = Math.floor(val / 60);
let sec = Math.floor(val % 60);
min = min < 10 ?'0' + min : min;
sec = sec < 10 ?'0' + sec : sec;
return min + ':' + sec;
}
function renderPlayTime() {
if(!aud.duration) return;
const rem = aud.duration - aud.currentTime;
if(!aud.paused){
statusDisplay.innerHTML = `<span style="color:#CC00FF"> 播放中:</span><span style="color:#FF0088">-${toMin(rem)}</span>`;
}else{
statusDisplay.innerHTML = `<span style="color:#CC00FF"> 已暂停 </span>`;
}
}
function updateLrcRAF(){
if(lrcAr.length === 0) return;
const idx = findLrcIndex(aud.currentTime);
if(idx !== lastLrcIdx){
lrcWrap.dataset.lrc = lrcAr;
lastLrcIdx = idx;
}
rafId = requestAnimationFrame(updateLrcRAF);
}
aud.ontimeupdate = () => {
if(!aud.paused && aud.duration) renderPlayTime();
if(!mseek) mprog.value = (aud.currentTime / aud.duration) * 100;
mplayer.dataset.tt = toMin(aud.currentTime) + ' ' + toMin(aud.duration);
};
mprog.onmousedown = () => mseek = true;
mprog.onmouseup = () => mseek = false;
mprog.onchange = () => {
if (!aud.duration) return;
const targetTime = (mprog.value / 100) * aud.duration;
aud.currentTime = targetTime;
};
mprog.oninput = () => {
if(!aud.duration) return;
let currentTime = (mprog.value / 100) * aud.duration;
mplayer.dataset.tt = toMin(currentTime) + ' ' + toMin(aud.duration);
if(mseek){
aud.currentTime = currentTime;
}
};
var lrc = `我的爱只能让你拥有 (烟嗓版)-安倍儿
词:CC
曲:CC
LRC编辑:醉美水芙蓉
耳畔还残留
你为我唱的温柔余韵
没想停留 你曾轻声问
我和你能否到如今
黑夜不停不停侵蚀 思念不停的延伸
在你的光阴 我从未放弃追寻
当我握在你手心 只想轻轻对你讲
我的真心
只想让你都感应
我的爱只能够 让你一个人独自占领
我的灵和执着 始终守候在你梦境
我的伤和泪滴 化为细雨为你而倾
藏在无边无际沉沉长夜 爱你的我
耳畔还残留
你为我唱的温柔余韵
没想停留 你曾轻声问
我和你能否到如今
黑夜不停不停侵蚀 思念不停的延伸
在你的光阴 我从未放弃追寻
当我握在你手心 只想轻轻对你讲
我的真心
只想让你都感应
我的爱只能够 让你一个人独自占领
我的灵和执着 始终守候在你梦境
我的伤和泪滴 化为细雨为你而倾
藏在无边无际沉沉长夜 爱你的我
谢谢欣赏!
`;
getAr(lrc);
function findLrcIndex(time) {
if(lrcAr.length === 0) return 0; // 保护
let left = 0;
let right = lrcAr.length - 1;
let res = 0;
while(left <= right){
const mid = Math.floor((left + right)/2);
if(lrcAr <= time){
res = mid;
left = mid + 1;
}else{
right = mid -1;
}
}
return res;
}
const mState = () => {
if(aud.paused) {
vids.forEach(vid => vid.pause());
baiBox.style.animationPlayState = 'paused';
xiaobo.classList.add('stop');xiaobo.style.opacity = '0.66';
watchContainer.title = xiaobo.title = '播放/空格键';
papa.classList.add('stop');
all.classList.add('stop');
bs.classList.add('stop');
all.style.left = '30px';ClockController.stop();
cancelAnimationFrame(rafId);
} else {
vids.forEach(vid =>vid.play());
baiBox.style.animationPlayState = 'running';
xiaobo.classList.remove('stop');xiaobo.style.opacity = '0.99';
watchContainer.title = xiaobo.title = '暂停/空格键';
papa.classList.remove('stop');
all.classList.remove('stop');
bs.classList.remove('stop');
all.style.left = '110px';ClockController.start();
cancelAnimationFrame(rafId);
updateLrcRAF();
}
renderPlayTime();fountain.togglePlay();
};
aud.addEventListener('pause', mState);
aud.addEventListener('playing', mState);
xiaobo.addEventListener('click', () => {
aud.paused ? aud.play() : aud.pause();
})
let fs = true;
fullscreen.onclick = () => {
if (fs) {
fullscreen.innerText = '退出全屏';
papa.requestFullscreen();
} else {
fullscreen.innerText = '全屏欣赏';
document.exitFullscreen();
}
fs = !fs;
};
window.addEventListener('beforeunload', ()=>{
cancelAnimationFrame(rafId);
})
const ClockController = (function(){
const hourHand = document.querySelector('.hour-hand');
const minHand = document.querySelector('.min-hand');
const secHand = document.querySelector('.sec-hand');
let lastSecond = -1;
let rafId1 = null;
let isRunning = true;
function render(timestamp) {
if(!isRunning) return;
const now = new Date();
const sec = now.getSeconds();
const min = now.getMinutes();
const hr = now.getHours() % 12;
if(sec !== lastSecond){
lastSecond = sec;
const secDeg = sec * 6;
const minDeg = min * 6 + sec * 0.1;
const hrDeg = hr * 30 + min * 0.5;
secHand.style.transform = `rotate(${secDeg}deg)`;
minHand.style.transform = `rotate(${minDeg}deg)`;
hourHand.style.transform = `rotate(${hrDeg}deg)`;
}
rafId1 = requestAnimationFrame(render);
}
function start(){
if(isRunning) return;
isRunning = true;
rafId1 = requestAnimationFrame(render);
}
function stop(){
if(!isRunning) return;
isRunning = false;
if(rafId1){
cancelAnimationFrame(rafId1);
rafId1 = null;
}
}
function toggle(){
isRunning ? stop() : start();
}
rafId1 = requestAnimationFrame(render);
return {toggle, start, stop};
})();
(function() {
var themes = [
{ name: '亮紫色', cls: 'theme-violet', clockBg: 'https://i.uik.cc/view.php/2f721280a52c2e707bcfce086bbc75f3.png ' },
{ name: '钛金蓝', cls: 'theme-bronze', clockBg: 'https://i.uik.cc/view.php/77fa24dac3481e0b3640d3fcd424da95.png'},
{ name: '亮铜色', cls: 'theme-black',clockBg: 'https://i.uik.cc/view.php/2f721280a52c2e707bcfce086bbc75f3.png' }
];
var idx = 0;
function apply(i) {
var t = themes;
var c = document.getElementById('watchContainer');
c.classList.remove('theme-bronze', 'theme-violet', 'theme-black');
c.classList.add(t.cls);
var bg = document.getElementById('watchBg');
bg.style.transition = 'opacity 0.15s ease';
bg.style.opacity = '0.3';
setTimeout(function() {
bg.src = t.clockBg;
bg.style.transition = 'opacity 0.3s ease';
bg.style.opacity = '1';
}, 150);
}
document.addEventListener('DOMContentLoaded', function() {
apply(0);
document.getElementById('watchContainer').addEventListener('click', function() {
idx = (idx + 1) % themes.length;
apply(idx);
aud.paused ? aud.play() : aud.pause();
ClockController.toggle();fountain.togglePlay();
});
});
})();
window.addEventListener('beforeunload', ()=>{
cancelAnimationFrame(rafId1);
})
document.addEventListener('visibilitychange', () => {
if (document.hidden) {
if (!aud.paused) {
aud.pause();
}
} else {
if (aud.paused) {
aud.play().catch(()=>{});
}
}
});
['contextmenu', 'dragstart','selectstart'].forEach(type =>
document.getElementById('papa').addEventListener(type, e => e.preventDefault()));
const fountain = (function(){
const CONFIG = {
BASE_WIDTH:1450,BASE_HEIGHT:770,SCALE_FACTOR:1.10,
POOL_CENTER_X_RATIO:0.49,POOL_CENTER_Y_RATIO:0.80,
POOL_RADIUS_X:355,POOL_RADIUS_X_RATIO:0.27,POOL_RADIUS_Y:45,
MAX_COLUMN_HEIGHT:450,MAX_COLUMN_HEIGHT_RATIO:0.38,
COLUMN_COUNT:56,MAX_PARTICLES:800,MAX_ARCS:0,
MODE_DURATION:12000,TRANSITION_TIME:1500
};
const BASE_WIDTH=CONFIG.BASE_WIDTH,BASE_HEIGHT=CONFIG.BASE_HEIGHT,SCALE_FACTOR=CONFIG.SCALE_FACTOR;
const canvas=document.getElementById('fountainCanvasFull');
const stage=document.getElementById('stage');
let ctx=canvas.getContext('2d');
canvas.width=BASE_WIDTH;canvas.height=BASE_HEIGHT;
function updateStageScale(){
if (fs){
const scale=Math.min(window.innerWidth/BASE_WIDTH,window.innerHeight/BASE_HEIGHT)*0.5;stage.style.setProperty('--stage-scale',scale);
}else{
const scale=Math.min(window.innerWidth/BASE_WIDTH,window.innerHeight/BASE_HEIGHT)*0.8;stage.style.setProperty('--stage-scale',scale);
}
}
updateStageScale();
window.addEventListener('resize',updateStageScale);
const MODES=[
{name:'🌊 舒缓波浪',color:'#5ec8ff',type:'vertical',
heightFn:(t,i,angle)=>{
const w1=Math.sin(t*0.9+angle*1.5)*0.5,w2=Math.sin(t*1.4+angle*2.8)*0.3,w3=Math.sin(t*0.5+i*0.3)*0.2;
return 0.35+(w1+w2+w3)*0.45;
},speed:1.0,maxHeightScale:0.85,particleRate:0.14,hueSpeed:30,tiltAngle:0,arcChance:0,arcCount:0},
{name:'⚡ 强劲脉冲',color:'#ff5a8a',type:'vertical',
heightFn:(t,i,angle)=>{
const pulse=Math.pow(Math.abs(Math.sin(t*1.8)),1.5),altern=Math.sin(i*1.3+t*0.8)*0.15+0.85;
return 0.25+pulse*altern*0.75;
},speed:1.3,maxHeightScale:1.15,particleRate:0.32,hueSpeed:80,tiltAngle:0,arcChance:0,arcCount:0},
{name:'🎵 律动起伏',color:'#b58aff',type:'vertical',
heightFn:(t,i,angle)=>{
const parity=(i%2===0)?1:-1,beat=Math.sin(t*2.0)*0.5+0.5,local=Math.sin(angle*6+t*1.5)*0.3;
return 0.35+parity*beat*0.35+local*0.3;
},speed:1.0,maxHeightScale:1.05,particleRate:0.22,hueSpeed:55,tiltAngle:0,arcChance:0,arcCount:0},
{name:'💧 环形涟漪',color:'#ffb347',type:'vertical',
heightFn:(t,i,angle)=>{
const ring=Math.sin(angle*4-t*1.8)*0.5+0.5,pulse=Math.sin(t*1.2)*0.2+0.8;
return 0.3+ring*pulse*0.65;
},speed:1.0,maxHeightScale:1.05,particleRate:0.24,hueSpeed:60,tiltAngle:0,arcChance:0,arcCount:0},
{name:'✨ 微光闪烁',color:'#7dffb0',type:'vertical',
heightFn:(t,i,angle)=>{
const seed=Math.sin(i*12.9898+t*2.5)*43758.5453,rand=seed-Math.floor(seed);
const sparkle=rand>0.85?0.9:0.35,baseWave=Math.sin(t*0.9+i*0.4)*0.15+0.3;
return Math.min(0.95,baseWave+sparkle*0.4);
},speed:1.0,maxHeightScale:1.15,particleRate:0.3,hueSpeed:100,tiltAngle:0,arcChance:0,arcCount:0},
{name:'🌈 彩虹轻摆',color:'#ff7ad9',type:'tilt',
heightFn:(t,i,angle)=>{
const scanPos=(t*0.6)%(Math.PI*2);let diff=Math.abs(angle-scanPos);
if(diff>Math.PI)diff=Math.PI*2-diff;
const scan=Math.exp(-diff*diff*2.5)*0.6,baseWave=Math.sin(t*1.2+angle*3)*0.2+0.25;
return Math.min(0.9,baseWave+scan);
},speed:1.0,maxHeightScale:1.0,particleRate:0.2,hueSpeed:120,
tiltAngle:(t,i,angle)=>Math.sin(angle-t*1.2)*0.15,arcChance:0,arcCount:0}
];
const MODE_DURATION=CONFIG.MODE_DURATION,TRANSITION_TIME=CONFIG.TRANSITION_TIME;
let currentModeIndex=0,modeStartTime=performance.now(),transitionProgress=1,prevModeIndex=0;
let activeMaxHeightScale=MODES.maxHeightScale,activeParticleRate=MODES.particleRate,activeHueSpeed=MODES.hueSpeed;
const COLUMN_COUNT=CONFIG.COLUMN_COUNT;
let currentHeights=[],targetHeights=[],columnPhases=[],columnSpeeds=[],columnHueOffsets=[],particles=[];
const MAX_PARTICLES=CONFIG.MAX_PARTICLES,PARTICLE_GRAVITY=0.105,PARTICLE_LIFE_DECAY=2.1;
let poolCenterX=0,poolCenterY=0,poolRadiusX=0,poolRadiusY=0,maxColumnHeight=0,columnBasePoints=[];
let animationId=null,globalPaused=false;
function initArrays(){
currentHeights=new Array(COLUMN_COUNT).fill(8);
targetHeights=new Array(COLUMN_COUNT).fill(12);
columnPhases=new Array(COLUMN_COUNT);columnSpeeds=new Array(COLUMN_COUNT);columnHueOffsets=new Array(COLUMN_COUNT);
for(let i=0;i<COLUMN_COUNT;i++){
let angle=(i/COLUMN_COUNT)*Math.PI*2;
columnPhases=angle*1.5;
let speedBase=0.9+(Math.sin(angle)*0.4);
columnSpeeds=1.2+speedBase+Math.sin(i*0.5)*0.3;
columnHueOffsets=(angle*180/Math.PI+i*13)%360;
}
}
function updatePoolGeometry(){
poolCenterX=BASE_WIDTH*CONFIG.POOL_CENTER_X_RATIO;
poolCenterY=BASE_HEIGHT*CONFIG.POOL_CENTER_Y_RATIO;
poolRadiusX=Math.min(BASE_WIDTH*CONFIG.POOL_RADIUS_X_RATIO,CONFIG.POOL_RADIUS_X)*SCALE_FACTOR;
poolRadiusY=CONFIG.POOL_RADIUS_Y*SCALE_FACTOR;
maxColumnHeight=Math.min(BASE_HEIGHT*CONFIG.MAX_COLUMN_HEIGHT_RATIO,CONFIG.MAX_COLUMN_HEIGHT)*SCALE_FACTOR;
maxColumnHeight=Math.max(80,maxColumnHeight);
}
function computeColumnBasePoints(){
columnBasePoints=[];
for(let i=0;i<COLUMN_COUNT;i++){
let angle=(i/COLUMN_COUNT)*Math.PI*2;
let x=poolCenterX+poolRadiusX*Math.cos(angle);
let y=poolCenterY+poolRadiusY*Math.sin(angle);
columnBasePoints.push({x,y,angle,depth:y,idx:i});
}
columnBasePoints.sort((a,b)=>a.depth-b.depth);
}
function updateMode(now){
const elapsed=now-modeStartTime;
if(elapsed>MODE_DURATION&&transitionProgress>=1){
prevModeIndex=currentModeIndex;
currentModeIndex=(currentModeIndex+1)%MODES.length;
modeStartTime=now;
transitionProgress=0;
}
if(transitionProgress<1){
transitionProgress+=16.67/TRANSITION_TIME;
if(transitionProgress>1)transitionProgress=1;
}
const currMode=MODES,prevMode=MODES;
const t=easeInOutCubic(transitionProgress);
activeMaxHeightScale=lerp(prevMode.maxHeightScale,currMode.maxHeightScale,t);
activeParticleRate=lerp(prevMode.particleRate,currMode.particleRate,t);
activeHueSpeed=lerp(prevMode.hueSpeed,currMode.hueSpeed,t);
return {currMode,prevMode,t};
}
function easeInOutCubic(x){return x<0.5?4*x*x*x:1-Math.pow(-2*x+2,3)/2;}
function lerp(a,b,t){return a+(b-a)*t;}
function updateTargetHeights(now,modeInfo){
const {currMode,prevMode,t}=modeInfo;
const globalT=now*0.001;
for(let i=0;i<COLUMN_COUNT;i++){
let angle=(i/COLUMN_COUNT)*Math.PI*2;
let hCurr=currMode.heightFn(globalT*currMode.speed,i,angle);
let hPrev=prevMode.heightFn(globalT*prevMode.speed,i,angle);
let hMix=lerp(hPrev,hCurr,t);
let jitter=Math.sin(globalT*18+i*1.3)*0.04;
let norm=Math.max(0.05,Math.min(1,hMix+jitter));
let target=maxColumnHeight*norm*activeMaxHeightScale;
targetHeights=Math.max(8,target);
}
}
function smoothCurrentHeights(){
for(let i=0;i<COLUMN_COUNT;i++){
let diff=targetHeights-currentHeights;
currentHeights+=diff*0.16;
if(Math.abs(currentHeights-targetHeights)<0.6)currentHeights=targetHeights;
if(currentHeights<1)currentHeights=0;
}
}
function drawColumn(baseX,baseY,height,angle,idx,modeHueShift,tilt){
if(height<=2.5)return;
let widthScale=0.8+Math.abs(Math.cos(angle))*0.4;
let columnWidth=Math.min(15.4,Math.max(5,11*widthScale));
let topOffsetX=Math.sin(tilt)*height;
let topOffsetY=-Math.cos(tilt)*height;
const time=Date.now()*0.008;
let hueBase=(time*activeHueSpeed*0.02+columnHueOffsets*1.2+modeHueShift)%360;
ctx.save();
ctx.translate(baseX,baseY);ctx.rotate(tilt);
let grad=ctx.createLinearGradient(-columnWidth/2,0,columnWidth/2,0);
let hueBottom=(hueBase+Math.sin(idx*0.7+time*2)*30)%360;
let hueTop=(hueBottom+100+Math.sin(time*1.8+idx)*40)%360;
let hueMid=(hueBottom+50+Math.cos(time*2.3+idx)*30)%360;
grad.addColorStop(0,`hsl(${hueBottom},100%,65%)`);
grad.addColorStop(0.5,`hsl(${hueMid},100%,70%)`);
grad.addColorStop(1,`hsl(${hueTop},100%,72%)`);
ctx.shadowBlur=14;ctx.shadowColor=`hsl(${(hueBase+180)%360},100%,65%)`;
ctx.fillStyle=grad;ctx.beginPath();
let radius=Math.min(4.4,columnWidth*0.3);
ctx.roundRect(-columnWidth/2,-height,columnWidth,height,radius);ctx.fill();
ctx.shadowBlur=10;ctx.shadowColor=`hsl(${(hueBase+60)%360},100%,70%)`;
ctx.strokeStyle=`hsl(${(hueBase+40)%360},100%,75%)`;ctx.lineWidth=1.6;ctx.stroke();
ctx.shadowBlur=8;ctx.shadowColor=`hsl(${(hueBase+200)%360},100%,65%)`;
ctx.strokeStyle=`hsl(${(hueBase+220)%360},100%,70%)`;ctx.lineWidth=1.3;
ctx.beginPath();ctx.roundRect(-columnWidth/2-0.6,-height-0.6,columnWidth+1.2,height+1.2,radius+0.4);ctx.stroke();
ctx.shadowBlur=12;ctx.shadowColor=`hsl(${(hueBase+300)%360},100%,75%)`;
ctx.fillStyle=`hsl(${(hueBase+300)%360},100%,80%)`;
for(let k=0;k<3;k++){
let segY=-height*((time*2+k*0.7+idx*0.3)%1);
let segH=Math.min(4,height*0.1);let segW=columnWidth*0.6;
ctx.beginPath();ctx.roundRect(-segW/2,segY,segW,segH,1.5);ctx.fill();
}
let glowSize=columnWidth*0.6;
let topGlowHue=(hueBase+180)%360;
ctx.shadowBlur=18;ctx.shadowColor=`hsl(${topGlowHue},100%,70%)`;
ctx.beginPath();ctx.arc(0,-height,glowSize*0.9,0,Math.PI*2);
let glowGrad=ctx.createRadialGradient(0,-height,1.5,0,-height,glowSize);
glowGrad.addColorStop(0,`hsl(${topGlowHue},100%,90%)`);
glowGrad.addColorStop(0.6,`hsl(${(topGlowHue+40)%360},100%,70%)`);
glowGrad.addColorStop(1,`hsla(${topGlowHue},100%,60%,0)`);
ctx.fillStyle=glowGrad;ctx.fill();ctx.restore();
let topWorldX=baseX+topOffsetX,topWorldY=baseY+topOffsetY;
let dirVX=Math.sin(tilt)*1.2,dirVY=-Math.cos(tilt)*1.2;
let tangentVX=Math.cos(tilt)*0.8,tangentVY=Math.sin(tilt)*0.8;
let tiltMagnitude=Math.abs(tilt);let swingStrength=0.5+tiltMagnitude*2.2;
let emitProb=activeParticleRate*(0.5+height/maxColumnHeight);
if(Math.random()<emitProb&&particles.length<MAX_PARTICLES){
let count=2+(height>maxColumnHeight*0.5?2:1);
for(let p=0;p<count;p++){
let particleHue=(hueBase+Math.random()*120)%360;
let swingDir=Math.random()<0.5?1:-1;
let swingAmount=(0.5+Math.random()*1.2)*swingStrength*swingDir;
particles.push({
x:topWorldX+(Math.random()-0.5)*columnWidth,
y:topWorldY+(Math.random()-0.5)*6,
vx:dirVX+tangentVX*swingAmount+(Math.random()-0.5)*1.0,
vy:dirVY+tangentVY*swingAmount-0.5-Math.random()*1.5,
life:32+Math.random()*48,maxLife:70,radius:1.4+Math.random()*2.8,
hue:particleHue,hueShift:0.6+Math.random()*1.5,inertia:swingAmount*0.15
});
}
}
}
function updateParticles(){
for(let i=0;i<particles.length;i++){
let p=particles;
p.x+=p.vx;p.y+=p.vy;p.vy+=PARTICLE_GRAVITY;
if(p.inertia){
let len=Math.sqrt(p.vx*p.vx+p.vy*p.vy)||1;
let perpX=-p.vy/len,perpY=p.vx/len;
p.vx+=perpX*p.inertia;p.vy+=perpY*p.inertia;
}
p.life-=PARTICLE_LIFE_DECAY;p.vx*=0.99;
if(p.hue!==undefined)p.hue=(p.hue+(p.hueShift||0.8))%360;
if(p.y>BASE_HEIGHT-15||p.y<-50||p.x<-80||p.x>BASE_WIDTH+80||p.life<=0){
particles.splice(i,1);i--;
}
}
if(particles.length>MAX_PARTICLES)particles=particles.slice(0,MAX_PARTICLES);
}
function drawParticles(){
for(let p of particles){
let lifeFactor=p.life/p.maxLife;let alpha=Math.min(0.85,lifeFactor*0.9);
let hue=p.hue!==undefined?p.hue:190;
ctx.shadowBlur=12;ctx.shadowColor=`hsl(${hue},100%,70%)`;
ctx.beginPath();ctx.arc(p.x,p.y,p.radius*(0.7+lifeFactor*0.4),0,Math.PI*2);
ctx.fillStyle=`hsla(${hue},100%,68%,${alpha})`;ctx.fill();
ctx.beginPath();ctx.arc(p.x-0.6,p.y-0.6,p.radius*0.35,0,Math.PI*2);
ctx.fillStyle=`hsla(${(hue+180)%360},100%,85%,${alpha*0.9})`;ctx.fill();
ctx.shadowBlur=0;
}
}
function drawPool(){
ctx.shadowBlur=12;ctx.shadowColor=`hsl(${(Date.now()*0.05)%360},100%,60%)`;
ctx.beginPath();ctx.ellipse(poolCenterX,poolCenterY,poolRadiusX+5,poolRadiusY+4,0,0,Math.PI*2);
ctx.fillStyle="#14273e";ctx.fill();
ctx.beginPath();ctx.ellipse(poolCenterX,poolCenterY,poolRadiusX,poolRadiusY,0,0,Math.PI*2);
let waterGrad=ctx.createLinearGradient(poolCenterX-poolRadiusX,poolCenterY,poolCenterX+poolRadiusX,poolCenterY);
let huePool=(Date.now()*0.1)%360;
waterGrad.addColorStop(0,`hsl(${huePool},80%,35%)`);
waterGrad.addColorStop(0.5,`hsl(${(huePool+60)%360},80%,45%)`);
waterGrad.addColorStop(1,`hsl(${(huePool+120)%360},80%,30%)`);
ctx.fillStyle=waterGrad;ctx.fill();
ctx.globalCompositeOperation='lighter';
for(let i=0;i<16;i++){
let time=Date.now()*0.004;
let rad=0.5+Math.sin(time+i)*0.2;
let hueWave=(time*50+i*20)%360;
ctx.beginPath();ctx.ellipse(poolCenterX+Math.sin(time*0.7+i)*8,poolCenterY+Math.cos(time*0.5+i)*4,poolRadiusX*0.65*rad,poolRadiusY*0.55*rad,0,0,Math.PI*2);
ctx.fillStyle=`hsla(${hueWave},100%,70%,0.12)`;ctx.fill();
}
ctx.globalCompositeOperation='source-over';
let hueEdge=(Date.now()*0.15)%360;
ctx.beginPath();ctx.ellipse(poolCenterX,poolCenterY,poolRadiusX-1,poolRadiusY-1,0,0,Math.PI*2);
ctx.strokeStyle=`hsl(${hueEdge},100%,70%)`;ctx.lineWidth=1.6;ctx.stroke();
ctx.shadowBlur=0;
}
function addAmbientGlow(){
let time=Date.now()*0.002;let hueGlow=(time*30)%360;
ctx.globalCompositeOperation='lighter';
ctx.beginPath();ctx.ellipse(poolCenterX,poolCenterY+3,poolRadiusX*0.9,poolRadiusY*1.1,0,0,Math.PI*2);
ctx.fillStyle=`hsla(${hueGlow},100%,60%,0.06)`;ctx.fill();
ctx.globalCompositeOperation='source-over';
}
function renderFrame(now){
if(!ctx)return;
if(globalPaused){animationId=requestAnimationFrame(renderFrame);return;}
const modeInfo=updateMode(now);
const modeHueShift=(now*0.01)%360;
updateTargetHeights(now,modeInfo);
smoothCurrentHeights();
ctx.clearRect(0,0,BASE_WIDTH,BASE_HEIGHT);
ctx.shadowBlur=0;ctx.shadowColor="transparent";
drawPool();
const currMode=MODES,prevMode=MODES;
const tMode=easeInOutCubic(transitionProgress);
for(let point of columnBasePoints){
let idx=point.idx;let height=currentHeights;
if(height>2){
let tilt=0;
if(currMode.tiltAngle){
let tCurr=typeof currMode.tiltAngle==='function'?currMode.tiltAngle(now*0.001,idx,point.angle):currMode.tiltAngle;
let tPrev=typeof prevMode.tiltAngle==='function'?prevMode.tiltAngle(now*0.001,idx,point.angle):(prevMode.tiltAngle||0);
tilt=lerp(tPrev,tCurr,tMode);
}
drawColumn(point.x,point.y,height,point.angle,idx,modeHueShift,tilt);
}
}
updateParticles();drawParticles();addAmbientGlow();
ctx.shadowBlur=8;
for(let i=0;i<16;i++){
let t=Date.now()*0.003;let radAngle=t+i;
let hueDot=(t*80+i*25)%360;
let xOff=Math.sin(radAngle)*poolRadiusX*0.55;
let yOff=Math.cos(radAngle*0.9)*poolRadiusY*0.45;
ctx.beginPath();ctx.arc(poolCenterX+xOff,poolCenterY+yOff,1.5+Math.sin(t*2+i)*1,0,Math.PI*2);
ctx.fillStyle=`hsla(${hueDot},100%,70%,0.5)`;ctx.fill();
}
ctx.shadowBlur=0;
animationId=requestAnimationFrame(renderFrame);
}
if(!CanvasRenderingContext2D.prototype.roundRect){
CanvasRenderingContext2D.prototype.roundRect=function(x,y,w,h,r){
if(w<2*r)r=w/2;if(h<2*r)r=h/2;
this.moveTo(x+r,y);this.lineTo(x+w-r,y);
this.quadraticCurveTo(x+w,y,x+w,y+r);
this.lineTo(x+w,y+h-r);
this.quadraticCurveTo(x+w,y+h,x+w-r,y+h);
this.lineTo(x+r,y+h);
this.quadraticCurveTo(x,y+h,x,y+h-r);
this.lineTo(x,y+r);
this.quadraticCurveTo(x,y,x+r,y);
return this;
};
}
function initFountain(){
updatePoolGeometry();initArrays();computeColumnBasePoints();
for(let i=0;i<COLUMN_COUNT;i++){currentHeights=8;targetHeights=18;}
animationId=requestAnimationFrame(renderFrame);
}
function togglePlay(){
globalPaused = aud.paused;
}
function init(){
initFountain();
}
if(document.readyState==='loading'){
document.addEventListener('DOMContentLoaded',init);
}else{
init();
}
return {togglePlay};
})();
document.addEventListener('keydown',(e)=>{
if(e.code==='Space'){
e.preventDefault();
aud.paused ? aud.play() : aud.pause();
}
});
(function() {
aud.play().catch(err=>{
console.log("自动播放被浏览器拦截,请点击页面播放",err);
});aud.muted = false;
})()
</script>
好听好看,谢谢友友分享 klxf 发表于 2026-11-1 16:30
好听好看,谢谢友友分享
谢谢友友光临!
页:
[1]