元神(2)
2025-10-07 15:16:48
发布于:安徽
<section id="elements" class="py-16 px-4 bg-gray-900">
<div class="container mx-auto">
<h2 class="text-3xl md:text-4xl font-bold mb-2 text-center">元素反应</h2>
<p class="text-gray-400 text-center mb-12">探索七大元素之间的奇妙反应</p>
<!-- 元素选择器 -->
<div class="element-selector justify-center">
<div class="element-btn" data-element="anemo">
<img src="https://p11-doubao-search-sign.byteimg.com/labis/7ac9b0af30df95690f374b968086d145~tplv-be4g95zd3a-image.jpeg?rk3s=542c0f93&x-expires=1765005047&x-signature=dOrvWfJD0uJmI36Gl7GMS6GHluk%3D" alt="风">
</div>
<div class="element-btn" data-element="geo">
<img src="https://p11-doubao-search-sign.byteimg.com/labis/7ac9b0af30df95690f374b968086d145~tplv-be4g95zd3a-image.jpeg?rk3s=542c0f93&x-expires=1765005047&x-signature=dOrvWfJD0uJmI36Gl7GMS6GHluk%3D" alt="岩">
</div>
<div class="element-btn" data-element="electro">
<img src="https://p11-doubao-search-sign.byteimg.com/labis/7ac9b0af30df95690f374b968086d145~tplv-be4g95zd3a-image.jpeg?rk3s=542c0f93&x-expires=1765005047&x-signature=dOrvWfJD0uJmI36Gl7GMS6GHluk%3D" alt="雷">
</div>
<div class="element-btn" data-element="dendro">
<img src="https://p11-doubao-search-sign.byteimg.com/labis/7ac9b0af30df95690f374b968086d145~tplv-be4g95zd3a-image.jpeg?rk3s=542c0f93&x-expires=1765005047&x-signature=dOrvWfJD0uJmI36Gl7GMS6GHluk%3D" alt="草">
</div>
<div class="element-btn" data-element="hydro">
<img src="https://p11-doubao-search-sign.byteimg.com/labis/7ac9b0af30df95690f374b968086d145~tplv-be4g95zd3a-image.jpeg?rk3s=542c0f93&x-expires=1765005047&x-signature=dOrvWfJD0uJmI36Gl7GMS6GHluk%3D" alt="水">
</div>
<div class="element-btn" data-element="pyro">
<img src="https://p11-doubao-search-sign.byteimg.com/labis/7ac9b0af30df95690f374b968086d145~tplv-be4g95zd3a-image.jpeg?rk3s=542c0f93&x-expires=1765005047&x-signature=dOrvWfJD0uJmI36Gl7GMS6GHluk%3D" alt="火">
</div>
<div class="element-btn" data-element="cryo">
<img src="https://p11-doubao-search-sign.byteimg.com/labis/7ac9b0af30df95690f374b968086d145~tplv-be4g95zd3a-image.jpeg?rk3s=542c0f93&x-expires=1765005047&x-signature=dOrvWfJD0uJmI36Gl7GMS6GHluk%3D" alt="冰">
</div>
</div>
<!-- 元素反应可视化 -->
<div class="element-reaction-container rounded-lg overflow-hidden">
<canvas id="elementReactionCanvas"></canvas>
<div class="reaction-info">
<h3 class="text-xl font-bold mb-2">选择两个元素查看反应效果</h3>
<p class="text-gray-400">点击上方元素图标,观察它们之间的相互作用</p>
</div>
</div>
<!-- 反应结果 -->
<div class="reaction-result" id="reactionResult">
<h3 class="text-xl font-bold mb-4" id="reactionName">反应名称</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<div>
<h4 class="text-lg font-semibold mb-2">效果说明</h4>
<p class="text-gray-300" id="reactionDescription">反应效果描述</p>
</div>
<div>
<h4 class="text-lg font-semibold mb-2">策略建议</h4>
<p class="text-gray-300" id="reactionStrategy">反应策略建议</p>
</div>
</div>
</div>
<!-- 元素反应表格 -->
<div class="mt-16 overflow-x-auto">
<table class="w-full border-collapse">
<thead>
<tr class="bg-gray-800">
<th class="py-3 px-4 text-left">反应</th>
<th class="py-3 px-4 text-left">元素组合</th>
<th class="py-3 px-4 text-left">效果</th>
</tr>
</thead>
<tbody>
<tr class="border-b border-gray-800">
<td class="py-3 px-4">蒸发</td>
<td class="py-3 px-4">水 + 火</td>
<td class="py-3 px-4">按百分比提高本次攻击的伤害。水元素攻击火附着,提高100%(2倍伤害);火元素攻击水附着,提高50%(1.5倍伤害)</td>
</tr>
<tr class="border-b border-gray-800">
<td class="py-3 px-4">冻结</td>
<td class="py-3 px-4">水 + 冰</td>
<td class="py-3 px-4">强控制,使敌人无法行动。被冻结的敌人受到重攻击时会产生碎冰反应,造成额外物理伤害</td>
</tr>
<tr class="border-b border-gray-800">
<td class="py-3 px-4">融化</td>
<td class="py-3 px-4">冰 + 火</td>
<td class="py-3 px-4">按百分比提高本次攻击的伤害。火元素攻击冰附着,提高100%(2倍伤害);冰元素攻击火附着,提高50%(1.5倍伤害)</td>
</tr>
<tr class="border-b border-gray-800">
<td class="py-3 px-4">超载</td>
<td class="py-3 px-4">火 + 雷</td>
<td class="py-3 px-4">反应时发生爆炸,对敌人造成范围火元素伤害。超载反应造成的基础伤害仅与角色等级有关,且无法暴击</td>
</tr>
<tr class="border-b border-gray-800">
<td class="py-3 px-4">超导</td>
<td class="py-3 px-4">冰 + 雷</td>
<td class="py-3 px-4">反应时发生爆炸,对敌人造成范围冰元素伤害,并降低敌人一定的防御力</td>
</tr>
<tr class="border-b border-gray-800">
<td class="py-3 px-4">感电</td>
<td class="py-3 px-4">水 + 雷</td>
<td class="py-3 px-4">反应时对敌人造成额外雷元素伤害,若周围存在被水元素附着的敌人,则会向周围传导雷元素伤害</td>
</tr>
<tr class="border-b border-gray-800">
<td class="py-3 px-4">燃烧</td>
<td class="py-3 px-4">火 + 草</td>
<td class="py-3 px-4">在一段时间内,能够产生持续性的火属性伤害</td>
</tr>
<tr class="border-b border-gray-800">
<td class="py-3 px-4">扩散</td>
<td class="py-3 px-4">风 + 冰/雷/水/火</td>
<td class="py-3 px-4">根据对象元素不同,能够造出强烈的范围伤害,并引爆其他元素反应</td>
</tr>
<tr class="border-b border-gray-800">
<td class="py-3 px-4">结晶</td>
<td class="py-3 px-4">岩 + 冰/雷/水/火</td>
<td class="py-3 px-4">防御提升,能够抵消一定量的属性伤害</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<!-- 世界观介绍区 -->
<section id="world" class="py-16 px-4">
<div class="container mx-auto">
<h2 class="text-3xl md:text-4xl font-bold mb-2 text-center">提瓦特大陆</h2>
<p class="text-gray-400 text-center mb-12">探索这个充满神秘与奇迹的世界</p>
<!-- 世界地图 -->
<div class="world-map mb-16">
<div class="region-marker mondstadt" data-region="mondstadt">
<i class="fas fa-wind text-white"></i>
</div>
<div class="region-marker liyue" data-region="liyue">
<i class="fas fa-gem text-white"></i>
</div>
<div class="region-marker inazuma" data-region="inazuma">
<i class="fas fa-bolt text-white"></i>
</div>
<div class="region-marker sumeru" data-region="sumeru">
<i class="fas fa-leaf text-white"></i>
</div>
<div class="region-marker fontaine" data-region="fontaine">
<i class="fas fa-water text-white"></i>
</div>
<div class="region-info" id="regionInfo">
<h3 class="text-xl font-bold mb-2" id="regionName">地区名称</h3>
<p class="text-gray-300 mb-4" id="regionDescription">地区描述</p>
<div class="flex items-center">
<div class="element-icon" id="regionElement">
<i class="fas" id="regionElementIcon"></i>
</div>
<span id="regionElementName">元素名称</span>
</div>
</div>
</div>
<!-- 剧情脉络 -->
<div class="max-w-4xl mx-auto">
<h3 class="text-2xl font-bold mb-8 text-center">剧情脉络</h3>
<div class="timeline-item">
<h4 class="text-xl font-semibold mb-2">蒙德篇</h4>
<p class="text-gray-300">旅行者在蒙德城醒来,开始了他们的冒险之旅。结识了琴团长、安柏等伙伴,并卷入了与风魔龙特瓦林的战斗。</p>
</div>
<div class="timeline-item">
<h4 class="text-xl font-semibold mb-2">璃月篇</h4>
<p class="text-gray-300">旅行者来到璃月港,这里是岩神钟离的领地。不仅要面对新的敌人——愚人众,还要解开璃月七星与岩神之间的秘密。</p>
</div>
<div class="timeline-item">
<h4 class="text-xl font-semibold mb-2">稻妻篇</h4>
<p class="text-gray-300">旅行者前往稻妻岛,这里由雷电将军统治。需要面对强大的敌人——幕府军,并解开雷电将军与稻妻岛之间的秘密。</p>
</div>
<div class="timeline-item">
<h4 class="text-xl font-semibold mb-2">须弥篇</h4>
<p class="text-gray-300">旅行者来到须弥,这里由智慧之神纳西妲统治。面对新的敌人——教令院,同时解开纳西妲与须弥之间的秘密。</p>
</div>
<div class="timeline-item">
<h4 class="text-xl font-semibold mb-2">枫丹篇</h4>
<p class="text-gray-300">旅行者前往枫丹,这里是正义与审判的国度。将面对水神芙宁娜和各种奇妙的机械装置,揭开枫丹的秘密。</p>
</div>
</div>
</div>
</section>
<!-- 页脚 -->
<footer class="bg-gray-900 py-8 px-4 border-t border-gray-800">
<div class="container mx-auto">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<div class="flex items-center">
<img src="https://p11-doubao-search-sign.byteimg.com/labis/ebade642ff86c2e63ecee9a09f8215ca~tplv-be4g95zd3a-image.jpeg?rk3s=542c0f93&x-expires=1765005047&x-signature=tOz2HfuRj%2BJWe3QQvW5hW1lMMOI%3D" alt="原神" class="h-8 w-8 mr-2">
<span class="text-lg font-bold text-white">原神</span>
</div>
<p class="text-gray-400 mt-2">© 2025 米哈游科技(上海)有限公司</p>
</div>
<div class="flex space-x-4">
<a href="#" class="text-gray-400 hover:text-white transition duration-300">
<i class="fab fa-weibo text-xl"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white transition duration-300">
<i class="fab fa-weixin text-xl"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white transition duration-300">
<i class="fab fa-twitter text-xl"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white transition duration-300">
<i class="fab fa-instagram text-xl"></i>
</a>
</div>
</div>
</div>
</footer>
<script>
// 页面加载完成后执行
document.addEventListener('DOMContentLoaded', function() {
// 加载动画
setTimeout(function() {
document.querySelector('.loader').classList.add('hidden');
}, 1500);
// 移动端菜单
const mobileMenuButton = document.getElementById('mobile-menu-button');
const mobileMenu = document.getElementById('mobile-menu');
mobileMenuButton.addEventListener('click', function() {
mobileMenu.classList.toggle('hidden');
});
// 导航链接高亮
const navLinks = document.querySelectorAll('.nav-link');
const sections = document.querySelectorAll('section');
window.addEventListener('scroll', function() {
let current = '';
sections.forEach(section => {
const sectionTop = section.offsetTop;
const sectionHeight = section.clientHeight;
if (pageYOffset >= (sectionTop - 200)) {
current = section.getAttribute('id');
}
});
navLinks.forEach(link => {
link.classList.remove('active');
if (link.getAttribute('href').substring(1) === current) {
link.classList.add('active');
}
});
});
// 角色筛选
const filterButtons = document.querySelectorAll('.filter-btn');
const characterCards = document.querySelectorAll('.character-card');
filterButtons.forEach(button => {
button.addEventListener('click', function() {
// 移除所有按钮的active类
filterButtons.forEach(btn => btn.classList.remove('active'));
// 添加当前按钮的active类
this.classList.add('active');
const filter = this.getAttribute('data-filter');
characterCards.forEach(card => {
if (filter === 'all' || card.getAttribute('data-element') === filter) {
card.style.display = 'block';
} else {
card.style.display = 'none';
}
});
});
});
// 元素反应
const elementButtons = document.querySelectorAll('.element-btn');
const reactionResult = document.getElementById('reactionResult');
const reactionName = document.getElementById('reactionName');
const reactionDescription = document.getElementById('reactionDescription');
const reactionStrategy = document.getElementById('reactionStrategy');
let selectedElements = [];
// 元素反应数据
const elementReactions = {
'hydro-pyro': {
name: '蒸发',
description: '按百分比提高本次攻击的伤害。水元素攻击火附着,提高100%(2倍伤害);火元素攻击水附着,提高50%(1.5倍伤害)。',
strategy: '优先使用水元素附着,再用火元素攻击,可以获得更高的伤害加成。适合用于单体高伤害输出。'
},
'pyro-hydro': {
name: '蒸发',
description: '按百分比提高本次攻击的伤害。水元素攻击火附着,提高100%(2倍伤害);火元素攻击水附着,提高50%(1.5倍伤害)。',
strategy: '优先使用水元素附着,再用火元素攻击,可以获得更高的伤害加成。适合用于单体高伤害输出。'
},
'hydro-cryo': {
name: '冻结',
description: '强控制,使敌人无法行动。被冻结的敌人受到重攻击时会产生碎冰反应,造成额外物理伤害。',
strategy: '适合用于控制多个敌人,配合双手剑角色可以造成大量碎冰伤害。'
},
'cryo-hydro': {
name: '冻结',
description: '强控制,使敌人无法行动。被冻结的敌人受到重攻击时会产生碎冰反应,造成额外物理伤害。',
strategy: '适合用于控制多个敌人,配合双手剑角色可以造成大量碎冰伤害。'
},
'pyro-cryo': {
name: '融化',
description: '按百分比提高本次攻击的伤害。火元素攻击冰附着,提高100%(2倍伤害);冰元素攻击火附着,提高50%(1.5倍伤害)。',
strategy: '优先使用冰元素附着,再用火元素攻击,可以获得更高的伤害加成。适合用于单体高伤害输出。'
},
'cryo-pyro': {
name: '融化',
description: '按百分比提高本次攻击的伤害。火元素攻击冰附着,提高100%(2倍伤害);冰元素攻击火附着,提高50%(1.5倍伤害)。',
strategy: '优先使用冰元素附着,再用火元素攻击,可以获得更高的伤害加成。适合用于单体高伤害输出。'
},
'pyro-electro': {
name: '超载',
description: '反应时发生爆炸,对敌人造成范围火元素伤害。超载反应造成的基础伤害仅与角色等级有关,且无法暴击。',
strategy: '适合用于清理大量敌人,但要注意爆炸可能会将敌人击飞,影响后续输出。'
},
'electro-pyro': {
name: '超载',
description: '反应时发生爆炸,对敌人造成范围火元素伤害。超载反应造成的基础伤害仅与角色等级有关,且无法暴击。',
strategy: '适合用于清理大量敌人,但要注意爆炸可能会将敌人击飞,影响后续输出。'
},
'cryo-electro': {
name: '超导',
description: '反应时发生爆炸,对敌人造成范围冰元素伤害,并降低敌人一定的防御力。',
strategy: '适合用于物理输出队伍,可以大幅降低敌人防御力,提高团队整体伤害。'
},
'electro-cryo': {
name: '超导',
description: '反应时发生爆炸,对敌人造成范围冰元素伤害,并降低敌人一定的防御力。',
strategy: '适合用于物理输出队伍,可以大幅降低敌人防御力,提高团队整体伤害。'
},
'hydro-electro': {
name: '感电',
description: '反应时对敌人造成额外雷元素伤害,若周围存在被水元素附着的敌人,则会向周围传导雷元素伤害。',
strategy: '适合用于多个敌人的场合,可以通过水元素扩散后再使用雷元素,造成连锁伤害。'
},
'electro-hydro': {
name: '感电',
description: '反应时对敌人造成额外雷元素伤害,若周围存在被水元素附着的敌人,则会向周围传导雷元素伤害。',
strategy: '适合用于多个敌人的场合,可以通过水元素扩散后再使用雷元素,造成连锁伤害。'
},
'pyro-dendro': {
name: '燃烧',
description: '在一段时间内,能够产生持续性的火属性伤害。',
strategy: '适合用于持续伤害输出,可以配合风元素扩散扩大伤害范围。'
},
'dendro-pyro': {
name: '燃烧',
description: '在一段时间内,能够产生持续性的火属性伤害。',
strategy: '适合用于持续伤害输出,可以配合风元素扩散扩大伤害范围。'
},
'anemo-pyro': {
name: '扩散',
description: '根据对象元素不同,能够造出强烈的范围伤害,并引爆其他元素反应。',
strategy: '适合用于扩大元素伤害范围,配合其他元素反应可以造成大量AOE伤害。'
},
'anemo-hydro': {
name: '扩散',
description: '根据对象元素不同,能够造出强烈的范围伤害,并引爆其他元素反应。',
strategy: '适合用于扩大元素伤害范围,配合其他元素反应可以造成大量AOE伤害。'
},
'anemo-electro': {
name: '扩散',
description: '根据对象元素不同,能够造出强烈的范围伤害,并引爆其他元素反应。',
strategy: '适合用于扩大元素伤害范围,配合其他元素反应可以造成大量AOE伤害。'
},
'anemo-cryo': {
name: '扩散',
description: '根据对象元素不同,能够造出强烈的范围伤害,并引爆其他元素反应。',
strategy: '适合用于扩大元素伤害范围,配合其他元素反应可以造成大量AOE伤害。'
},
'geo-pyro': {
name: '结晶',
description: '防御提升,能够抵消一定量的属性伤害。',
strategy: '适合用于提高队伍生存能力,拾取晶片可以获得对应元素的护盾。'
},
'geo-hydro': {
name: '结晶',
description: '防御提升,能够抵消一定量的属性伤害。',
strategy: '适合用于提高队伍生存能力,拾取晶片可以获得对应元素的护盾。'
},
'geo-electro': {
name: '结晶',
description: '防御提升,能够抵消一定量的属性伤害。',
strategy: '适合用于提高队伍生存能力,拾取晶片可以获得对应元素的护盾。'
},
'geo-cryo': {
name: '结晶',
description: '防御提升,能够抵消一定量的属性伤害。',
strategy: '适合用于提高队伍生存能力,拾取晶片可以获得对应元素的护盾。'
}
};
elementButtons.forEach(button => {
button.addEventListener('click', function() {
const element = this.getAttribute('data-element');
// 如果已经选择了两个元素,重置选择
if (selectedElements.length >= 2) {
selectedElements = [];
elementButtons.forEach(btn => btn.classList.remove('selected'));
}
// 如果当前元素已经被选择,取消选择
if (selectedElements.includes(element)) {
selectedElements = selectedElements.filter(e => e !== element);
this.classList.remove('selected');
} else {
// 否则添加到选择列表
selectedElements.push(element);
this.classList.add('selected');
}
// 如果选择了两个元素,显示反应结果
if (selectedElements.length === 2) {
const reactionKey = selectedElements.join('-');
const reaction = elementReactions[reactionKey];
if (reaction) {
reactionName.textContent = reaction.name;
reactionDescription.textContent = reaction.description;
reactionStrategy.textContent = reaction.strategy;
reactionResult.classList.add('active');
// 更新Three.js可视化
updateElementReactionVisualization(selectedElements[0], selectedElements[1]);
} else {
reactionResult.classList.remove('active');
}
} else {
reactionResult.classList.remove('active');
}
});
});
// 地区信息
const regionMarkers = document.querySelectorAll('.region-marker');
const regionInfo = document.getElementById('regionInfo');
const regionName = document.getElementById('regionName');
const regionDescription = document.getElementById('regionDescription');
const regionElement = document.getElementById('regionElement');
const regionElementIcon = document.getElementById('regionElementIcon');
const regionElementName = document.getElementById('regionElementName');
// 地区数据
const regions = {
'mondstadt': {
name: '蒙德',
description: '自由之都,风的国度。由风神巴巴托斯特约统治,人们过着自由奔放的生活。',
element: 'anemo',
elementIcon: 'fa-wind',
elementName: '风'
},
'liyue': {
name: '璃月',
description: '契约之都,岩的国度。由岩神钟离统治,以商业和契约为基础,有着悠久的历史和文化。',
element: 'geo',
elementIcon: 'fa-gem',
elementName: '岩'
},
'inazuma': {
name: '稻妻',
description: '永恒之都,雷的国度。由雷电将军统治,实行锁国政策,追求永恒的国度。',
element: 'electro',
elementIcon: 'fa-bolt',
elementName: '雷'
},
'sumeru': {
name: '须弥',
description: '智慧之都,草的国度。由智慧之神纳西妲统治,以知识和学术为尊,拥有著名的教令院。',
element: 'dendro',
elementIcon: 'fa-leaf',
elementName: '草'
},
'fontaine': {
name: '枫丹',
description: '正义之都,水的国度。由水神芙宁娜统治,以正义和审判为主题,充满了奇妙的机械装置。',
element: 'hydro',
elementIcon: 'fa-water',
elementName: '水'
}
};
regionMarkers.forEach(marker => {
marker.addEventListener('click', function() {
const region = this.getAttribute('data-region');
const regionData = regions[region];
if (regionData) {
regionName.textContent = regionData.name;
regionDescription.textContent = regionData.description;
regionElement.className = `element-icon element-${regionData.element}`;
regionElementIcon.className = `fas ${regionData.elementIcon} text-white`;
regionElementName.textContent = regionData.elementName;
regionInfo.classList.add('active');
}
});
});
// 初始化Three.js元素反应可视化
initElementReactionVisualization();
// 初始化滚动动画
initScrollAnimations();
});
// Three.js元素反应可视化
let scene, camera, renderer, element1, element2, reactionEffect;
function initElementReactionVisualization() {
// 创建场景
scene = new THREE.Scene();
// 创建相机
camera = new THREE.PerspectiveCamera(75, window.innerWidth / 500, 0.1, 1000);
camera.position.z = 5;
// 创建渲染器
const canvas = document.getElementById('elementReactionCanvas');
renderer = new THREE.WebGLRenderer({ canvas, alpha: true, antialias: true });
renderer.setSize(window.innerWidth, 500);
renderer.setPixelRatio(window.devicePixelRatio);
// 添加光源
const ambientLight = new THREE.AmbientLight(0xffffff, 0.5);
scene.add(ambientLight);
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
directionalLight.position.set(1, 1, 1);
scene.add(directionalLight);
// 动画循环
function animate() {
requestAnimationFrame(animate);
if (element1) {
element1.rotation.x += 0.01;
element1.rotation.y += 0.01;
}
if (element2) {
element2.rotation.x -= 0.01;
element2.rotation.y -= 0.01;
}
renderer.render(scene, camera);
}
// 窗口大小调整
window.addEventListener('resize', function() {
camera.aspect = window.innerWidth / 500;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, 500);
});
animate();
}
function updateElementReactionVisualization(elementA, elementB) {
// 清除现有元素
if (element1) scene.remove(element1);
if (element2) scene.remove(element2);
if (reactionEffect) scene.remove(reactionEffect);
// 创建元素几何体
const geometry = new THREE.SphereGeometry(1, 32, 32);
// 获取元素颜色
const elementColors = {
'anemo': 0x7dd3fc,
'geo': 0xf59e0b,
'electro': 0x8b5cf6,
'dendro': 0x84cc16,
'hydro': 0x3b82f6,
'pyro': 0xef4444,
'cryo': 0x06b6d4
};
// 创建材质
const material1 = new THREE.MeshStandardMaterial({
color: elementColors[elementA],
emissive: elementColors[elementA],
emissiveIntensity: 0.3,
metalness: 0.7,
roughness: 0.2
});
const material2 = new THREE.MeshStandardMaterial({
color: elementColors[elementB],
emissive: elementColors[elementB],
emissiveIntensity: 0.3,
metalness: 0.7,
roughness: 0.2
});
// 创建网格
element1 = new THREE.Mesh(geometry, material1);
element2 = new THREE.Mesh(geometry, material2);
// 设置位置
element1.position.x = -1.5;
element2.position.x = 1.5;
// 添加到场景
scene.add(element1);
scene.add(element2);
// 创建反应效果
createReactionEffect(elementA, elementB);
// 动画:元素相互靠近并产生反应
gsap.to(element1.position, { x: -0.8, duration: 1 });
gsap.to(element2.position, { x: 0.8, duration: 1 });
}
function createReactionEffect(elementA, elementB) {
// 创建粒子系统
const particlesGeometry = new THREE.BufferGeometry();
const particlesCount = 100;
const posArray = new Float32Array(particlesCount * 3);
for (let i = 0; i < particlesCount * 3; i++) {
posArray[i] = (Math.random() - 0.5) * 5;
}
particlesGeometry.setAttribute('position', new THREE.BufferAttribute(posArray, 3));
// 获取反应颜色
let reactionColor = 0xffffff;
if ((elementA === 'hydro' && elementB === 'pyro') || (elementA === 'pyro' && elementB === 'hydro')) {
reactionColor = 0xff8800; // 蒸发 - 橙色
} else if ((elementA === 'hydro' && elementB === 'cryo') || (elementA === 'cryo' && elementB === 'hydro')) {
reactionColor = 0x88ccff; // 冻结 - 浅蓝色
} else if ((elementA === 'pyro' && elementB === 'cryo') || (elementA === 'cryo' && elementB === 'pyro')) {
reactionColor = 0xff5500; // 融化 - 深橙色
} else if ((elementA === 'pyro' && elementB === 'electro') || (elementA === 'electro' && elementB === 'pyro')) {
reactionColor = 0xff4444; // 超载 - 红色
} else if ((elementA === 'cryo' && elementB === 'electro') || (elementA === 'electro' && elementB === 'cryo')) {
reactionColor = 0x8888ff; // 超导 - 紫色
} else if ((elementA === 'hydro' && elementB === 'electro') || (elementA === 'electro' && elementB === 'hydro')) {
reactionColor = 0xaa88ff; // 感电 - 淡紫色
} else if ((elementA === 'pyro' && elementB === 'dendro') || (elementA === 'dendro' && elementB === 'pyro')) {
reactionColor = 0xff6600; // 燃烧 - 橙红色
} else if (elementA === 'anemo' && ['pyro', 'hydro', 'electro', 'cryo'].includes(elementB)) {
reactionColor = 0xaaaaaa; // 扩散 - 灰色
} else if (elementB === 'anemo' && ['pyro', 'hydro', 'electro', 'cryo'].includes(elementA)) {
reactionColor = 0xaaaaaa; // 扩散 - 灰色
} else if (elementA === 'geo' && ['pyro', 'hydro', 'electro', 'cryo'].includes(elementB)) {
reactionColor = 0xdddddd; // 结晶 - 白色
} else if (elementB === 'geo' && ['pyro', 'hydro', 'electro', 'cryo'].includes(elementA)) {
reactionColor = 0xdddddd; // 结晶 - 白色
}
const particlesMaterial = new THREE.PointsMaterial({
size: 0.05,
color: reactionColor,
emissive: reactionColor,
emissiveIntensity: 0.5,
transparent: true,
opacity: 0.8
});
reactionEffect = new THREE.Points(particlesGeometry, particlesMaterial);
scene.add(reactionEffect);
// 粒子动画
gsap.to(reactionEffect.rotation, {
x: Math.PI * 2,
y: Math.PI * 2,
duration: 10,
repeat: -1,
ease: 'linear'
});
}
// 滚动动画
function initScrollAnimations() {
ScrollReveal().reveal('.character-card', {
distance: '50px',
origin: 'bottom',
opacity: 0,
duration: 1000,
interval: 200
});
ScrollReveal().reveal('.element-btn', {
distance: '30px',
origin: 'bottom',
opacity: 0,
duration: 800,
interval: 100
});
ScrollReveal().reveal('.timeline-item', {
distance: '50px',
origin: 'left',
opacity: 0,
duration: 1000,
interval: 300
});
ScrollReveal().reveal('.region-marker', {
distance: '20px',
origin: 'top',
opacity: 0,
duration: 800,
interval: 200
});
}
</script>
</body>
</html>
全部评论 1
接元神(1)后面
昨天 来自 安徽
0
有帮助,赞一个